Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
177 lines (142 loc) · 4.16 KB
/
Copy pathMakefile
File metadata and controls
177 lines (142 loc) · 4.16 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
##
## Makefile for in /home/geoffrey/Projects/pfa
##
## Made by geoffrey bauduin
## Login <baudui_g@epitech.net>
##
## Started on Wed Feb 5 14:00:43 2014 geoffrey bauduin
## Last update Sun Apr 6 16:01:29 2014 geoffrey bauduin
##
NAME= hexatylaCommon.so
SRCDIR= src
NETWORKDIR= $(SRCDIR)/Network
THREADDIR= $(SRCDIR)/Threading
PROTOCOLDIR= $(SRCDIR)/Protocol
GAMEDIR= $(SRCDIR)/Game
FACTORYDIR= $(SRCDIR)/Factory
KERNELDIR= $(SRCDIR)/Kernel
PARSERDIR= $(SRCDIR)/Parser
ALGODIR= $(SRCDIR)/Algo
UTILSDIR= $(SRCDIR)/Utils
TESTDIR= tests
NAME_TEST= common_test
SRC_NETWORK= $(NETWORKDIR)/Socket.cpp \
$(NETWORKDIR)/SSocket.cpp \
$(NETWORKDIR)/Exception.cpp
SRC_THREADING= $(THREADDIR)/Mutex.cpp \
$(THREADDIR)/Thread.cpp \
$(THREADDIR)/ScopeLock.cpp \
$(THREADDIR)/CondVar.cpp \
$(THREADDIR)/Pool.cpp
SRC_PROTOCOL= $(PROTOCOLDIR)/Error.cpp \
$(PROTOCOLDIR)/Job.cpp \
$(PROTOCOLDIR)/Color.cpp \
$(PROTOCOLDIR)/Command.cpp \
$(PROTOCOLDIR)/Difficulty.cpp \
$(PROTOCOLDIR)/Race.cpp \
$(PROTOCOLDIR)/User.cpp \
$(PROTOCOLDIR)/JobResolver.cpp
SRC_GAME= $(GAMEDIR)/Ressources.cpp \
$(GAMEDIR)/Position.cpp \
$(GAMEDIR)/Movable.cpp \
$(GAMEDIR)/Amelioration.cpp \
$(GAMEDIR)/AElement.cpp \
$(GAMEDIR)/Building.cpp \
$(GAMEDIR)/Hero.cpp \
$(GAMEDIR)/Unit.cpp \
$(GAMEDIR)/Player.cpp \
$(GAMEDIR)/Race.cpp \
$(GAMEDIR)/Projectile.cpp \
$(GAMEDIR)/Requirements.cpp \
$(GAMEDIR)/Capacity.cpp \
$(GAMEDIR)/Team.cpp \
$(GAMEDIR)/Effect.cpp \
$(GAMEDIR)/Map.cpp \
$(GAMEDIR)/Controller.cpp \
$(GAMEDIR)/Object.cpp \
$(GAMEDIR)/RessourcesSpot.cpp \
$(GAMEDIR)/ProductionQueue.cpp \
$(GAMEDIR)/ABase.cpp \
$(GAMEDIR)/Action.cpp \
$(GAMEDIR)/CanUseCapacity.cpp
SRC_FILES= $(SRCDIR)/Date.cpp \
$(SRCDIR)/Logger.cpp \
$(SRCDIR)/Clock.cpp \
$(SRCDIR)/HasSerial.cpp \
$(SRCDIR)/HasInfos.cpp \
$(SRCDIR)/HasID.cpp \
$(SRCDIR)/FileLoader.cpp \
$(SRCDIR)/NoDeleteWhileUsedByAThread.cpp
SRC_FACTORY= $(FACTORYDIR)/Factory.cpp \
$(FACTORYDIR)/Kernel.cpp \
$(FACTORYDIR)/Protocol.cpp \
$(FACTORYDIR)/Game.cpp
SRC_PARSER= $(PARSERDIR)/JSON.cpp \
$(PARSERDIR)/ARace.cpp \
$(PARSERDIR)/Map.cpp
SRC_UTILS= $(UTILSDIR)/FileReader.cpp \
$(UTILSDIR)/Hexagon.cpp
SRC_KERNEL= $(KERNELDIR)/Data.cpp \
$(KERNELDIR)/Cost.cpp \
$(KERNELDIR)/ElementRessources.cpp \
$(KERNELDIR)/Time.cpp \
$(KERNELDIR)/Manager.cpp \
$(KERNELDIR)/CapacityList.cpp \
$(KERNELDIR)/Serial.cpp \
$(KERNELDIR)/CapacityData.cpp \
$(KERNELDIR)/BuildingData.cpp \
$(KERNELDIR)/ID.cpp \
$(KERNELDIR)/Effect.cpp \
$(KERNELDIR)/Config.cpp
SRC_ALGO= $(ALGODIR)/MD5.cpp
SRC= $(SRC_NETWORK) \
$(SRC_THREADING) \
$(SRC_PROTOCOL) \
$(SRC_GAME) \
$(SRC_FILES) \
$(SRC_FACTORY) \
$(SRC_PARSER) \
$(SRC_UTILS) \
$(SRC_KERNEL) \
$(SRC_ALGO)
SRC_TEST= $(TESTDIR)/main.cpp \
$(TESTDIR)/Algo/MD5.cpp \
$(TESTDIR)/Clock.cpp \
$(TESTDIR)/Converter.cpp \
$(TESTDIR)/HasID.cpp \
$(TESTDIR)/HasSerial.cpp \
$(SRC)
OBJ= $(SRC:.cpp=.o)
OBJ_TEST= $(SRC_TEST:.cpp=.o)
DEPS= $(OBJ:.o=.deps)
LDFLAGS= -lssl -lcrypto -lpthread
INCLUDES= -Iincludes/
CXXFLAGS= $(INCLUDES) -std=c++11 -Wall -Wextra -fPIC -shared
CXX= g++
all: $(NAME)
$(NAME): $(OBJ)
$(CXX) -o $(NAME) $(OBJ) $(LDFLAGS) -shared
server: CXXFLAGS += -D__SERVER__
server: all
%.o: %.cpp
@$(CXX) -c $(CXXFLAGS) -MMD $< -o $@ -MF $(patsubst %.o, %.deps, $@) && echo "CXX\t$<"
client: CXXFLAGS += -DCLIENT__
client: all
test: comp_test $(NAME_TEST)
./$(NAME_TEST)
comp_test:
cd gtest-1.7.0/ && test -s Makefile || ( ./configure && $(MAKE) ) && cd -
$(NAME_TEST): CXXFLAGS += -Igtest-1.7.0/include/
$(NAME_TEST): LDFLAGS += ./libs/libjson.a -Wl,-rpath,./gtest-1.7.0/lib/.libs/ -L./gtest-1.7.0/lib/.libs/ -lgtest
$(NAME_TEST): $(OBJ_TEST)
$(CXX) -o $(NAME_TEST) $(OBJ_TEST) $(LDFLAGS)
clean:
rm -f $(OBJ)
rm -f $(OBJ_TEST)
fclean: clean
rm -f $(NAME)
rm -f $(NAME_TEST)
re: hardclean all
hardclean: fclean
rm -f $(DEPS)
-include $(DEPS)