]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
7e4f7b1106cc9be9978e9839c93bb2cca8b29ebc
[tcpdump] / Makefile.in
1 # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
2 # The Regents of the University of California. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that: (1) source code distributions
6 # retain the above copyright notice and this paragraph in its entirety, (2)
7 # distributions including binary code include the above copyright notice and
8 # this paragraph in its entirety in the documentation or other materials
9 # provided with the distribution, and (3) all advertising materials mentioning
10 # features or use of this software display the following acknowledgement:
11 # ``This product includes software developed by the University of California,
12 # Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13 # the University nor the names of its contributors may be used to endorse
14 # or promote products derived from this software without specific prior
15 # written permission.
16 # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19
20 #
21 # Various configurable paths (remember to edit Makefile.in, not Makefile)
22 #
23
24 # Top level hierarchy
25 prefix = @prefix@
26 exec_prefix = @exec_prefix@
27 datarootdir = @datarootdir@
28 # Pathname of directory to install the binary
29 sbindir = @sbindir@
30 # Pathname of directory to install the man page
31 mandir = @mandir@
32
33 # VPATH
34 srcdir = @srcdir@
35 VPATH = @srcdir@
36
37 #
38 # You shouldn't need to edit anything below here.
39 #
40
41 CC = @CC@
42 AR = @AR@
43 MKDEP = @MKDEP@
44 PROG = tcpdump
45 CCOPT = @V_CCOPT@
46 INCLS = -I. @V_INCLS@
47 DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
48
49 # Standard CFLAGS
50 CFLAGS = @CFLAGS@
51 FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
52
53 # Standard LDFLAGS
54 LDFLAGS = @LDFLAGS@
55
56 # Standard LIBS
57 LIBS = @LIBS@
58
59 INSTALL = @INSTALL@
60 INSTALL_PROGRAM = @INSTALL_PROGRAM@
61 INSTALL_DATA = @INSTALL_DATA@
62 RANLIB = @RANLIB@
63
64 DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
65
66 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
67 # Also, gcc does not remove the .o before forking 'as', which can be a
68 # problem if you don't own the file but can write to the directory.
69 .c.o:
70 @rm -f $@
71 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
72
73 CSRC = setsignal.c tcpdump.c util.c
74
75 LIBNETDISSECT_SRC=\
76 addrtoname.c \
77 af.c \
78 ascii_strcasecmp.c \
79 checksum.c \
80 cpack.c \
81 gmpls.c \
82 gmt2local.c \
83 in_cksum.c \
84 ipproto.c \
85 l2vpn.c \
86 machdep.c \
87 nlpid.c \
88 oui.c \
89 parsenfsfh.c \
90 print.c \
91 print-802_11.c \
92 print-802_15_4.c \
93 print-ah.c \
94 print-ahcp.c \
95 print-aodv.c \
96 print-aoe.c \
97 print-ap1394.c \
98 print-arcnet.c \
99 print-arp.c \
100 print-ascii.c \
101 print-atalk.c \
102 print-atm.c \
103 print-beep.c \
104 print-bfd.c \
105 print-bgp.c \
106 print-bootp.c \
107 print-bt.c \
108 print-calm-fast.c \
109 print-carp.c \
110 print-cdp.c \
111 print-cfm.c \
112 print-chdlc.c \
113 print-cip.c \
114 print-cnfp.c \
115 print-dccp.c \
116 print-decnet.c \
117 print-domain.c \
118 print-dtp.c \
119 print-dvmrp.c \
120 print-eap.c \
121 print-egp.c \
122 print-eigrp.c \
123 print-enc.c \
124 print-esp.c \
125 print-ether.c \
126 print-fddi.c \
127 print-forces.c \
128 print-fr.c \
129 print-ftp.c \
130 print-geneve.c \
131 print-geonet.c \
132 print-gre.c \
133 print-hsrp.c \
134 print-http.c \
135 print-icmp.c \
136 print-igmp.c \
137 print-igrp.c \
138 print-ip.c \
139 print-ip6.c \
140 print-ipcomp.c \
141 print-ipfc.c \
142 print-ipnet.c \
143 print-ipx.c \
144 print-isakmp.c \
145 print-isoclns.c \
146 print-juniper.c \
147 print-krb.c \
148 print-l2tp.c \
149 print-lane.c \
150 print-ldp.c \
151 print-llc.c \
152 print-lldp.c \
153 print-lmp.c \
154 print-loopback.c \
155 print-lspping.c \
156 print-lwapp.c \
157 print-lwres.c \
158 print-m3ua.c \
159 print-medsa.c \
160 print-mobile.c \
161 print-mpcp.c \
162 print-mpls.c \
163 print-mptcp.c \
164 print-msdp.c \
165 print-msnlb.c \
166 print-nflog.c \
167 print-nfs.c \
168 print-ntp.c \
169 print-null.c \
170 print-olsr.c \
171 print-openflow-1.0.c \
172 print-openflow.c \
173 print-ospf.c \
174 print-otv.c \
175 print-pgm.c \
176 print-pim.c \
177 print-pktap.c \
178 print-ppi.c \
179 print-ppp.c \
180 print-pppoe.c \
181 print-pptp.c \
182 print-radius.c \
183 print-raw.c \
184 print-rip.c \
185 print-rpki-rtr.c \
186 print-rrcp.c \
187 print-rsvp.c \
188 print-rtsp.c \
189 print-rx.c \
190 print-sctp.c \
191 print-sflow.c \
192 print-sip.c \
193 print-sl.c \
194 print-sll.c \
195 print-slow.c \
196 print-smtp.c \
197 print-snmp.c \
198 print-stp.c \
199 print-sunatm.c \
200 print-sunrpc.c \
201 print-symantec.c \
202 print-syslog.c \
203 print-tcp.c \
204 print-telnet.c \
205 print-tftp.c \
206 print-timed.c \
207 print-tipc.c \
208 print-token.c \
209 print-udld.c \
210 print-udp.c \
211 print-usb.c \
212 print-vjc.c \
213 print-vqp.c \
214 print-vrrp.c \
215 print-vtp.c \
216 print-vxlan.c \
217 print-wb.c \
218 print-zephyr.c \
219 print-zeromq.c \
220 signature.c \
221 util-print.c
222
223 LOCALSRC = @LOCALSRC@
224 GENSRC = version.c
225 LIBOBJS = @LIBOBJS@
226
227 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
228 LIBNETDISSECT=libnetdissect.a
229
230
231 SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
232
233 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
234 # hack the extra indirection
235 OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LIBNETDISSECT_OBJ)
236 HDR = \
237 addrtoname.h \
238 af.h \
239 ah.h \
240 appletalk.h \
241 ascii_strcasecmp.h \
242 atm.h \
243 chdlc.h \
244 cpack.h \
245 ether.h \
246 ethertype.h \
247 extract.h \
248 getopt_long.h \
249 gmpls.h \
250 gmt2local.h \
251 interface.h \
252 ip.h \
253 ip6.h \
254 ipproto.h \
255 l2vpn.h \
256 llc.h \
257 machdep.h \
258 mib.h \
259 mpls.h \
260 nameser.h \
261 netdissect.h \
262 nfs.h \
263 nfsfh.h \
264 nlpid.h \
265 openflow.h \
266 ospf.h \
267 oui.h \
268 pcap-missing.h \
269 ppp.h \
270 print.h \
271 rpc_auth.h \
272 rpc_msg.h \
273 rpl.h \
274 setsignal.h \
275 signature.h \
276 slcompress.h \
277 smb.h \
278 tcp.h \
279 tcpdump-stdinc.h \
280 udp.h
281
282 TAGHDR = \
283 /usr/include/arpa/tftp.h \
284 /usr/include/net/if_arp.h \
285 /usr/include/net/slip.h \
286 /usr/include/netinet/if_ether.h \
287 /usr/include/netinet/in.h \
288 /usr/include/netinet/ip_icmp.h \
289 /usr/include/netinet/tcp.h \
290 /usr/include/netinet/udp.h \
291 /usr/include/protocols/routed.h
292
293 TAGFILES = $(SRC) $(HDR) $(TAGHDR)
294
295 CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
296
297 EXTRA_DIST = \
298 CHANGES \
299 CREDITS \
300 INSTALL.txt \
301 LICENSE \
302 Makefile.in \
303 Makefile-devel-adds \
304 README.md \
305 Readme.Win32 \
306 VERSION \
307 aclocal.m4 \
308 atime.awk \
309 bpf_dump.c \
310 config.guess \
311 config.h.in \
312 config.sub \
313 configure \
314 configure.in \
315 install-sh \
316 lbl/os-osf4.h \
317 lbl/os-solaris2.h \
318 lbl/os-sunos4.h \
319 lbl/os-ultrix4.h \
320 makemib \
321 missing/addrinfo.h \
322 missing/dlnames.c \
323 missing/datalinks.c \
324 missing/getnameinfo.c \
325 missing/getopt_long.c \
326 missing/inet_aton.c \
327 missing/inet_ntop.c \
328 missing/inet_pton.c \
329 missing/snprintf.c \
330 missing/strdup.c \
331 missing/strlcat.c \
332 missing/strlcpy.c \
333 missing/strsep.c \
334 mkdep \
335 packetdat.awk \
336 pcap_dump_ftell.c \
337 print-babel.c \
338 print-dhcp6.c \
339 print-frag6.c \
340 print-icmp6.c \
341 print-ip6opts.c \
342 print-mobility.c \
343 print-ospf6.c \
344 print-pflog.c \
345 print-ripng.c \
346 print-rt6.c \
347 print-smb.c \
348 send-ack.awk \
349 smbutil.c \
350 stime.awk \
351 tcpdump.1.in \
352 vfprintf.c \
353 win32/Include/w32_fzs.h \
354 win32/prj/GNUmakefile \
355 win32/prj/WinDump.dsp \
356 win32/prj/WinDump.dsw
357
358 TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print`
359
360 all: $(PROG) $(LIBNETDISSECT)
361
362 $(PROG): $(OBJ) @V_PCAPDEP@
363 @rm -f $@
364 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
365
366 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
367 @rm -f $@
368 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
369 $(RANLIB) $@
370
371 datalinks.o: $(srcdir)/missing/datalinks.c
372 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
373 dlnames.o: $(srcdir)/missing/dlnames.c
374 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
375 getnameinfo.o: $(srcdir)/missing/getnameinfo.c
376 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
377 getopt_long.o: $(srcdir)/missing/getopt_long.c
378 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
379 inet_pton.o: $(srcdir)/missing/inet_pton.c
380 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
381 inet_ntop.o: $(srcdir)/missing/inet_ntop.c
382 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c
383 inet_aton.o: $(srcdir)/missing/inet_aton.c
384 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
385 snprintf.o: $(srcdir)/missing/snprintf.c
386 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
387 strdup.o: $(srcdir)/missing/strdup.c
388 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c
389 strlcat.o: $(srcdir)/missing/strlcat.c
390 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
391 strlcpy.o: $(srcdir)/missing/strlcpy.c
392 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
393 strsep.o: $(srcdir)/missing/strsep.c
394 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
395
396 version.o: version.c
397 $(CC) $(FULL_CFLAGS) -c version.c
398
399 version.c: $(srcdir)/VERSION
400 @rm -f $@
401 if grep GIT ${srcdir}/VERSION >/dev/null; then \
402 read ver <${srcdir}/VERSION; \
403 echo $$ver | tr -d '\012'; \
404 date +_%Y_%m_%d; \
405 else \
406 cat ${srcdir}/VERSION; \
407 fi | sed -e 's/.*/const char version[] = "&";/' > $@
408
409 install: all
410 [ -d $(DESTDIR)$(sbindir) ] || \
411 (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
412 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
413 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
414 [ -d $(DESTDIR)$(mandir)/man1 ] || \
415 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
416 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
417
418 uninstall:
419 rm -f $(DESTDIR)$(sbindir)/$(PROG)
420 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
421
422 lint: $(GENSRC)
423 lint -hbxn $(SRC) | \
424 grep -v 'struct/union .* never defined' | \
425 grep -v 'possible pointer alignment problem'
426
427 clean:
428 rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
429
430 distclean:
431 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
432 config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
433 libnetdissect.a tests/.failed tests/.passed \
434 tests/failure-outputs.txt
435 rm -rf autom4te.cache tests/DIFF tests/NEW
436
437 check: tcpdump
438 (cd tests && ./TESTrun.sh)
439
440 tags: $(TAGFILES)
441 ctags -wtd $(TAGFILES)
442
443 TAGS: $(TAGFILES)
444 etags $(TAGFILES)
445
446 releasetar:
447 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
448 mkdir $$name; \
449 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \
450 tar -c -z -f $$name.tar.gz $$name; \
451 rm -rf $$name
452
453 testlist:
454 echo $(TEST_DIST)
455
456 depend: $(GENSRC)
457 $(MKDEP) -c $(CC) -m $(DEPENDENCY_CFLAG) $(DEFS) $(INCLS) $(SRC)