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