-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (40 loc) · 968 Bytes
/
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
52
CC=g++
SOURCES = \
DefaultHandler.cpp \
VCFParser.cpp \
MetaParser.cpp \
EntryParser.cpp \
Lexer.cpp \
Common.cpp
INCLUDES = \
DefaultHandler.h \
MetaInformation.h \
SNVEntry.h \
VCFParser.h \
Common.h \
Lexer.h \
MetaParser.h \
EntryParser.h \
TEST_SOURCES = \
main.cpp \
test-simple.cpp \
test-common.cpp
SRCDIR = src
OBJDIR = obj
TESTSDIR = test
CFLAGS =-Isrc
OBJECTS := $(addprefix $(OBJDIR)/,$(SOURCES:.cpp=.o))
TEST_OBJECTS := $(addprefix $(OBJDIR)/,$(TEST_SOURCES:.cpp=.o))
all: dirs tests
dirs:
mkdir -p $(OBJDIR)
# Get a .o from a .cpp by calling compiler with cflags and includes (if defined)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CC) $(CFLAGS) -g -O0 -c $< -o $@
$(OBJDIR)/%.o: $(TESTSDIR)/%.cpp
$(CC) $(CFLAGS) -g -O0 -c $< -o $@
tests: $(TEST_OBJECTS) $(OBJECTS) $(addprefix $(SRCDIR)/,$(INCLUDES))
$(CC) $(CFLAGS) -o test_run $(OBJECTS) $(TEST_OBJECTS) $(LFLAGS) $(LIBS)
./test_run -r compact
clean:
rm -rf obj test_run