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.99.2.2 2007/07/24 02:35:15 mcr 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.
47 DEFS
= @DEFS@ @V_DEFS@
54 CFLAGS
= $(CCOPT
) $(INCLS
) $(DEFS
)
57 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
58 INSTALL_DATA
= @INSTALL_DATA@
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.
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.
74 $(CC
) $(CFLAGS
) -c
$(srcdir)/$*.c
76 PSRC
= pcap-@V_PCAP@.c
77 FSRC
= fad-@V_FINDALLDEVS@.c
79 CSRC
= pcap.c inet.c gencode.c optimize.c nametoaddr.c \
80 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
81 GENSRC
= scanner.c grammar.c version.c
84 SRC
= $(PSRC
) $(FSRC
) $(CSRC
) $(SSRC
) $(GENSRC
)
86 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
87 # hack the extra indirection
88 OBJ
= $(PSRC
:.c
=.o
) $(FSRC
:.c
=.o
) $(CSRC
:.c
=.o
) $(SSRC
:.c
=.o
) $(GENSRC
:.c
=.o
) $(LIBOBJS
)
89 HDR
= pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
90 ethertype.h gencode.h gnuc.h
98 $(SRC
) $(HDR
) $(TAGHDR
)
100 CLEANFILES
= $(OBJ
) libpcap.a
$(GENSRC
) $(GENHDR
) lex.yy.c
106 ar rc
$@
$(OBJ
) $(LIBS
)
109 shared
: libpcap.
$(DYEXT
)
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.
117 $(CC
) -shared
-o
$@.
`cat VERSION` $(OBJ
) $(DAGLIBS
)
119 # the following rule succeeds, but the result is untested.
120 libpcap.dylib
: $(OBJ
)
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`
127 scanner.c
: $(srcdir)/scanner.l
129 $(LEX
) -t
$< > $$$$.
$@
; mv
$$$$.
$@
$@
131 scanner.o
: scanner.c tokdefs.h
132 $(CC
) $(CFLAGS
) -c scanner.c
137 grammar.c
: $(srcdir)/grammar.y
138 @
rm -f grammar.c tokdefs.h
145 $(CC
) $(CFLAGS
) -Dyylval
=pcap_lval
-c grammar.c
148 $(CC
) $(CFLAGS
) -c version.c
150 snprintf.o
: $(srcdir)/missing
/snprintf.c
151 $(CC
) $(CFLAGS
) -o
$@
-c
$(srcdir)/missing
/snprintf.c
153 version.c
: $(srcdir)/VERSION
155 sed
-e
's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION
> $@
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.
164 version.h
: $(srcdir)/VERSION
166 sed
-e
's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION
> $@
168 bpf_filter.c
: $(srcdir)/bpf
/net
/bpf_filter.c
170 ln
-s
$(srcdir)/bpf
/net
/bpf_filter.c bpf_filter.c
172 bpf_filter.o
: bpf_filter.c
173 $(CC
) $(CFLAGS
) -c bpf_filter.c
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
192 install-shared
: install-shared-
$(DYEXT
)
193 install-shared-so
: libpcap.so
194 $(INSTALL_PROGRAM
) libpcap.so.
`cat VERSION` $(DESTDIR
)$(libdir)/libpcap.so.
`cat VERSION`
195 install-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
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
207 rm -f
$(CLEANFILES
) libpcap
*.dylib libpcap.so
*
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
215 ctags
-wtd
$(TAGFILES
)
217 packaging
/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`/ $< > $@
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/.
;
226 depend
: $(GENSRC
) $(GENHDR
) bpf_filter.c
227 .
/mkdep
-c
$(CC
) $(DEFS
) $(INCLS
) $(SRC
)
229 Makefile
: Makefile.in config.status
231 @echo your Makefile was out of date
, now run
$(MAKE
) again