]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
Default to first interface from pcap_findalldevs()
[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 addrtostr.c \
78 af.c \
79 ascii_strcasecmp.c \
80 checksum.c \
81 cpack.c \
82 gmpls.c \
83 gmt2local.c \
84 in_cksum.c \
85 ipproto.c \
86 l2vpn.c \
87 machdep.c \
88 nlpid.c \
89 oui.c \
90 parsenfsfh.c \
91 print.c \
92 print-802_11.c \
93 print-802_15_4.c \
94 print-ah.c \
95 print-ahcp.c \
96 print-aodv.c \
97 print-aoe.c \
98 print-ap1394.c \
99 print-arcnet.c \
100 print-arp.c \
101 print-ascii.c \
102 print-atalk.c \
103 print-atm.c \
104 print-babel.c \
105 print-beep.c \
106 print-bfd.c \
107 print-bgp.c \
108 print-bootp.c \
109 print-bt.c \
110 print-calm-fast.c \
111 print-carp.c \
112 print-cdp.c \
113 print-cfm.c \
114 print-chdlc.c \
115 print-cip.c \
116 print-cnfp.c \
117 print-dccp.c \
118 print-decnet.c \
119 print-dhcp6.c \
120 print-domain.c \
121 print-dtp.c \
122 print-dvmrp.c \
123 print-eap.c \
124 print-egp.c \
125 print-eigrp.c \
126 print-enc.c \
127 print-esp.c \
128 print-ether.c \
129 print-fddi.c \
130 print-forces.c \
131 print-fr.c \
132 print-frag6.c \
133 print-ftp.c \
134 print-geneve.c \
135 print-geonet.c \
136 print-gre.c \
137 print-hsrp.c \
138 print-http.c \
139 print-icmp.c \
140 print-icmp6.c \
141 print-igmp.c \
142 print-igrp.c \
143 print-ip.c \
144 print-ip6.c \
145 print-ip6opts.c \
146 print-ipcomp.c \
147 print-ipfc.c \
148 print-ipnet.c \
149 print-ipx.c \
150 print-isakmp.c \
151 print-isoclns.c \
152 print-juniper.c \
153 print-krb.c \
154 print-l2tp.c \
155 print-lane.c \
156 print-ldp.c \
157 print-llc.c \
158 print-lldp.c \
159 print-lmp.c \
160 print-loopback.c \
161 print-lspping.c \
162 print-lwapp.c \
163 print-lwres.c \
164 print-m3ua.c \
165 print-medsa.c \
166 print-mobile.c \
167 print-mobility.c \
168 print-mpcp.c \
169 print-mpls.c \
170 print-mptcp.c \
171 print-msdp.c \
172 print-msnlb.c \
173 print-nflog.c \
174 print-nfs.c \
175 print-ntp.c \
176 print-null.c \
177 print-olsr.c \
178 print-openflow-1.0.c \
179 print-openflow.c \
180 print-ospf.c \
181 print-ospf6.c \
182 print-otv.c \
183 print-pgm.c \
184 print-pim.c \
185 print-pktap.c \
186 print-ppi.c \
187 print-ppp.c \
188 print-pppoe.c \
189 print-pptp.c \
190 print-radius.c \
191 print-raw.c \
192 print-rip.c \
193 print-ripng.c \
194 print-rpki-rtr.c \
195 print-rrcp.c \
196 print-rsvp.c \
197 print-rt6.c \
198 print-rtsp.c \
199 print-rx.c \
200 print-sctp.c \
201 print-sflow.c \
202 print-sip.c \
203 print-sl.c \
204 print-sll.c \
205 print-slow.c \
206 print-smtp.c \
207 print-snmp.c \
208 print-stp.c \
209 print-sunatm.c \
210 print-sunrpc.c \
211 print-symantec.c \
212 print-syslog.c \
213 print-tcp.c \
214 print-telnet.c \
215 print-tftp.c \
216 print-timed.c \
217 print-tipc.c \
218 print-token.c \
219 print-udld.c \
220 print-udp.c \
221 print-usb.c \
222 print-vjc.c \
223 print-vqp.c \
224 print-vrrp.c \
225 print-vtp.c \
226 print-vxlan.c \
227 print-wb.c \
228 print-zephyr.c \
229 print-zeromq.c \
230 signature.c \
231 strtoaddr.c \
232 util-print.c
233
234 LOCALSRC = @LOCALSRC@
235 GENSRC = version.c
236 LIBOBJS = @LIBOBJS@
237
238 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
239 LIBNETDISSECT=libnetdissect.a
240
241
242 SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
243
244 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
245 # hack the extra indirection
246 OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LIBNETDISSECT_OBJ)
247 HDR = \
248 addrtoname.h \
249 addrtostr.h \
250 af.h \
251 ah.h \
252 appletalk.h \
253 ascii_strcasecmp.h \
254 atm.h \
255 chdlc.h \
256 cpack.h \
257 ether.h \
258 ethertype.h \
259 extract.h \
260 getopt_long.h \
261 gmpls.h \
262 gmt2local.h \
263 interface.h \
264 ip.h \
265 ip6.h \
266 ipproto.h \
267 l2vpn.h \
268 llc.h \
269 machdep.h \
270 mib.h \
271 mpls.h \
272 nameser.h \
273 netdissect.h \
274 nfs.h \
275 nfsfh.h \
276 nlpid.h \
277 openflow.h \
278 ospf.h \
279 oui.h \
280 pcap-missing.h \
281 ppp.h \
282 print.h \
283 rpc_auth.h \
284 rpc_msg.h \
285 rpl.h \
286 setsignal.h \
287 signature.h \
288 slcompress.h \
289 smb.h \
290 strtoaddr.h \
291 tcp.h \
292 netdissect-stdinc.h \
293 timeval-operations.h \
294 udp.h
295
296 TAGHDR = \
297 /usr/include/arpa/tftp.h \
298 /usr/include/net/if_arp.h \
299 /usr/include/net/slip.h \
300 /usr/include/netinet/if_ether.h \
301 /usr/include/netinet/in.h \
302 /usr/include/netinet/ip_icmp.h \
303 /usr/include/netinet/tcp.h \
304 /usr/include/netinet/udp.h \
305 /usr/include/protocols/routed.h
306
307 TAGFILES = $(SRC) $(HDR) $(TAGHDR)
308
309 CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
310
311 EXTRA_DIST = \
312 CHANGES \
313 CREDITS \
314 INSTALL.txt \
315 LICENSE \
316 Makefile.in \
317 Makefile-devel-adds \
318 README.md \
319 Readme.Win32 \
320 VERSION \
321 aclocal.m4 \
322 atime.awk \
323 bpf_dump.c \
324 config.guess \
325 config.h.in \
326 config.sub \
327 configure \
328 configure.in \
329 install-sh \
330 lbl/os-osf4.h \
331 lbl/os-solaris2.h \
332 lbl/os-sunos4.h \
333 lbl/os-ultrix4.h \
334 makemib \
335 missing/dlnames.c \
336 missing/datalinks.c \
337 missing/getopt_long.c \
338 missing/snprintf.c \
339 missing/strdup.c \
340 missing/strlcat.c \
341 missing/strlcpy.c \
342 missing/strsep.c \
343 mkdep \
344 packetdat.awk \
345 pcap_dump_ftell.c \
346 print-pflog.c \
347 print-smb.c \
348 send-ack.awk \
349 smbutil.c \
350 stime.awk \
351 tcpdump.1.in \
352 vfprintf.c \
353 win32/prj/GNUmakefile \
354 win32/prj/WinDump.dsp \
355 win32/prj/WinDump.dsw
356
357 TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print`
358
359 all: $(PROG) $(LIBNETDISSECT)
360
361 $(PROG): $(OBJ) @V_PCAPDEP@
362 @rm -f $@
363 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
364
365 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
366 @rm -f $@
367 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
368 $(RANLIB) $@
369
370 datalinks.o: $(srcdir)/missing/datalinks.c
371 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
372 dlnames.o: $(srcdir)/missing/dlnames.c
373 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
374 getopt_long.o: $(srcdir)/missing/getopt_long.c
375 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
376 snprintf.o: $(srcdir)/missing/snprintf.c
377 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
378 strdup.o: $(srcdir)/missing/strdup.c
379 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c
380 strlcat.o: $(srcdir)/missing/strlcat.c
381 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
382 strlcpy.o: $(srcdir)/missing/strlcpy.c
383 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
384 strsep.o: $(srcdir)/missing/strsep.c
385 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
386
387 version.o: version.c
388 $(CC) $(FULL_CFLAGS) -c version.c
389
390 version.c: $(srcdir)/VERSION
391 @rm -f $@
392 if grep GIT ${srcdir}/VERSION >/dev/null; then \
393 read ver <${srcdir}/VERSION; \
394 echo $$ver | tr -d '\012'; \
395 date +_%Y_%m_%d; \
396 else \
397 cat ${srcdir}/VERSION; \
398 fi | sed -e 's/.*/const char version[] = "&";/' > $@
399
400 install: all
401 [ -d $(DESTDIR)$(sbindir) ] || \
402 (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
403 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
404 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
405 [ -d $(DESTDIR)$(mandir)/man1 ] || \
406 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
407 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
408
409 uninstall:
410 rm -f $(DESTDIR)$(sbindir)/$(PROG)
411 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
412
413 lint: $(GENSRC)
414 lint -hbxn $(SRC) | \
415 grep -v 'struct/union .* never defined' | \
416 grep -v 'possible pointer alignment problem'
417
418 clean:
419 rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
420
421 distclean:
422 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
423 config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
424 libnetdissect.a tests/.failed tests/.passed \
425 tests/failure-outputs.txt
426 rm -rf autom4te.cache tests/DIFF tests/NEW
427
428 check: tcpdump
429 (cd tests && ./TESTrun.sh)
430
431 tags: $(TAGFILES)
432 ctags -wtd $(TAGFILES)
433
434 TAGS: $(TAGFILES)
435 etags $(TAGFILES)
436
437 releasetar:
438 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
439 mkdir $$name; \
440 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \
441 tar -c -z -f $$name.tar.gz $$name; \
442 rm -rf $$name
443
444 testlist:
445 echo $(TEST_DIST)
446
447 depend: $(GENSRC)
448 $(MKDEP) -c $(CC) -m $(DEPENDENCY_CFLAG) $(DEFS) $(INCLS) $(SRC)