1 # Copyright (c) 1993, 1994, 1995, 1996
2 # The Regents of the University of California. All rights reserved.
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
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.
20 # @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.88 2001/01/18 04:05:12 guy Exp $ (LBL)
23 # Various configurable paths (remember to edit Makefile.in, not Makefile)
28 exec_prefix = @exec_prefix@
29 # Pathname of directory to install the include files
30 includedir = @includedir@
31 # Pathname of directory to install the library
33 # Pathname of directory to install the man page
41 # You shouldn't need to edit anything below.
50 CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
53 INSTALL_PROGRAM = @INSTALL_PROGRAM@
54 INSTALL_DATA = @INSTALL_DATA@
58 # Flex and bison allow you to specify the prefixes of the global symbols
59 # used by the generated parser. This allows programs to use lex/yacc
60 # and link against libpcap. If you don't have flex or bison, get them.
65 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
66 # Also, gcc does not remove the .o before forking 'as', which can be a
67 # problem if you don't own the file but can write to the directory.
70 $(CC) $(CFLAGS) -c $(srcdir)/$*.c
72 PSRC = pcap-@V_PCAP@.c
73 CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
74 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
75 GENSRC = scanner.c grammar.c version.c
78 SRC = $(PSRC) $(CSRC) $(GENSRC)
80 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
81 # hack the extra indirection
82 OBJ = $(PSRC:.c=.o) $(CSRC:.c=.o) $(GENSRC:.c=.o) # $(LIBOBJS)
83 HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
84 ethertype.h gencode.h gnuc.h
92 $(SRC) $(HDR) $(TAGHDR)
94 CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
103 scanner.c: $(srcdir)/scanner.l
105 $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
107 scanner.o: scanner.c tokdefs.h
108 $(CC) $(CFLAGS) -c scanner.c
111 grammar.c: $(srcdir)/grammar.y
112 @rm -f grammar.c tokdefs.h
119 $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
122 $(CC) $(CFLAGS) -c version.c
124 snprintf.o: $(srcdir)/../tcpdump/missing/snprintf.c
125 $(CC) $(CFLAGS) -o $@ -c $(srcdir)/../tcpdump/missing/snprintf.c
127 version.c: $(srcdir)/VERSION
129 sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
131 bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
133 ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
135 bpf_filter.o: bpf_filter.c
136 $(CC) $(CFLAGS) -c bpf_filter.c
139 [ -d $(DESTDIR)$(libdir) ] || \
140 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
141 $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
142 $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
143 [ -d $(DESTDIR)$(includedir) ] || \
144 (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
145 $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
146 $(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
147 $(DESTDIR)$(includedir)/pcap-namedb.h
148 [ -d $(DESTDIR)$(includedir)/net ] || \
149 (mkdir -p $(DESTDIR)$(includedir)/net; chmod 755 $(DESTDIR)$(includedir)/net)
150 $(INSTALL_DATA) $(srcdir)/bpf/net/bpf.h \
151 $(DESTDIR)$(includedir)/net/bpf.h
152 [ -d $(DESTDIR)$(mandir)/man3 ] || \
153 (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
154 $(INSTALL_DATA) $(srcdir)/pcap.3 \
155 $(DESTDIR)$(mandir)/man3/pcap.3
158 rm -f $(DESTDIR)$(libdir)/libpcap.a
159 rm -f $(DESTDIR)$(includedir)/pcap.h
160 rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
161 rm -f $(DESTDIR)$(includedir)/net/bpf.h
162 rm -f $(DESTDIR)$(mandir)/man3/pcap.3
168 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
169 config.h gnuc.h os-proto.h net bpf_filter.c stamp-h stamp-h.in
172 ctags -wtd $(TAGFILES)
175 @cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
176 list="" ; tar="tar chf" ; \
177 for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
179 "rm -f ../$$name; ln -s $$dir ../$$name" ; \
180 rm -f ../$$name; ln -s $$dir ../$$name ; \
182 "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
183 (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
185 "rm -f ../$$name" ; \
188 depend: $(GENSRC) bpf_filter.c
189 ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)