-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
137 lines (103 loc) · 5.31 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# MAKEFILE
# ------ VARIABLES -------------------
CXX?=g++
CXXFLAGS+=-g -Wall -Wextra -std=c++11 -pthread -pedantic
LIBS?=
PREFIX=/usr/local/bin
# ------ TARGETS ---------------------
.PHONY: all prep permissions clean realclean install test-setup test-prep test-permissions test supertest
all: prep bin/kmer-ssr permissions test-prep test-setup test-permissions
clean:
@rm -rf bin/* test/bin/* || true
@if [ -e $(PREFIX)/kmer-ssr -a -r $(PREFIX)/kmer-ssr -a -w $(PREFIX)/kmer-ssr ] ; then rm -f $(PREFIX)/kmer-ssr || true; fi
realclean: clean
@rm -rf bin obj test/bin test/output/actual || true
prep:
@mkdir -p obj bin || true
obj/Arguments.o: src/Arguments.cpp include/Arguments.h include/version.h include/help.h include/usage.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/OutputFile.o: src/OutputFile.cpp include/OutputFile.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/AtomicityChecker.o: src/AtomicityChecker.cpp include/AtomicityChecker.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/SSR.o: src/SSR.cpp include/SSR.h include/OutputFile.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/SSRcontainer.o: src/SSRcontainer.cpp include/SSRcontainer.h include/SSR.h include/OutputFile.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/Task.o: src/Task.cpp include/Task.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/TaskQueue.o: src/TaskQueue.cpp include/TaskQueue.h include/Task.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/ProgressMeter.o: src/ProgressMeter.cpp include/ProgressMeter.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/FindSSRs.o: src/FindSSRs.cpp include/FindSSRs.h include/Arguments.h include/SSR.h include/SSRcontainer.h include/OutputFile.h include/Task.h include/TaskQueue.h include/AtomicityChecker.h include/ProgressMeter.h
$(CXX) $(CXXFLAGS) -c $< -o $@
obj/main.o: src/main.cpp include/FindSSRs.h include/Arguments.h include/SSR.h include/SSRcontainer.h include/OutputFile.h include/Task.h include/TaskQueue.h
$(CXX) $(CXXFLAGS) -c $< -o $@
bin/kmer-ssr: obj/main.o obj/OutputFile.o obj/SSR.o obj/SSRcontainer.o obj/AtomicityChecker.o obj/FindSSRs.o obj/Task.o obj/TaskQueue.o obj/Arguments.o obj/ProgressMeter.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
permissions:
@chmod 750 bin bin/kmer-ssr || true
@chmod 750 include src obj test test/src test/input test/output || true
@chmod 640 include/* src/* obj/* example/* test/src/* || true
@chmod 440 test/input/* test/output/expected/*
install:
@if [ -e bin/kmer-ssr ]; then cp bin/kmer-ssr $(PREFIX)/kmer-ssr || true; else echo "ERROR: \`bin/kmer-ssr' does not exist. Did you forget to run \`make' first?"; fi
test-setup: test-prep test/bin/atomicityChecker test/bin/progressMeter test/bin/outputFile test/bin/ssr test/bin/ssrContainer test/bin/task test/bin/taskQueue test/bin/voidPointer test/bin/arguments test/bin/findSSRs test/bin/threads test-permissions
test-prep:
@mkdir -p obj test/bin test/output/actual || true
test/bin/atomicityChecker: test/src/atomicityChecker.cpp obj/AtomicityChecker.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/progressMeter: test/src/progressMeter.cpp obj/ProgressMeter.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/outputFile: test/src/outputFile.cpp obj/OutputFile.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/ssr: test/src/ssr.cpp obj/SSR.o obj/OutputFile.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/ssrContainer: test/src/ssrContainer.cpp obj/SSRcontainer.o obj/SSR.o obj/OutputFile.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/task: test/src/task.cpp obj/Task.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/taskQueue: test/src/taskQueue.cpp obj/TaskQueue.o obj/Task.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/voidPointer: test/src/voidPointer.cpp
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/arguments: test/src/arguments.cpp obj/Arguments.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/findSSRs: test/src/findSSRs.cpp obj/FindSSRs.o obj/Arguments.o obj/TaskQueue.o obj/Task.o obj/SSRcontainer.o obj/SSR.o obj/ProgressMeter.o obj/AtomicityChecker.o obj/OutputFile.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test/bin/threads: test/src/threads.cpp obj/FindSSRs.o obj/Arguments.o obj/TaskQueue.o obj/Task.o obj/SSRcontainer.o obj/SSR.o obj/ProgressMeter.o obj/AtomicityChecker.o obj/OutputFile.o
$(CXX) $(CXXFLAGS) $(LIBS) $^ -o $@
test-permissions:
@chmod 750 test/bin || true
@chmod 750 include src obj test test/src test/input test/output || true
@chmod 770 test/output/actual || true
@chmod 640 include/* src/* obj/* example/* test/src/* || true
@chmod 440 test/input/* test/output/expected/*
test:
@test/bin/atomicityChecker
@test/bin/progressMeter
@test/bin/outputFile
@test/bin/ssr
@test/bin/ssrContainer
@test/bin/task
@test/bin/taskQueue
@test/bin/voidPointer
@test/bin/arguments
@test/bin/findSSRs
@test/bin/threads
@printf "\n"
supertest:
@valgrind --leak-check=full test/bin/atomicityChecker
@valgrind --leak-check=full test/bin/progressMeter
@valgrind --leak-check=full test/bin/outputFile
@valgrind --leak-check=full test/bin/ssr
@valgrind --leak-check=full test/bin/ssrContainer
@valgrind --leak-check=full test/bin/task
@valgrind --leak-check=full test/bin/taskQueue
@valgrind --leak-check=full test/bin/voidPointer
@valgrind --leak-check=full test/bin/arguments
@valgrind --leak-check=full test/bin/findSSRs
@valgrind --leak-check=full test/bin/threads
@printf "\n"
@printf "%s\n\n" "If you see one block still reachable in these tests, it's probably okay: http://stackoverflow.com/a/30403709"