-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (54 loc) · 2.03 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
CXXFLAGS += -std=c++11 -Wall -Iinclude -g0 -O3 -DNDEBUG
LIBRARY_SOURCES = api.cpp board.cpp depth-first-search.cpp \
dictionary-originated-search.cpp optimized-search.cpp dictionary.cpp \
trie-node.cpp trie.cpp
COMMON_SOURCES = $(addprefix ./src/,$(LIBRARY_SOURCES))
SANDBOX_SOURCES = $(COMMON_SOURCES) ./src/main.cpp
API_DEMO_SOURCES = $(COMMON_SOURCES) ./examples/api-demo.cpp
DEMO_SOURCES = $(COMMON_SOURCES) ./examples/demo.cpp
TASK_SOURCES = $(COMMON_SOURCES) ./test/task.cpp
STRESS_SOURCES = $(COMMON_SOURCES) ./test/stress.cpp
WORST_CASE_SOURCES = $(COMMON_SOURCES) ./test/worst-case.cpp
REENTRANCY_SOURCES = $(COMMON_SOURCES) ./test/reentrancy.cpp
Q_SOURCES = $(COMMON_SOURCES) ./test/q.cpp
TEST_SOURCES = $(TASK_SOURCES) $(FUZZ_SOURCES) $(WORST_CASE_SOURCES)
TEST_SOURCES += $(REENTRANCY_SOURCES) $(Q_SOURCES)
all: sandbox examples test
.PHONY: examples test
run: sandbox
@./bin/boggle
run-demo: examples
@./examples/demo ./examples/350k.txt
run-api-demo: examples
@./examples/api-demo ./test/task.txt
sandbox: $(SANDBOX_SOURCES)
c++ $(CXXFLAGS) $(SANDBOX_SOURCES) -o ./bin/boggle
examples: $(DEMO_SOURCES) $(API_DEMO_SOURCES)
c++ $(CXXFLAGS) $(DEMO_SOURCES) -o ./examples/demo
c++ $(CXXFLAGS) $(API_DEMO_SOURCES) -o ./examples/api-demo
test: test-task test-stress test-worst-case test-reentrancy test-q
@echo "SUCCESS: All tests passed!"
test-task: $(TASK_SOURCES)
c++ $(CXXFLAGS) $(TASK_SOURCES) -o ./test/task
@./test/task
test-stress: $(STRESS_SOURCES)
c++ $(CXXFLAGS) $(STRESS_SOURCES) -o ./test/stress
@./test/stress
test-worst-case: $(WORST_CASE_SOURCES)
c++ $(CXXFLAGS) $(WORST_CASE_SOURCES) -o ./test/worst-case
@./test/worst-case
test-reentrancy: $(REENTRANCY_SOURCES)
c++ $(CXXFLAGS) $(REENTRANCY_SOURCES) -o ./test/reentrancy
@./test/reentrancy
test-q: $(Q_SOURCES)
c++ $(CXXFLAGS) $(Q_SOURCES) -o ./test/q
@./test/q
clean:
-@rm -f ./bin/boggle
-@rm -f ./examples/demo
-@rm -f ./examples/api-demo
-@rm -f ./test/task
-@rm -f ./test/stress
-@rm -f ./test/worst-case
-@rm -f ./test/reentrancy
-@rm -f ./test/q