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