-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 983 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
CC=g++
CFLAGS=-c -Wall -std=c++14
LDFLAGS=
COMMON_SOURCES=Alignment.cpp Parser.cpp ScoreMatrix.cpp Kernel.cpp
TARGET_SOURCES=main.cpp
TEST_SOURCES=test/t_parser.cpp test/tests.cpp test/t_matrix.cpp
COMMON_OBJECTS=$(COMMON_SOURCES:.cpp=.o)
TARGET_OBJECTS=$(TARGET_SOURCES:.cpp=.o)
TEST_OBJECTS=$(TEST_SOURCES:.cpp=.o)
EXECUTABLE=miniprot_boundary_scorer
TEST_EXECUTABLE=test/t_miniprot_boundary_scorer
.PHONY: test all target clean
all: target
target: $(EXECUTABLE)
test: $(TEST_EXECUTABLE)
# pull in dependency info for *existing* .o files
-include $(COMMON_OBJECTS:.o=.d)
-include $(TARGET_OBJECTS:.o=.d)
-include $(TEST_OBJECTS:.o=.d)
$(EXECUTABLE): $(COMMON_OBJECTS) $(TARGET_OBJECTS)
$(CC) $(LDFLAGS) $^ -o $@
$(TEST_EXECUTABLE): $(COMMON_OBJECTS) $(TEST_OBJECTS)
$(CC) $(LDFLAGS) $^ -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
$(CC) -MM $(CFLAGS) $< > $*.d
clean:
rm -rf $(COMMON_OBJECTS) $(TEST_OBJECTS) $(TARGET_OBJECTS) $(EXECUTABLE) $(TEST_EXECUTABLE) *.d test/*.d