fixed anytun-showtables
[anytun.git] / src / Makefile
blob552b8f1606efda11f2a4e3251006d0b65364808c
1 ##
2 ## anytun
3 ##
4 ## The secure anycast tunneling protocol (satp) defines a protocol used
5 ## for communication between any combination of unicast and anycast
6 ## tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
7 ## mode and allows tunneling of every ETHER TYPE protocol (e.g.
8 ## ethernet, ip, arp ...). satp directly includes cryptography and
9 ## message authentication based on the methodes used by SRTP. It is
10 ## intended to deliver a generic, scaleable and secure solution for
11 ## tunneling and relaying of packets of any protocol.
14 ## Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl,
15 ## Christian Pointner <satp@wirdorange.org>
17 ## This file is part of Anytun.
19 ## Anytun is free software: you can redistribute it and/or modify
20 ## it under the terms of the GNU General Public License version 3 as
21 ## published by the Free Software Foundation.
23 ## Anytun is distributed in the hope that it will be useful,
24 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
25 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ## GNU General Public License for more details.
28 ## You should have received a copy of the GNU General Public License
29 ## along with anytun. If not, see <http://www.gnu.org/licenses/>.
31 TARGET=$(shell uname -s)
32 C = gcc
33 CFLAGS = -g
34 C++ = g++
35 CCFLAGS = -g -Wall
36 LD = g++
37 LDFLAGS = -g -Wall -O2 -lboost_thread -lgcrypt -lgpg-error -lboost_serialization
39 ifeq ($(TARGET),Linux)
40 CFLAGS += -D_XOPEN_SOURCE=600
41 CCFLAGS += -D_XOPEN_SOURCE=600
42 LDFLAGS += -ldl
43 endif
44 ifeq ($(TARGET),OpenBSD)
45 CCFLAGS += -I/usr/local/include
46 LDFLAGS += -L/usr/local/lib
47 endif
49 OBJS = tunDevice.o \
50 packetSource.o \
51 buffer.o \
52 syncBuffer.o \
53 plainPacket.o \
54 encryptedPacket.o \
55 cipher.o \
56 authAlgo.o \
57 keyDerivation.o \
58 mpi.o \
59 cipherFactory.o \
60 authAlgoFactory.o \
61 keyDerivationFactory.o \
62 connectionList.o \
63 connectionParam.o \
64 networkAddress.o \
65 networkPrefix.o \
66 router.o \
67 routingTable.o \
68 signalController.o \
69 syncQueue.o \
70 log.o \
71 options.o \
72 seqWindow.o \
73 syncCommand.o \
74 syncRouteCommand.o \
75 syncRtpCommand.o \
76 syncConnectionCommand.o \
77 rtpSessionTable.o \
78 rtpSession.o \
79 anyrtpproxy/callIdQueue.o
81 SYNCOBJS= syncServer.o \
82 syncClient.o \
83 syncTcpConnection.o
85 ANYCTROBJS = signalController.o \
86 anyCtrOptions.o \
87 log.o \
88 syncTcpConnection.o \
89 syncServer.o
91 ANYCONFOBJS = log.o \
92 buffer.o \
93 keyDerivation.o \
94 mpi.o \
95 keyDerivationFactory.o \
96 networkAddress.o \
97 networkPrefix.o \
98 signalController.o \
99 connectionList.o \
100 connectionParam.o \
101 rtpSessionTable.o \
102 rtpSession.o \
103 anyrtpproxy/callIdQueue.o \
104 syncRtpCommand.o \
105 anyConfOptions.o \
106 router.o \
107 routingTable.o \
108 seqWindow.o \
109 syncQueue.o \
110 syncBuffer.o \
111 syncCommand.o \
112 syncServer.o \
113 syncTcpConnection.o \
114 syncRouteCommand.o \
115 syncConnectionCommand.o
117 EXECUTABLE = anytun anytun-config anytun-controld anytun-showtables
119 all: $(EXECUTABLE) libAnysync.a #anyrtpproxy
121 anytun: $(OBJS) $(SYNCOBJS) anytun.o
122 $(LD) $(OBJS) $(SYNCOBJS) anytun.o -o $@ $(LDFLAGS)
124 anytun-nosync: $(OBJS) anytun-nosync.o
125 $(LD) $(OBJS) anytun-nosync.o -o $@ $(LDFLAGS)
127 anytun-showtables: $(OBJS) $(SYNCOBJS) anytun-showtables.o
128 $(LD) $(OBJS) $(SYNCOBJS) anytun-showtables.o -o $@ $(LDFLAGS)
130 anytun-config: $(ANYCONFOBJS) anytun-config.o
131 $(LD) $(ANYCONFOBJS) anytun-config.o -o $@ $(LDFLAGS)
133 anytun-controld: $(ANYCTROBJS) anytun-controld.o
134 $(LD) $(ANYCTROBJS) anytun-controld.o -o $@ $(LDFLAGS)
136 tunDevice.o: tunDevice.cpp tunDevice.h
137 $(C++) $(CCFLAGS) $< -c
139 packetSource.o: packetSource.cpp packetSource.h
140 $(C++) $(CCFLAGS) $< -c
142 buffer.o: buffer.cpp buffer.h
143 $(C++) $(CCFLAGS) $< -c
145 syncBuffer.o: syncBuffer.cpp syncBuffer.h
146 $(C++) $(CCFLAGS) $< -c
148 syncServer.o: syncServer.cpp syncServer.h
149 $(C++) $(CCFLAGS) $< -c
151 syncClient.o: syncClient.cpp syncClient.h
152 $(C++) $(CCFLAGS) $< -c
154 syncTcpConnection.o: syncTcpConnection.cpp syncTcpConnection.h
155 $(C++) $(CCFLAGS) $< -c
157 controldTcpConnection.cpp: controldTcpConnection.cpp syncTcpConnection.h
158 $(C++) $(CCFLAGS) $< -c
160 rtpSessionTable.o: rtpSessionTable.cpp rtpSessionTable.h
161 $(C++) $(CCFLAGS) $< -c
163 rtpSession.o: rtpSession.cpp rtpSession.h
164 $(C++) $(CCFLAGS) $< -c
166 plainPacket.o: plainPacket.cpp plainPacket.h buffer.h
167 $(C++) $(CCFLAGS) $< -c
169 encryptedPacket.o: encryptedPacket.cpp encryptedPacket.h buffer.h
170 $(C++) $(CCFLAGS) $< -c
172 cipher.o: cipher.cpp cipher.h buffer.h
173 $(C++) $(CCFLAGS) $< -c
175 anyCtrSocket.o: anyCtrSocket.cpp anyCtrSocket.h
176 $(C++) $(CCFLAGS) $< -c
178 anyCtrOptions.o: anyCtrOptions.cpp anyCtrOptions.h
179 $(C++) $(CCFLAGS) $< -c
181 anyConfOptions.o: anyConfOptions.cpp anyConfOptions.h
182 $(C++) $(CCFLAGS) $< -c
184 authAlgo.o: authAlgo.cpp authAlgo.h buffer.h
185 $(C++) $(CCFLAGS) $< -c
187 keyDerivation.o: keyDerivation.cpp keyDerivation.h
188 $(C++) $(CCFLAGS) $< -c
190 mpi.o: mpi.cpp mpi.h
191 $(C++) $(CCFLAGS) $< -c
193 cipherFactory.o: cipherFactory.cpp cipherFactory.h cipher.h
194 $(C++) $(CCFLAGS) $< -c
196 authAlgoFactory.o: authAlgoFactory.cpp authAlgoFactory.h authAlgo.h
197 $(C++) $(CCFLAGS) $< -c
199 keyDerivationFactory.o: keyDerivationFactory.cpp keyDerivationFactory.h keyDerivation.h
200 $(C++) $(CCFLAGS) $< -c
202 routingTable.o: routingTable.cpp routingTable.h
203 $(C++) $(CCFLAGS) $< -c
205 syncCommand.o: syncCommand.cpp syncCommand.h
206 $(C++) $(CCFLAGS) $< -c
208 syncRouteCommand.o: syncRouteCommand.cpp syncRouteCommand.h
209 $(C++) $(CCFLAGS) $< -c
211 syncRtpCommand.o: syncRtpCommand.cpp syncRtpCommand.h
212 $(C++) $(CCFLAGS) $< -c
214 syncConnectionCommand.o: syncConnectionCommand.cpp syncConnectionCommand.h
215 $(C++) $(CCFLAGS) $< -c
217 syncQueue.o: syncQueue.cpp syncQueue.h
218 $(C++) $(CCFLAGS) $< -c
220 signalController.o: signalController.cpp signalController.h
221 $(C++) $(CCFLAGS) $< -c
223 PracticalSocket.o: PracticalSocket.cpp PracticalSocket.h
224 $(C++) $(CCFLAGS) $< -c
226 log.o: log.cpp log.h
227 $(C++) $(CCFLAGS) $< -c
229 options.o: options.cpp options.h
230 $(C++) $(CCFLAGS) $< -c
232 seqWindow.o: seqWindow.cpp seqWindow.h
233 $(C++) $(CCFLAGS) $< -c
235 connectionList.o: connectionList.cpp connectionList.h
236 $(C++) $(CCFLAGS) $< -c
238 connectionParam.o: connectionParam.cpp connectionParam.h
239 $(C++) $(CCFLAGS) $< -c
241 networkPrefix.o: networkPrefix.cpp networkPrefix.h
242 $(C++) $(CCFLAGS) $< -c
244 networkAddress.o: networkAddress.cpp networkAddress.h
245 $(C++) $(CCFLAGS) $< -c
247 router.o: router.cpp router.h
248 $(C++) $(CCFLAGS) $< -c
250 anytun.o: anytun.cpp
251 $(C++) $(CCFLAGS) $< -c
253 anytun-nosync.o: anytun.cpp
254 $(C++) $(CCFLAGS) -DANYTUN_NOSYNC $< -c -o anytun-nosync.o
256 anytun-showtables.o: anytun-showtables.cpp
257 $(C++) $(CCFLAGS) $< -c
259 anytun-config.o: anytun-config.cpp
260 $(C++) $(CCFLAGS) $< -c
262 anytun-controld.o: anytun-controld.cpp
263 $(C++) $(CCFLAGS) $< -c
265 cConnectionParam.o: cConnectionParam.cpp
266 $(C++) $(CCFLAGS) $< -c
268 libAnysync.a: $(OBJS)
269 ar cru $@ $(OBJS)
270 ranlib $@
272 anyrtpproxy: anytun
273 @cd anyrtpproxy ; $(MAKE)
275 distclean: cleanall
276 find . -name *.o -exec rm -f {} \;
277 rm -f config.sub config.guess
278 rm -f tunDevice.cpp tunDevice.h
280 cleanall: clean
281 $(MAKE) --directory=$(CURDIR)/man clean
283 clean:
284 rm -f *.o
285 rm -f $(EXECUTABLE)
286 rm -f anytun-nosync
287 rm -f -r doc/html/*
288 rm -f -r doc/latex/*
289 rm -f libAnysync.a
290 $(MAKE) --directory=$(CURDIR)/anyrtpproxy clean
292 manpage:
293 @cd man ; $(MAKE)
295 doxygen:
296 doxygen Doxyfile
298 ctags:
299 ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .