Deleted Added
full compact
Makefile.in (146768) Makefile.in (172677)
1# Copyright (c) 1993, 1994, 1995, 1996
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#
1# Copyright (c) 1993, 1994, 1995, 1996
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# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.99 2003/12/15 01:35:03 guy Exp $ (LBL)
20# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.99.2.2 2007/07/24 02:35:15 mcr Exp $ (LBL)
21
22#
23# Various configurable paths (remember to edit Makefile.in, not Makefile)
24#
25
26# Top level hierarchy
27prefix = @prefix@
28exec_prefix = @exec_prefix@
29# Pathname of directory to install the include files
30includedir = @includedir@
31# Pathname of directory to install the library
32libdir = @libdir@
33# Pathname of directory to install the man page
34mandir = @mandir@
35
36# VPATH
37srcdir = @srcdir@
38VPATH = @srcdir@
39
40#
41# You shouldn't need to edit anything below.
42#
43
44CC = @CC@
45CCOPT = @V_CCOPT@
46INCLS = -I. @V_INCLS@
47DEFS = @DEFS@ @V_DEFS@
48LIBS = @V_LIBS@
21
22#
23# Various configurable paths (remember to edit Makefile.in, not Makefile)
24#
25
26# Top level hierarchy
27prefix = @prefix@
28exec_prefix = @exec_prefix@
29# Pathname of directory to install the include files
30includedir = @includedir@
31# Pathname of directory to install the library
32libdir = @libdir@
33# Pathname of directory to install the man page
34mandir = @mandir@
35
36# VPATH
37srcdir = @srcdir@
38VPATH = @srcdir@
39
40#
41# You shouldn't need to edit anything below.
42#
43
44CC = @CC@
45CCOPT = @V_CCOPT@
46INCLS = -I. @V_INCLS@
47DEFS = @DEFS@ @V_DEFS@
48LIBS = @V_LIBS@
49DAGLIBS = @DAGLIBS@
49DYEXT = @DYEXT@
50DYEXT = @DYEXT@
51PROG=libpcap
50
51# Standard CFLAGS
52CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
53
54INSTALL = @INSTALL@
55INSTALL_PROGRAM = @INSTALL_PROGRAM@
56INSTALL_DATA = @INSTALL_DATA@
57RANLIB = @RANLIB@
58
59#
60# Flex and bison allow you to specify the prefixes of the global symbols
61# used by the generated parser. This allows programs to use lex/yacc
62# and link against libpcap. If you don't have flex or bison, get them.
63#
64LEX = @V_LEX@
65YACC = @V_YACC@
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) $(CFLAGS) -c $(srcdir)/$*.c
73
74PSRC = pcap-@V_PCAP@.c
75FSRC = fad-@V_FINDALLDEVS@.c
76SSRC = @SSRC@
77CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
78 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
79GENSRC = scanner.c grammar.c version.c
80LIBOBJS = @LIBOBJS@
81
82SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
83
84# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
85# hack the extra indirection
86OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
87HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
88 ethertype.h gencode.h gnuc.h
89GENHDR = \
90 tokdefs.h version.h
91
92TAGHDR = \
93 pcap-bpf.h
94
95TAGFILES = \
96 $(SRC) $(HDR) $(TAGHDR)
97
98CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
99
100all: libpcap.a
101
102libpcap.a: $(OBJ)
103 @rm -f $@
104 ar rc $@ $(OBJ) $(LIBS)
105 $(RANLIB) $@
106
107shared: libpcap.$(DYEXT)
108
109#
110# XXX - this works with GNU ld, but won't necessarily work with native
111# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
112#
113libpcap.so: $(OBJ)
114 @rm -f $@
52
53# Standard CFLAGS
54CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
55
56INSTALL = @INSTALL@
57INSTALL_PROGRAM = @INSTALL_PROGRAM@
58INSTALL_DATA = @INSTALL_DATA@
59RANLIB = @RANLIB@
60
61#
62# Flex and bison allow you to specify the prefixes of the global symbols
63# used by the generated parser. This allows programs to use lex/yacc
64# and link against libpcap. If you don't have flex or bison, get them.
65#
66LEX = @V_LEX@
67YACC = @V_YACC@
68
69# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
70# Also, gcc does not remove the .o before forking 'as', which can be a
71# problem if you don't own the file but can write to the directory.
72.c.o:
73 @rm -f $@
74 $(CC) $(CFLAGS) -c $(srcdir)/$*.c
75
76PSRC = pcap-@V_PCAP@.c
77FSRC = fad-@V_FINDALLDEVS@.c
78SSRC = @SSRC@
79CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
80 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
81GENSRC = scanner.c grammar.c version.c
82LIBOBJS = @LIBOBJS@
83
84SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
85
86# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
87# hack the extra indirection
88OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
89HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
90 ethertype.h gencode.h gnuc.h
91GENHDR = \
92 tokdefs.h version.h
93
94TAGHDR = \
95 pcap-bpf.h
96
97TAGFILES = \
98 $(SRC) $(HDR) $(TAGHDR)
99
100CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
101
102all: libpcap.a
103
104libpcap.a: $(OBJ)
105 @rm -f $@
106 ar rc $@ $(OBJ) $(LIBS)
107 $(RANLIB) $@
108
109shared: libpcap.$(DYEXT)
110
111#
112# XXX - this works with GNU ld, but won't necessarily work with native
113# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
114#
115libpcap.so: $(OBJ)
116 @rm -f $@
115 ld -shared -o $@.`cat VERSION` $(OBJ)
117 $(CC) -shared -o $@.`cat VERSION` $(OBJ) $(DAGLIBS)
116
117# the following rule succeeds, but the result is untested.
118libpcap.dylib: $(OBJ)
119 rm -f libpcap*.dylib
120 $(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
121 -install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
122 -current_version `cat VERSION`
123
124
125scanner.c: $(srcdir)/scanner.l
126 @rm -f $@
127 $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
128
129scanner.o: scanner.c tokdefs.h
130 $(CC) $(CFLAGS) -c scanner.c
131
132pcap.o: version.h
133
134tokdefs.h: grammar.c
135grammar.c: $(srcdir)/grammar.y
136 @rm -f grammar.c tokdefs.h
137 $(YACC) -d $<
138 mv y.tab.c grammar.c
139 mv y.tab.h tokdefs.h
140
141grammar.o: grammar.c
142 @rm -f $@
143 $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
144
145version.o: version.c
146 $(CC) $(CFLAGS) -c version.c
147
148snprintf.o: $(srcdir)/missing/snprintf.c
149 $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
150
151version.c: $(srcdir)/VERSION
152 @rm -f $@
153 sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
154
155#
156# NOTE: this really is supposed to be static; importing a string
157# from a shared library does not work very well on many
158# versions of UNIX (Solaris, Linux, and the BSDs, for example),
159# so we make the version string static and return it from
160# a function, which does work.
161#
162version.h: $(srcdir)/VERSION
163 @rm -f $@
164 sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
165
166bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
167 rm -f bpf_filter.c
168 ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
169
170bpf_filter.o: bpf_filter.c
171 $(CC) $(CFLAGS) -c bpf_filter.c
172
173install: libpcap.a
174 [ -d $(DESTDIR)$(libdir) ] || \
175 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
176 $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
177 $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
178 [ -d $(DESTDIR)$(includedir) ] || \
179 (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
180 $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
181 $(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
182 $(DESTDIR)$(includedir)/pcap-bpf.h
183 $(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
184 $(DESTDIR)$(includedir)/pcap-namedb.h
185 [ -d $(DESTDIR)$(mandir)/man3 ] || \
186 (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
187 $(INSTALL_DATA) $(srcdir)/pcap.3 \
188 $(DESTDIR)$(mandir)/man3/pcap.3
189
190install-shared: install-shared-$(DYEXT)
191install-shared-so: libpcap.so
192 $(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
193install-shared-dylib: libpcap.dylib
194 $(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
195 VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.0.dylib; ln -sf libpcap.0.dylib libpcap.dylib
196
197uninstall:
198 rm -f $(DESTDIR)$(libdir)/libpcap.a
199 rm -f $(DESTDIR)$(includedir)/pcap.h
200 rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
201 rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
202 rm -f $(DESTDIR)$(mandir)/man3/pcap.3
203
204clean:
205 rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
206
207distclean: clean
208 rm -f Makefile config.cache config.log config.status \
209 config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
210 rm -rf autom4te.cache
211
212tags: $(TAGFILES)
213 ctags -wtd $(TAGFILES)
214
215packaging/pcap.spec: packaging/pcap.spec.in VERSION
216 RPMVERSION=`cat VERSION | sed s/-.*//g`; \
217 sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $< > $@
218
118
119# the following rule succeeds, but the result is untested.
120libpcap.dylib: $(OBJ)
121 rm -f libpcap*.dylib
122 $(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
123 -install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
124 -current_version `cat VERSION`
125
126
127scanner.c: $(srcdir)/scanner.l
128 @rm -f $@
129 $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
130
131scanner.o: scanner.c tokdefs.h
132 $(CC) $(CFLAGS) -c scanner.c
133
134pcap.o: version.h
135
136tokdefs.h: grammar.c
137grammar.c: $(srcdir)/grammar.y
138 @rm -f grammar.c tokdefs.h
139 $(YACC) -d $<
140 mv y.tab.c grammar.c
141 mv y.tab.h tokdefs.h
142
143grammar.o: grammar.c
144 @rm -f $@
145 $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
146
147version.o: version.c
148 $(CC) $(CFLAGS) -c version.c
149
150snprintf.o: $(srcdir)/missing/snprintf.c
151 $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
152
153version.c: $(srcdir)/VERSION
154 @rm -f $@
155 sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
156
157#
158# NOTE: this really is supposed to be static; importing a string
159# from a shared library does not work very well on many
160# versions of UNIX (Solaris, Linux, and the BSDs, for example),
161# so we make the version string static and return it from
162# a function, which does work.
163#
164version.h: $(srcdir)/VERSION
165 @rm -f $@
166 sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
167
168bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
169 rm -f bpf_filter.c
170 ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
171
172bpf_filter.o: bpf_filter.c
173 $(CC) $(CFLAGS) -c bpf_filter.c
174
175install: libpcap.a
176 [ -d $(DESTDIR)$(libdir) ] || \
177 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
178 $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
179 $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
180 [ -d $(DESTDIR)$(includedir) ] || \
181 (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
182 $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
183 $(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
184 $(DESTDIR)$(includedir)/pcap-bpf.h
185 $(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
186 $(DESTDIR)$(includedir)/pcap-namedb.h
187 [ -d $(DESTDIR)$(mandir)/man3 ] || \
188 (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
189 $(INSTALL_DATA) $(srcdir)/pcap.3 \
190 $(DESTDIR)$(mandir)/man3/pcap.3
191
192install-shared: install-shared-$(DYEXT)
193install-shared-so: libpcap.so
194 $(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
195install-shared-dylib: libpcap.dylib
196 $(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
197 VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.0.dylib; ln -sf libpcap.0.dylib libpcap.dylib
198
199uninstall:
200 rm -f $(DESTDIR)$(libdir)/libpcap.a
201 rm -f $(DESTDIR)$(includedir)/pcap.h
202 rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
203 rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
204 rm -f $(DESTDIR)$(mandir)/man3/pcap.3
205
206clean:
207 rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
208
209distclean: clean
210 rm -f Makefile config.cache config.log config.status \
211 config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
212 rm -rf autom4te.cache
213
214tags: $(TAGFILES)
215 ctags -wtd $(TAGFILES)
216
217packaging/pcap.spec: packaging/pcap.spec.in VERSION
218 RPMVERSION=`cat VERSION | sed s/-.*//g`; \
219 sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $< > $@
220
219tar: Makefile packaging/pcap.spec
220 @cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
221 list="" ; tar="tar chf" ; \
222 for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
223 echo \
224 "rm -f ../$$name; ln -s $$dir ../$$name" ; \
225 rm -f ../$$name; ln -s $$dir ../$$name ; \
226 echo \
227 "(cd .. ; $$tar - [lots of files]) | gzip -c > /tmp/$$name.tar.gz" ; \
228 (cd .. ; $$tar - $$list) | gzip -c > /tmp/$$name.tar.gz ; \
229 echo \
230 "rm -f ../$$name" ; \
231 rm -f ../$$name
221releasetar:
222 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
223 list="" ; make distclean; cd ..; mkdir -p n; cd n; ln -s ../$$dir $$name; \
224 tar -c -z -f $$name.tar.gz $$name/. ;
232
233depend: $(GENSRC) $(GENHDR) bpf_filter.c
234 ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
235
236Makefile: Makefile.in config.status
237 ./config.status
238 @echo your Makefile was out of date, now run $(MAKE) again
239 exit 1
225
226depend: $(GENSRC) $(GENHDR) bpf_filter.c
227 ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
228
229Makefile: Makefile.in config.status
230 ./config.status
231 @echo your Makefile was out of date, now run $(MAKE) again
232 exit 1