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.72 1999-10-07 23:46:40 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 INCLDEST
= @
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
)
56 # Flex and bison allow you to specify the prefixes of the global symbols
57 # used by the generated parser. This allows programs to use lex/yacc
58 # and link against libpcap. If you don't have flex or bison, get them.
63 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
64 # Also, gcc does not remove the .o before forking 'as', which can be a
65 # problem if you don't own the file but can write to the directory.
68 $(CC
) $(CFLAGS
) -c
$(srcdir)/$*.c
70 PSRC
= pcap-@V_PCAP@.c
71 CSRC
= pcap.c inet.c gencode.c optimize.c nametoaddr.c \
72 etherent.c savefile.c bpf_filter.c bpf_image.c
73 GENSRC
= scanner.c grammar.c version.c
75 SRC
= $(PSRC
) $(CSRC
) $(GENSRC
)
77 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
78 # hack the extra indirection
79 OBJ
= $(PSRC
:.c
=.o
) $(CSRC
:.c
=.o
) $(GENSRC
:.c
=.o
)
80 HDR
= pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
81 ethertype.h gencode.h gnuc.h
89 $(SRC
) $(HDR
) $(TAGHDR
)
91 CLEANFILES
= $(OBJ
) libpcap.a
$(GENSRC
) $(GENHDR
) lex.yy.c
100 scanner.c
: $(srcdir)/scanner.l
102 $(LEX
) -t
$< > $$$$.
$@
; mv
$$$$.
$@
$@
104 scanner.o
: scanner.c tokdefs.h
106 grammar.c
: $(srcdir)/grammar.y
107 @
rm -f grammar.c tokdefs.h
114 $(CC
) $(CFLAGS
) -Dyylval
=pcap_lval
-c grammar.c
117 version.c
: $(srcdir)/VERSION
119 sed
-e
's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION
> $@
122 $(INSTALL
) -m
444 -o bin
-g bin libpcap.a
$(DESTDIR
)$(LIBDEST
)/libpcap.a
123 $(RANLIB
) $(DESTDIR
)$(LIBDEST
)/libpcap.a
126 $(INSTALL
) -m
444 -o bin
-g bin
$(srcdir)/pcap.h \
127 $(DESTDIR
)$(INCLDEST
)/pcap.h
128 $(INSTALL
) -m
444 -o bin
-g bin
$(srcdir)/pcap-namedb.h \
129 $(DESTDIR
)$(INCLDEST
)/pcap-namedb.h
130 $(INSTALL
) -m
444 -o bin
-g bin
$(srcdir)/net
/bpf.h \
131 $(DESTDIR
)$(INCLDEST
)/net
/bpf.h
134 $(INSTALL
) -m
444 -o bin
-g bin
$(srcdir)/pcap
.3 \
135 $(DESTDIR
)$(MANDEST
)/man3
/pcap
.3
141 rm -f
$(CLEANFILES
) Makefile config.cache config.log config.status \
142 gnuc.h os-proto.h bpf_filter.c net
145 ctags
-wtd
$(TAGFILES
)
148 @cwd
=`pwd` ; dir=`basename $$cwd` ; name
=libpcap-
`cat VERSION` ; \
149 list
="" ; tar="tar chFFf" ; \
150 for i in
`cat FILES` ; do list
="$$list $$name/$$i" ; done
; \
152 "rm -f ../$$name; ln -s $$dir ../$$name" ; \
153 rm -f ..
/$$name; ln
-s
$$dir ..
/$$name ; \
155 "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
156 (cd ..
; $$tar - $$list) | compress
> /tmp
/$$name.
tar.Z
; \
158 "rm -f ../$$name" ; \
162 depend
: $(GENSRC
) force
163 .
/mkdep
-c
$(CC
) $(DEFS
) $(INCLS
) $(SRC
)