]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
Makefile.in: don't remove configure and config.h.in in make distclean.
[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 bindir = @bindir@
30 # Pathname of directory to install the man page
31 mandir = @mandir@
32
33 # VPATH
34 srcdir = @srcdir@
35 top_srcdir = @top_srcdir@
36 VPATH = @srcdir@
37
38 #
39 # You shouldn't need to edit anything below here.
40 #
41
42 CC = @CC@
43 AR = @AR@
44 MKDEP = @MKDEP@
45 PROG = tcpdump
46 CCOPT = @V_CCOPT@
47 INCLS = -I. @V_INCLS@
48 DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
49
50 # Standard CFLAGS
51 CFLAGS = @CFLAGS@
52 FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
53
54 # Standard LDFLAGS
55 LDFLAGS = @LDFLAGS@
56
57 # Standard LIBS
58 LIBS = @LIBS@
59
60 INSTALL = @INSTALL@
61 INSTALL_PROGRAM = @INSTALL_PROGRAM@
62 INSTALL_DATA = @INSTALL_DATA@
63 RANLIB = @RANLIB@
64
65 DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
66
67 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
68 # Also, gcc does not remove the .o before forking 'as', which can be a
69 # problem if you don't own the file but can write to the directory.
70 .c.o:
71 @rm -f $@
72 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
73
74 CSRC = fptype.c tcpdump.c
75
76 LIBNETDISSECT_SRC=\
77 addrtoname.c \
78 addrtostr.c \
79 af.c \
80 ascii_strcasecmp.c \
81 checksum.c \
82 cpack.c \
83 gmpls.c \
84 in_cksum.c \
85 ipproto.c \
86 l2vpn.c \
87 machdep.c \
88 netdissect.c \
89 netdissect-alloc.c \
90 nlpid.c \
91 ntp.c \
92 oui.c \
93 parsenfsfh.c \
94 print.c \
95 print-802_11.c \
96 print-802_15_4.c \
97 print-ah.c \
98 print-ahcp.c \
99 print-aodv.c \
100 print-aoe.c \
101 print-ap1394.c \
102 print-arcnet.c \
103 print-arista.c \
104 print-arp.c \
105 print-ascii.c \
106 print-atalk.c \
107 print-atm.c \
108 print-babel.c \
109 print-bcm-li.c \
110 print-beep.c \
111 print-bfd.c \
112 print-bgp.c \
113 print-bootp.c \
114 print-brcmtag.c \
115 print-bt.c \
116 print-calm-fast.c \
117 print-carp.c \
118 print-cdp.c \
119 print-cfm.c \
120 print-chdlc.c \
121 print-cip.c \
122 print-cnfp.c \
123 print-dccp.c \
124 print-decnet.c \
125 print-dhcp6.c \
126 print-domain.c \
127 print-dsa.c \
128 print-dtp.c \
129 print-dvmrp.c \
130 print-eap.c \
131 print-egp.c \
132 print-eigrp.c \
133 print-enc.c \
134 print-esp.c \
135 print-ether.c \
136 print-fddi.c \
137 print-forces.c \
138 print-fr.c \
139 print-frag6.c \
140 print-ftp.c \
141 print-geneve.c \
142 print-geonet.c \
143 print-gre.c \
144 print-hncp.c \
145 print-hsrp.c \
146 print-http.c \
147 print-icmp.c \
148 print-icmp6.c \
149 print-igmp.c \
150 print-igrp.c \
151 print-ip-demux.c \
152 print-ip.c \
153 print-ip6.c \
154 print-ip6opts.c \
155 print-ipcomp.c \
156 print-ipfc.c \
157 print-ipnet.c \
158 print-ipoib.c \
159 print-ipx.c \
160 print-isakmp.c \
161 print-isoclns.c \
162 print-juniper.c \
163 print-krb.c \
164 print-l2tp.c \
165 print-lane.c \
166 print-ldp.c \
167 print-lisp.c \
168 print-llc.c \
169 print-lldp.c \
170 print-lmp.c \
171 print-loopback.c \
172 print-lspping.c \
173 print-lwapp.c \
174 print-lwres.c \
175 print-m3ua.c \
176 print-macsec.c \
177 print-mobile.c \
178 print-mobility.c \
179 print-mpcp.c \
180 print-mpls.c \
181 print-mptcp.c \
182 print-msdp.c \
183 print-msnlb.c \
184 print-nflog.c \
185 print-nfs.c \
186 print-nsh.c \
187 print-ntp.c \
188 print-null.c \
189 print-olsr.c \
190 print-openflow-1.0.c \
191 print-openflow-1.3.c \
192 print-openflow.c \
193 print-ospf.c \
194 print-ospf6.c \
195 print-otv.c \
196 print-pflog.c \
197 print-pgm.c \
198 print-pim.c \
199 print-pktap.c \
200 print-ppi.c \
201 print-ppp.c \
202 print-pppoe.c \
203 print-pptp.c \
204 print-ptp.c \
205 print-quic.c \
206 print-radius.c \
207 print-raw.c \
208 print-realtek.c \
209 print-resp.c \
210 print-rip.c \
211 print-ripng.c \
212 print-rpki-rtr.c \
213 print-rsvp.c \
214 print-rt6.c \
215 print-rtsp.c \
216 print-rx.c \
217 print-sctp.c \
218 print-sflow.c \
219 print-sip.c \
220 print-sl.c \
221 print-sll.c \
222 print-slow.c \
223 print-smtp.c \
224 print-snmp.c \
225 print-someip.c \
226 print-ssh.c \
227 print-stp.c \
228 print-sunatm.c \
229 print-sunrpc.c \
230 print-symantec.c \
231 print-syslog.c \
232 print-tcp.c \
233 print-telnet.c \
234 print-tftp.c \
235 print-timed.c \
236 print-tipc.c \
237 print-token.c \
238 print-udld.c \
239 print-udp.c \
240 print-unsupported.c \
241 print-usb.c \
242 print-vjc.c \
243 print-vqp.c \
244 print-vrrp.c \
245 print-vsock.c \
246 print-vtp.c \
247 print-vxlan-gpe.c \
248 print-vxlan.c \
249 print-wb.c \
250 print-whois.c \
251 print-zep.c \
252 print-zephyr.c \
253 print-zeromq.c \
254 signature.c \
255 strtoaddr.c \
256 util-print.c
257
258 LOCALSRC = @LOCALSRC@
259 LIBOBJS = @LIBOBJS@
260
261 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
262 LIBNETDISSECT=libnetdissect.a
263
264
265 SRC = $(CSRC) $(LOCALSRC)
266
267 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
268 # hack the extra indirection
269 OBJ = $(CSRC:.c=.o)
270 HDR = \
271 addrtoname.h \
272 addrtostr.h \
273 af.h \
274 ah.h \
275 appletalk.h \
276 ascii_strcasecmp.h \
277 atm.h \
278 chdlc.h \
279 compiler-tests.h \
280 cpack.h \
281 diag-control.h \
282 ethertype.h \
283 extract.h \
284 fptype.h \
285 ftmacros.h \
286 funcattrs.h \
287 getservent.h \
288 gmpls.h \
289 interface.h \
290 ip.h \
291 ip6.h \
292 ipproto.h \
293 l2vpn.h \
294 llc.h \
295 machdep.h \
296 mib.h \
297 mpls.h \
298 nameser.h \
299 netdissect.h \
300 netdissect-alloc.h \
301 netdissect-ctype.h \
302 netdissect-stdinc.h \
303 nfs.h \
304 nfsfh.h \
305 nlpid.h \
306 ntp.h \
307 openflow.h \
308 ospf.h \
309 oui.h \
310 pcap-missing.h \
311 pflog.h \
312 ppp.h \
313 print.h \
314 rpc_auth.h \
315 rpc_msg.h \
316 signature.h \
317 slcompress.h \
318 smb.h \
319 status-exit-codes.h \
320 strtoaddr.h \
321 tcp.h \
322 timeval-operations.h \
323 udp.h \
324 varattrs.h
325
326 TAGHDR = \
327 /usr/include/netinet/if_ether.h \
328 /usr/include/netinet/in.h
329
330 TAGFILES = $(SRC) $(HDR) $(TAGHDR) $(LIBNETDISSECT_SRC) \
331 print-pflog.c print-smb.c smbutil.c
332
333 CLEANFILES = $(PROG) $(OBJ) $(LIBNETDISSECT_OBJ)
334
335 EXTRA_DIST = \
336 CHANGES \
337 CMakeLists.txt \
338 CONTRIBUTING.md \
339 CREDITS \
340 INSTALL.md \
341 LICENSE \
342 Makefile-devel-adds \
343 Makefile.in \
344 README.md \
345 VERSION \
346 aclocal.m4 \
347 autogen.sh \
348 atime.awk \
349 bpf_dump.c \
350 cmake/Modules/FindCRYPTO.cmake \
351 cmake/Modules/FindPCAP.cmake \
352 cmake/Modules/FindSMI.cmake \
353 cmake_uninstall.cmake.in \
354 cmakeconfig.h.in \
355 config.guess \
356 config.sub \
357 configure.ac \
358 doc/README.aix.md \
359 doc/README.NetBSD.md \
360 doc/README.solaris.md \
361 doc/README.Win32.md \
362 install-sh \
363 instrument-functions.c \
364 lbl/os-osf4.h \
365 lbl/os-solaris2.h \
366 lbl/os-sunos4.h \
367 lbl/os-ultrix4.h \
368 makemib \
369 missing/datalinks.c \
370 missing/dlnames.c \
371 missing/getopt_long.c \
372 missing/getopt_long.h \
373 missing/getservent.c \
374 missing/pcap_dump_ftell.c \
375 missing/strdup.c \
376 missing/strlcat.c \
377 missing/strlcpy.c \
378 missing/strsep.c \
379 mkdep \
380 packetdat.awk \
381 print-pflog.c \
382 print-smb.c \
383 send-ack.awk \
384 smbutil.c \
385 stime.awk \
386 tcpdump.1.in
387
388 TEST_DIST= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
389
390 RELEASE_FILES = $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST)
391
392 all: $(PROG)
393
394 $(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT)
395 @rm -f $@
396 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBNETDISSECT) $(LIBS)
397
398 instrument_all: $(PROG)
399 @rm -f instrument_functions_global.devel
400 @rm -f instrument_functions_off.devel
401
402 instrument_global: $(PROG)
403 @touch instrument_functions_global.devel
404 @rm -f instrument_functions_off.devel
405
406 instrument_off: $(PROG)
407 @touch instrument_functions_off.devel
408 @rm -f instrument_functions_global.devel
409
410 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
411 @rm -f $@
412 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
413 $(RANLIB) $@
414
415 datalinks.o: $(srcdir)/missing/datalinks.c
416 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
417 dlnames.o: $(srcdir)/missing/dlnames.c
418 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
419 getservent.o: $(srcdir)/missing/getservent.c
420 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getservent.c
421 getopt_long.o: $(srcdir)/missing/getopt_long.c
422 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
423 strdup.o: $(srcdir)/missing/strdup.c
424 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c
425 strlcat.o: $(srcdir)/missing/strlcat.c
426 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
427 strlcpy.o: $(srcdir)/missing/strlcpy.c
428 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
429 strsep.o: $(srcdir)/missing/strsep.c
430 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
431 pcap_dump_ftell.o: $(srcdir)/missing/pcap_dump_ftell.c
432 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/pcap_dump_ftell.c
433
434 install: all
435 [ -d $(DESTDIR)$(bindir) ] || \
436 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
437 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG)
438 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
439 [ -d $(DESTDIR)$(mandir)/man1 ] || \
440 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
441 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
442
443 uninstall:
444 rm -f $(DESTDIR)$(bindir)/$(PROG)
445 rm -f $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
446 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
447
448 lint:
449 lint -hbxn $(SRC) $(LIBNETDISSECT_SRC) | \
450 grep -v 'struct/union .* never defined' | \
451 grep -v 'possible pointer alignment problem'
452
453 clean:
454 rm -f $(CLEANFILES) $(PROG)-`cat ${srcdir}/VERSION`.tar.gz
455
456 distclean: clean
457 rm -f Makefile config.cache config.log config.status \
458 config.h config.h.in~ configure~ configure.ac~ \
459 os-proto.h stamp-h stamp-h.in $(PROG).1 \
460 libnetdissect.a tests/.failed tests/.passed \
461 tests/failure-outputs.txt
462 rm -rf autom4te.cache tests/DIFF tests/NEW
463
464 check: tcpdump
465 $(srcdir)/tests/TESTrun
466
467 extags: $(TAGFILES)
468 ctags $(TAGFILES)
469
470 tags: $(TAGFILES)
471 ctags -wtd $(TAGFILES)
472
473 TAGS: $(TAGFILES)
474 etags $(TAGFILES)
475
476 #
477 # Use git archive piped to tar to construct a subdirectory whose name
478 # is tcpdump-{release}, containing all the checked-in source files,
479 # and then run autoreconf in that directory to generate the configure
480 # script and other files from that source. Then remove autom4te.cache,
481 # construct the release tarball from that subdirectory, and remove
482 # the subdirectory.
483 #
484 # The --format=tar is to force git archive to write a non-compressed
485 # archive, in case the platform's tar command doesn't have built-in
486 # decompression.
487 #
488 # The ^{tree} is there to force git archive not to write out the
489 # "helpful" global extended pax header with a commit ID, as not all
490 # versions of tar can handle that (Solaris tar can't, for example).
491 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
492 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
493 # ID associated with them, the tree associated with them doesn't have
494 # a commit ID, so no commit ID is available to write, and thus
495 # git archive doesn't write one.)
496 #
497 releasetar:
498 @TAG=$(PROG)-`cat VERSION` && \
499 if [ ! -d .git ]; then echo 'Not in a git clone, stop.'; exit 1; fi && \
500 TMPTESTFILE=`mktemp -t tmptestfile_XXXXXXXX` && \
501 rm -f "$$TMPTESTFILE" && \
502 AUTORECONF_DIR=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_$$$$ && \
503 DIR=`pwd` && \
504 rm -rf "$$AUTORECONF_DIR" && \
505 mkdir "$$AUTORECONF_DIR" && \
506 cd "$$AUTORECONF_DIR" && \
507 if git -C "$$DIR" show-ref --tags --quiet --verify -- "refs/tags/$$TAG"; then \
508 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES) | \
509 tar xf -) && \
510 echo "Archive build from tag $$TAG."; \
511 else \
512 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES) | \
513 tar xf -) && \
514 echo "No $$TAG tag. Archive build from HEAD."; \
515 fi && \
516 (cd "$$TAG" && "$${AUTORECONF:-autoreconf}" && rm -rf autom4te.cache) && \
517 tar cf "$$DIR/$$TAG".tar "$$TAG" && \
518 rm -f "$$DIR/$$TAG".tar.gz && \
519 gzip --best "$$DIR/$$TAG".tar && \
520 cd "$$DIR" && \
521 rm -rf "$$AUTORECONF_DIR"
522
523 releasecheck: releasetar
524 @TAG=$(PROG)-`cat VERSION` && \
525 INSTALL_DIR=/tmp/install_"$$TAG"_$$$$ && \
526 DIR=`pwd` && \
527 cd /tmp && \
528 rm -rf "$$TAG" && \
529 rm -rf "$$INSTALL_DIR" && \
530 tar xf "$$DIR"/"$$TAG".tar.gz && \
531 cd "$$TAG" && \
532 echo "[$@] $$ ./configure --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
533 ./configure --enable-smb --quiet --prefix="$$INSTALL_DIR" && \
534 echo '[$@] $$ make -s all check' && \
535 make -s all check >/dev/null && \
536 echo '[$@] $$ make -s install' && \
537 make -s install && \
538 cd .. && \
539 rm -rf "$$TAG" && \
540 rm -rf "$$INSTALL_DIR" && \
541 tar xf "$$DIR"/"$$TAG".tar.gz && \
542 cd "$$TAG" && \
543 mkdir build && \
544 cd build && \
545 echo '[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
546 cmake -DENABLE_SMB=yes \
547 -DCMAKE_INSTALL_PREFIX="$$INSTALL_DIR" \
548 -DCMAKE_MESSAGE_LOG_LEVEL=NOTICE \
549 -DCMAKE_RULE_MESSAGES=OFF \
550 -DCMAKE_INSTALL_MESSAGE=NEVER \
551 .. && \
552 echo '[$@] $$ make -s all check' && \
553 make -s all check >/dev/null && \
554 echo '[$@] $$ make -s install' && \
555 make -s install && \
556 cd ../.. && \
557 rm -rf "$$TAG" && \
558 rm -rf "$$INSTALL_DIR" && \
559 echo '[$@] Done.'
560
561 whitespacecheck:
562 @# trailing space(s)?
563 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
564 echo 'Error: Trailing space(s).'; \
565 exit 1; \
566 fi
567 @# trailing tab(s)?
568 @# install-sh has a tab at the end of one line
569 @if git grep -I -n ' $$' $$(git ls-files|grep -vE '^(tests/|install-sh$$)'); then \
570 echo 'Error: Trailing tabs(s).'; \
571 exit 1; \
572 fi
573
574 testlist:
575 echo $(TEST_DIST)
576
577 depend:
578 $(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC)
579
580 shellcheck:
581 shellcheck -f gcc -e SC2006 build.sh build_matrix.sh build_common.sh