-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakefileO2
93 lines (68 loc) · 2.68 KB
/
MakefileO2
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
PART_OO_SRC = $(shell find src/part_oo/ -name '*.cpp')
PART_OO_BIN = libpart_oo.so
PART_DO_SRC = $(shell find src/part_do/ -name '*.cpp')
PART_DO_BIN = libpart_do.so
ECS_OO_SRC = $(shell find src/ecs_oo/ -name '*.cpp')
ECS_OO_BIN = libecs_oo.so
ECS_DO_SRC = $(shell find src/ecs_do/ -name '*.cpp')
ECS_DO_BIN = libecs_do
COMMSRC = $(shell find src/common/ -name '*.cpp')
CFLAGS = -std=c++11 -O2
# Data-oriented ECS implementation stages
S0 =
S1 = -DDO_PARTITION_ARRAYS
all: clean tests
ecs_oo: common
@tools/genheaders.sh
@echo -e "\033[1mBuilding Object-Oriented ECS\033[0m"
c++ $(CFLAGS) -fPIC -I./include -I./include/ecs_oo -c $(ECS_OO_SRC)
c++ -L./bin -lcommon -shared -o bin/$(ECS_OO_BIN) *.o
@rm *.o
ecs_do: ecs_do0 ecs_do1
ecs_do0: common
@tools/genheaders.sh
@echo -e "\033[1mBuilding Stage 0\033[0m"
c++ $(CFLAGS) $(S0) -fPIC -I./include -I./include/ecs_do -c $(ECS_DO_SRC)
c++ -L./bin -lcommon -shared -o bin/$(ECS_DO_BIN)0.so *.o
@rm *.o
ecs_do1: common
@echo -e "\033[1mBuilding Stage 1\033[0m"
c++ $(CFLAGS) $(S1) -fPIC -I./include -I./include/ecs_do -c $(ECS_DO_SRC)
c++ -L./bin -lcommon -shared -o bin/$(ECS_DO_BIN)1.so *.o
@rm *.o
part_oo: common
@tools/genheaders.sh
@echo -e "\033[1mBuilding Object-Oriented Particle System\033[0m"
c++ $(CFLAGS) -fPIC -I./include -I./include/part_oo -c $(PART_OO_SRC)
c++ -L./bin -lcommon -shared -o bin/$(PART_OO_BIN) *.o
@rm *.o
part_do: common
@tools/genheaders.sh
@echo -e "\033[1mBuilding Data-Oriented Particle System\033[0m"
c++ $(CFLAGS) -fPIC -I./include -I./include/part_do -c $(PART_DO_SRC)
c++ -L./bin -lcommon -shared -o bin/$(PART_DO_BIN) *.o
@rm *.o
common:
@mkdir -p bin
c++ $(CFLAGS) -fPIC -I./include -c $(COMMSRC)
c++ -shared -o bin/libcommon.so *.o
@rm *.o
tests: ecs part
@echo -e "\033[1mBuilding tests\033[0m"
ecs: test_ecs_oo test_ecs_do
test_ecs_oo: ecs_oo
c++ $(CFLAGS) -Wl,-rpath '-Wl,$$ORIGIN' -I./include -L./bin -lcommon -lecs_oo tests/ecs_oo.cpp -o bin/oo
test_ecs_do: test_ecs_do0 test_ecs_do1
test_ecs_do0: ecs_do0
c++ $(CFLAGS) $(S0) -Wl,-rpath '-Wl,$$ORIGIN' -I./include -L./bin -lcommon -lecs_do0 tests/ecs_do.cpp -o bin/do0
test_ecs_do1: ecs_do1
c++ $(CFLAGS) $(S1) -Wl,-rpath '-Wl,$$ORIGIN' -I./include -L./bin -lcommon -lecs_do1 tests/ecs_do.cpp -o bin/do1
part: test_part_oo test_part_do
test_part_oo: part_oo
c++ $(CFLAGS) -Wl,-rpath '-Wl,$$ORIGIN' -I./include -L./bin -lcommon -lpart_oo tests/part_oo.cpp -o bin/part_oo
test_part_do: part_do
c++ $(CFLAGS) -Wl,-rpath '-Wl,$$ORIGIN' -I./include -L./bin -lcommon -lpart_do tests/part_do.cpp -o bin/part_do
clean:
rm -rf bin/* *.o
virt: common
c++ -std=c++11 -O0 -Wl,-rpath '-Wl,$$ORIGIN' -I./include -L./bin -lcommon tests/virt.cpp -o bin/virt