anytun-nosync builds on OpenBSD now
[anytun.git] / src / Makefile
bloba1f102ec604f31f771db17168990e35f915a6662
1 TARGET=$(shell uname -s)
2 C = gcc
3 CFLAGS = -g
4 CFLAGS += -DSOCKETS_NAMESPACE=sockets
5 CFLAGS += -DSOCKETS_NAMESPACE_STR='"sockets"'
6 C++ = g++
7 CCFLAGS = -g -Wall
8 CCFLAGS += -DSOCKETS_NAMESPACE=sockets
9 CCFLAGS += -DSOCKETS_NAMESPACE_STR='"sockets"'
10 LD = g++
11 LDFLAGS = -g -Wall -O2 -lpthread -lgcrypt -lgpg-error -lboost_serialization
13 ifeq ($(TARGET),Linux)
14 LDFLAGS += -ldl
15 endif
16 ifeq ($(TARGET),OpenBSD)
17 CCFLAGS += -I/usr/local/include
18 LDFLAGS += -L/usr/local/lib
19 endif
22 OPENVPNDEPS = openvpn/tun.o \
23 openvpn/error.o \
24 openvpn/socket.o \
25 openvpn/buffer.o \
26 openvpn/misc.o \
27 openvpn/manage.o \
28 openvpn/fdmisc.o \
29 openvpn/otime.o \
30 openvpn/options.o \
31 openvpn/mtu.o \
32 openvpn/plugin.o \
33 openvpn/sig.o \
34 openvpn/proxy.o \
35 openvpn/socks.o \
36 openvpn/status.o \
37 openvpn/event.o \
38 openvpn/route.o \
39 openvpn/helper.o \
40 openvpn/init.o \
41 openvpn/interval.o \
42 openvpn/base64.o \
43 openvpn/shaper.o \
44 openvpn/fragment.o
46 SOCKETDEPS = Sockets/libSockets.a
48 #Sockets/TcpSocket.o \
49 # Sockets/Socket.o \
50 # Sockets/Thread.o \
51 # Sockets/SocketHandler.o \
52 # Sockets/Ipv4Address.o \
53 # Sockets/Mutex.o \
54 # Sockets/SSLInitializer.o
57 OBJS = tunDevice.o \
58 packetSource.o \
59 buffer.o \
60 syncBuffer.o \
61 plainPacket.o \
62 encryptedPacket.o \
63 cipher.o \
64 authAlgo.o \
65 keyDerivation.o \
66 mpi.o \
67 cipherFactory.o \
68 authAlgoFactory.o \
69 keyDerivationFactory.o \
70 connectionList.o \
71 connectionParam.o \
72 networkAddress.o \
73 networkPrefix.o \
74 PracticalSocket.o \
75 router.o \
76 routingTable.o \
77 signalController.o \
78 syncQueue.o \
79 log.o \
80 options.o \
81 seqWindow.o \
82 syncCommand.o \
83 syncRouteCommand.o \
84 syncRtpCommand.o \
85 syncConnectionCommand.o \
86 rtpSessionTable.o \
87 rtpSession.o \
88 anyrtpproxy/callIdQueue.o \
89 $(OPENVPNDEPS)
91 SYNCOBJS= syncSocket.o \
92 syncSocketHandler.o \
93 syncClientSocket.o \
94 $(SOCKETDEPS)
96 ANYCTROBJS = anyCtrSocket.o \
97 anyCtrOptions.o \
98 signalController.o \
99 log.o \
100 $(SOCKETDEPS)
102 ANYCONFOBJS = log.o \
103 buffer.o \
104 keyDerivation.o \
105 mpi.o \
106 keyDerivationFactory.o \
107 networkAddress.o \
108 networkPrefix.o \
109 signalController.o \
110 connectionList.o \
111 connectionParam.o \
112 rtpSessionTable.o \
113 rtpSession.o \
114 anyrtpproxy/callIdQueue.o \
115 syncRtpCommand.o \
116 PracticalSocket.o \
117 anyConfOptions.o \
118 router.o \
119 routingTable.o \
120 seqWindow.o \
121 syncSocket.o \
122 syncSocketHandler.o \
123 syncClientSocket.o \
124 syncQueue.o \
125 syncBuffer.o \
126 syncCommand.o \
127 syncRouteCommand.o \
128 syncConnectionCommand.o \
129 $(SOCKETDEPS)
131 EXECUTABLE = anytun anytun-config anytun-controld anytun-showtables manpage
133 all: $(EXECUTABLE) libAnysync.a anyrtpproxy
135 anytun: $(OBJS) $(SYNCOBJS) anytun.o
136 $(LD) $(OBJS) $(SYNCOBJS) anytun.o -o $@ $(LDFLAGS)
138 anytun-nosync: $(OBJS) anytun-nosync.o
139 $(LD) $(OBJS) anytun-nosync.o -o $@ $(LDFLAGS)
141 anytun-showtables: $(OBJS) anytun-showtables.o
142 $(LD) $(OBJS) anytun-showtables.o -o $@ $(LDFLAGS)
144 anytun-config: $(ANYCONFOBJS) anytun-config.o
145 $(LD) $(ANYCONFOBJS) anytun-config.o -o $@ $(LDFLAGS)
147 anytun-controld: $(ANYCTROBJS) anytun-controld.o
148 $(LD) $(ANYCTROBJS) anytun-controld.o -o $@ $(LDFLAGS)
150 tunDevice.o: tunDevice.cpp tunDevice.h
151 $(C++) $(CCFLAGS) $< -c
153 Sockets/libSockets.a:
154 $(MAKE) --directory=./Sockets
156 packetSource.o: packetSource.cpp packetSource.h
157 $(C++) $(CCFLAGS) $< -c
159 buffer.o: buffer.cpp buffer.h
160 $(C++) $(CCFLAGS) $< -c
162 syncBuffer.o: syncBuffer.cpp syncBuffer.h
163 $(C++) $(CCFLAGS) $< -c
165 rtpSessionTable.o: rtpSessionTable.cpp rtpSessionTable.h
166 $(C++) $(CCFLAGS) $< -c
168 rtpSession.o: rtpSession.cpp rtpSession.h
169 $(C++) $(CCFLAGS) $< -c
171 plainPacket.o: plainPacket.cpp plainPacket.h buffer.h
172 $(C++) $(CCFLAGS) $< -c
174 encryptedPacket.o: encryptedPacket.cpp encryptedPacket.h buffer.h
175 $(C++) $(CCFLAGS) $< -c
177 cipher.o: cipher.cpp cipher.h buffer.h
178 $(C++) $(CCFLAGS) $< -c
180 anyCtrSocket.o: anyCtrSocket.cpp anyCtrSocket.h
181 $(C++) $(CCFLAGS) $< -c
183 anyCtrOptions.o: anyCtrOptions.cpp anyCtrOptions.h
184 $(C++) $(CCFLAGS) $< -c
186 anyConfOptions.o: anyConfOptions.cpp anyConfOptions.h
187 $(C++) $(CCFLAGS) $< -c
189 authAlgo.o: authAlgo.cpp authAlgo.h buffer.h
190 $(C++) $(CCFLAGS) $< -c
192 keyDerivation.o: keyDerivation.cpp keyDerivation.h
193 $(C++) $(CCFLAGS) $< -c
195 mpi.o: mpi.cpp mpi.h
196 $(C++) $(CCFLAGS) $< -c
198 cipherFactory.o: cipherFactory.cpp cipherFactory.h cipher.h
199 $(C++) $(CCFLAGS) $< -c
201 authAlgoFactory.o: authAlgoFactory.cpp authAlgoFactory.h authAlgo.h
202 $(C++) $(CCFLAGS) $< -c
204 keyDerivationFactory.o: keyDerivationFactory.cpp keyDerivationFactory.h keyDerivation.h
205 $(C++) $(CCFLAGS) $< -c
207 routingTable.o: routingTable.cpp routingTable.h
208 $(C++) $(CCFLAGS) $< -c
210 syncSocket.o: syncSocket.cpp syncSocket.h
211 $(C++) $(CCFLAGS) $< -c
213 syncSocketHandler.o: syncSocketHandler.cpp syncSocketHandler.h
214 $(C++) $(CCFLAGS) $< -c
216 syncCommand.o: syncCommand.cpp syncCommand.h
217 $(C++) $(CCFLAGS) $< -c
219 syncRouteCommand.o: syncRouteCommand.cpp syncRouteCommand.h
220 $(C++) $(CCFLAGS) $< -c
222 syncRtpCommand.o: syncRtpCommand.cpp syncRtpCommand.h
223 $(C++) $(CCFLAGS) $< -c
225 syncConnectionCommand.o: syncConnectionCommand.cpp syncConnectionCommand.h
226 $(C++) $(CCFLAGS) $< -c
228 syncClientSocket.o: syncClientSocket.cpp syncClientSocket.h
229 $(C++) $(CCFLAGS) $< -c
231 syncQueue.o: syncQueue.cpp syncQueue.h
232 $(C++) $(CCFLAGS) $< -c
234 signalController.o: signalController.cpp signalController.h
235 $(C++) $(CCFLAGS) $< -c
237 PracticalSocket.o: PracticalSocket.cpp PracticalSocket.h
238 $(C++) $(CCFLAGS) $< -c
240 log.o: log.cpp log.h
241 $(C++) $(CCFLAGS) $< -c
243 options.o: options.cpp options.h
244 $(C++) $(CCFLAGS) $< -c
246 seqWindow.o: seqWindow.cpp seqWindow.h
247 $(C++) $(CCFLAGS) $< -c
249 connectionList.o: connectionList.cpp connectionList.h
250 $(C++) $(CCFLAGS) $< -c
252 connectionParam.o: connectionParam.cpp connectionParam.h
253 $(C++) $(CCFLAGS) $< -c
255 networkPrefix.o: networkPrefix.cpp networkPrefix.h
256 $(C++) $(CCFLAGS) $< -c
258 networkAddress.o: networkAddress.cpp networkAddress.h
259 $(C++) $(CCFLAGS) $< -c
261 router.o: router.cpp router.h
262 $(C++) $(CCFLAGS) $< -c
264 anytun.o: anytun.cpp
265 $(C++) $(CCFLAGS) $< -c
267 anytun-nosync.o: anytun.cpp
268 $(C++) $(CCFLAGS) -DANYTUN_NOSYNC $< -c -o anytun-nosync.o
270 anytun-showtables.o: anytun-showtables.cpp
271 $(C++) $(CCFLAGS) $< -c
273 anytun-config.o: anytun-config.cpp
274 $(C++) $(CCFLAGS) $< -c
276 anytun-controld.o: anytun-controld.cpp
277 $(C++) $(CCFLAGS) $< -c
279 cConnectionParam.o: cConnectionParam.cpp
280 $(C++) $(CCFLAGS) $< -c
282 libAnysync.a: $(OBJS)
283 ar cru $@ $(OBJS)
284 ranlib $@
286 anyrtpproxy: anytun
287 @cd anyrtpproxy ; $(MAKE)
289 distclean: cleanall
290 $(MAKE) --directory=$(CURDIR)/openvpn distclean
291 find . -name *.o -exec rm -f {} \;
292 rm -f config.sub config.guess
294 cleanall: clean
295 $(MAKE) --directory=$(CURDIR)/man clean
296 $(MAKE) --directory=$(CURDIR)/Sockets clean
297 $(MAKE) --directory=$(CURDIR)/openvpn clean
298 rm -f Sockets/libSockets.a Sockets/Sockets-config
300 clean:
301 rm -f *.o
302 rm -f $(EXECUTABLE)
303 rm -f anytun-nosync
304 rm -f -r doc/html/*
305 rm -f -r doc/latex/*
306 rm -f libAnysync.a
307 $(MAKE) --directory=$(CURDIR)/anyrtpproxy clean
309 manpage:
310 @cd man ; $(MAKE)
312 doxygen:
313 doxygen Doxyfile
315 ctags:
316 ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .