-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (36 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CXX ?= g++
INCLUDE_DIR += -I./include -I./gfalibs/include
WARNINGS = -Wall -Wextra
CXXFLAGS = -g -std=gnu++14 -O3 $(INCLUDE_DIR) $(WARNINGS) $(CFLAGS)
TARGET = rdeval
TEST_TARGET = validate
GENERATE_TARGET = generate-tests
BUILD = build/bin
SOURCE = src
INCLUDE = include
BINDIR := $(BUILD)/.o
LDFLAGS += -pthread
LIBS = -lz -lcrypto
OBJS := main input reads
BINS := $(addprefix $(BINDIR)/, $(OBJS))
#gfalibs
GFALIBS_DIR := $(CURDIR)/gfalibs
head: $(BINS) gfalibs | $(BUILD)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(BUILD)/$(TARGET) $(BINDIR)/* $(GFALIBS_DIR)/*.o $(LIBS)
all: head validate regenerate
$(BINDIR)%: $(SOURCE)/%.cpp $(INCLUDE)/%.h | $(BINDIR)
$(CXX) $(CXXFLAGS) -c $(SOURCE)/$(notdir $@).cpp -o $@
.PHONY: gfalibs
gfalibs:
$(MAKE) -j -C $(GFALIBS_DIR)
validate: | $(BUILD)
$(CXX) $(CXXFLAGS) -o $(BUILD)/$(TARGET)-$(TEST_TARGET) $(SOURCE)/$(TEST_TARGET).cpp
regenerate: | $(BUILD)
$(CXX) $(CXXFLAGS) -o $(BUILD)/$(TARGET)-$(GENERATE_TARGET) $(SOURCE)/$(GENERATE_TARGET).cpp
$(BUILD):
-mkdir -p $@
$(BINDIR):
-mkdir -p $@
clean:
$(MAKE) -j -C $(GFALIBS_DIR) clean
$(RM) -r build