]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
Suppress "casting away const" warnings in missing/getopt_long.c.
[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-pgm.c \
197 print-pim.c \
198 print-pktap.c \
199 print-ppi.c \
200 print-ppp.c \
201 print-pppoe.c \
202 print-pptp.c \
203 print-ptp.c \
204 print-radius.c \
205 print-raw.c \
206 print-resp.c \
207 print-rip.c \
208 print-ripng.c \
209 print-rpki-rtr.c \
210 print-rrcp.c \
211 print-rsvp.c \
212 print-rt6.c \
213 print-rtsp.c \
214 print-rx.c \
215 print-sctp.c \
216 print-sflow.c \
217 print-sip.c \
218 print-sl.c \
219 print-sll.c \
220 print-slow.c \
221 print-smtp.c \
222 print-snmp.c \
223 print-someip.c \
224 print-ssh.c \
225 print-stp.c \
226 print-sunatm.c \
227 print-sunrpc.c \
228 print-symantec.c \
229 print-syslog.c \
230 print-tcp.c \
231 print-telnet.c \
232 print-tftp.c \
233 print-timed.c \
234 print-tipc.c \
235 print-token.c \
236 print-udld.c \
237 print-udp.c \
238 print-unsupported.c \
239 print-usb.c \
240 print-vjc.c \
241 print-vqp.c \
242 print-vrrp.c \
243 print-vsock.c \
244 print-vtp.c \
245 print-vxlan-gpe.c \
246 print-vxlan.c \
247 print-wb.c \
248 print-zep.c \
249 print-zephyr.c \
250 print-zeromq.c \
251 signature.c \
252 strtoaddr.c \
253 util-print.c
254
255 LOCALSRC = @LOCALSRC@
256 LIBOBJS = @LIBOBJS@
257
258 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
259 LIBNETDISSECT=libnetdissect.a
260
261
262 SRC = $(CSRC) $(LOCALSRC)
263
264 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
265 # hack the extra indirection
266 OBJ = $(CSRC:.c=.o)
267 HDR = \
268 addrtoname.h \
269 addrtostr.h \
270 af.h \
271 ah.h \
272 appletalk.h \
273 ascii_strcasecmp.h \
274 atm.h \
275 chdlc.h \
276 compiler-tests.h \
277 cpack.h \
278 diag-control.h \
279 ethertype.h \
280 extract.h \
281 fptype.h \
282 ftmacros.h \
283 funcattrs.h \
284 getservent.h \
285 gmpls.h \
286 interface.h \
287 ip.h \
288 ip6.h \
289 ipproto.h \
290 l2vpn.h \
291 llc.h \
292 machdep.h \
293 mib.h \
294 mpls.h \
295 nameser.h \
296 netdissect.h \
297 netdissect-alloc.h \
298 netdissect-ctype.h \
299 netdissect-stdinc.h \
300 nfs.h \
301 nfsfh.h \
302 nlpid.h \
303 ntp.h \
304 openflow.h \
305 ospf.h \
306 oui.h \
307 pcap-missing.h \
308 ppp.h \
309 print.h \
310 rpc_auth.h \
311 rpc_msg.h \
312 signature.h \
313 slcompress.h \
314 smb.h \
315 status-exit-codes.h \
316 strtoaddr.h \
317 tcp.h \
318 timeval-operations.h \
319 udp.h \
320 varattrs.h
321
322 TAGHDR = \
323 /usr/include/netinet/if_ether.h \
324 /usr/include/netinet/in.h
325
326 TAGFILES = $(SRC) $(HDR) $(TAGHDR) $(LIBNETDISSECT_SRC) \
327 print-pflog.c print-smb.c smbutil.c
328
329 CLEANFILES = $(PROG) $(OBJ) $(LIBNETDISSECT_OBJ)
330
331 EXTRA_DIST = \
332 CHANGES \
333 CONTRIBUTING \
334 CREDITS \
335 CMakeLists.txt \
336 INSTALL.txt \
337 LICENSE \
338 Makefile.in \
339 Makefile-devel-adds \
340 README.md \
341 VERSION \
342 aclocal.m4 \
343 atime.awk \
344 bpf_dump.c \
345 cmake_uninstall.cmake.in \
346 cmakeconfig.h.in \
347 cmake/Modules/FindCRYPTO.cmake \
348 cmake/Modules/FindPCAP.cmake \
349 cmake/Modules/FindSMI.cmake \
350 config.guess \
351 config.h.in \
352 config.sub \
353 configure \
354 configure.ac \
355 doc/README.Win32.md \
356 install-sh \
357 lbl/os-osf4.h \
358 lbl/os-solaris2.h \
359 lbl/os-sunos4.h \
360 lbl/os-ultrix4.h \
361 makemib \
362 missing/dlnames.c \
363 missing/datalinks.c \
364 missing/getopt_long.h \
365 missing/getopt_long.c \
366 missing/getservent.c \
367 missing/pcap_dump_ftell.c \
368 missing/snprintf.c \
369 missing/strdup.c \
370 missing/strlcat.c \
371 missing/strlcpy.c \
372 missing/strsep.c \
373 missing/win_ether_ntohost.c \
374 missing/win_ether_ntohost.h \
375 mkdep \
376 packetdat.awk \
377 print-pflog.c \
378 print-smb.c \
379 send-ack.awk \
380 smbutil.c \
381 stime.awk \
382 tcpdump.1.in
383
384 TEST_DIST= `git ls-files tests | grep -v 'tests/\..*'`
385
386 all: $(PROG)
387
388 $(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT)
389 @rm -f $@
390 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBNETDISSECT) $(LIBS)
391
392 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
393 @rm -f $@
394 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
395 $(RANLIB) $@
396
397 datalinks.o: $(srcdir)/missing/datalinks.c
398 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
399 dlnames.o: $(srcdir)/missing/dlnames.c
400 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
401 getservent.o: $(srcdir)/missing/getservent.c
402 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getservent.c
403 getopt_long.o: $(srcdir)/missing/getopt_long.c
404 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
405 snprintf.o: $(srcdir)/missing/snprintf.c
406 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
407 strdup.o: $(srcdir)/missing/strdup.c
408 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c
409 strlcat.o: $(srcdir)/missing/strlcat.c
410 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
411 strlcpy.o: $(srcdir)/missing/strlcpy.c
412 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
413 strsep.o: $(srcdir)/missing/strsep.c
414 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
415 pcap_dump_ftell.o: $(srcdir)/missing/pcap_dump_ftell.c
416 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/pcap_dump_ftell.c
417
418 install: all
419 [ -d $(DESTDIR)$(bindir) ] || \
420 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
421 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG)
422 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
423 [ -d $(DESTDIR)$(mandir)/man1 ] || \
424 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
425 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
426
427 uninstall:
428 rm -f $(DESTDIR)$(bindir)/$(PROG)
429 rm -f $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
430 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
431
432 lint:
433 lint -hbxn $(SRC) $(LIBNETDISSECT_SRC) | \
434 grep -v 'struct/union .* never defined' | \
435 grep -v 'possible pointer alignment problem'
436
437 clean:
438 rm -f $(CLEANFILES) $(PROG)-`cat ${srcdir}/VERSION`.tar.gz
439
440 distclean:
441 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
442 config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
443 libnetdissect.a tests/.failed tests/.passed \
444 tests/failure-outputs.txt
445 rm -rf autom4te.cache tests/DIFF tests/NEW
446
447 check: tcpdump
448 $(srcdir)/tests/TESTrun
449
450 extags: $(TAGFILES)
451 ctags $(TAGFILES)
452
453 tags: $(TAGFILES)
454 ctags -wtd $(TAGFILES)
455
456 TAGS: $(TAGFILES)
457 etags $(TAGFILES)
458
459 releasetar:
460 @autoreconf -f && \
461 name=$(PROG)-`cat VERSION` && \
462 mkdir $$name && \
463 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -) && \
464 tar cf - $$name | gzip >$$name.tar.gz && \
465 rm -rf $$name
466
467 rc1 rc2 rc3 rc4 rc5:
468 @VER=`cat $(srcdir)/VERSION`; \
469 sed -i "s/$$VER/$${VER}$@/" VERSION ; \
470 make releasetar; \
471 git checkout VERSION configure
472
473 testlist:
474 echo $(TEST_DIST)
475
476 depend:
477 $(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC)
478
479 shellcheck:
480 shellcheck -f gcc build.sh build_matrix.sh build_common.sh