-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 1.43 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
game_objects = brick.o game_impl.o player.o position.o naive_winner_strategy.o
build_game_objects = $(addprefix build/, $(game_objects))
gg = g++ -Wall -g -Iinclude/ -Isrc/ -std=c++11
gg_compile = $(gg) -c
test_objects = test_main.o test_file.o
build_test_objects = $(addprefix build/, $(test_objects))
libraries = lib/libgtest.a -lpthread
src = src
build = build
VPATH = src/ include/ build/
test: $(game_objects) $(test_objects)
echo "invoking linker"
$(gg) $(build_test_objects) $(build_game_objects) -o test $(libraries)
console_ui: $(game_objects) console_ui.cpp
$(gg) $(build_game_objects) $(src)/console_ui.cpp -o console_game
test_main.o: gtest/gtest.h test_main.cpp
$(gg_compile) test_main.cpp -o $(build)/test_main.o
test_file.o: gtest/gtest.h game_impl.h test_file.cpp
$(gg_compile) test_file.cpp -o $(build)/test_file.o
position.o: position.h position.cpp
$(gg_compile) $(src)/position.cpp -o $(build)/position.o
player.o: player.h color.h player.cpp
$(gg_compile) $(src)/player.cpp -o $(build)/player.o
brick.o: color.h brick.h brick.cpp
$(gg_compile) $(src)/brick.cpp -o $(build)/brick.o
game_impl.o: game_impl.h game.h game_impl.cpp
$(gg_compile) $(src)/game_impl.cpp -o $(build)/game_impl.o
naive_winner_strategy.o: winner_strategy.h naive_winner_strategy.h naive_winner_strategy.cpp
$(gg_compile) $(src)/naive_winner_strategy.cpp -o $(build)/naive_winner_strategy.o
clean:
rm build/*.o
rm test
rm console_ui