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: Makefile.in,v 1.68 96/09/26 21:53:37 leres 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
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
98 scanner.c: $(srcdir)/scanner.l
100 $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
102 scanner.o: scanner.c tokdefs.h
104 grammar.c: $(srcdir)/grammar.y
105 @rm -f grammar.c tokdefs.h
112 $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
115 $(INSTALL) -m 444 -o bin -g bin libpcap.a $(DESTDIR)$(LIBDEST)
116 $(RANLIB) $(DESTDIR)$(LIBDEST)/libpcap.a
119 $(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap.h $(DESTDIR)$(INCLDEST)
120 $(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap-namedb.h $(DESTDIR)$(INCLDEST)
121 $(INSTALL) -m 444 -o bin -g bin $(srcdir)/net/bpf.h $(DESTDIR)$(INCLDEST)/net
124 $(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap.3 $(DESTDIR)$(MANDEST)/man3
130 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
131 gnuc.h os-proto.h bpf_filter.c net
134 ctags -wtd $(TAGFILES)
137 @cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
138 list="" ; tar="tar chFFf" ; \
139 for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
141 "rm -f ../$$name; ln -s $$dir ../$$name" ; \
142 rm -f ../$$name; ln -s $$dir ../$$name ; \
144 "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
145 (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
147 "rm -f ../$$name" ; \
151 depend: $(GENSRC) force
152 ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)