home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Unix / libpcap-0_4_tar.tar / libpcap-0_4_tar / libpcap-0.4 / Makefile.in < prev    next >
Makefile  |  1997-07-28  |  5KB  |  164 lines

  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: Makefile.in,v 1.72 97/06/30 13:56:14 leres Exp $ (LBL)
  21.  
  22. #
  23. # Various configurable paths (remember to edit Makefile.in, not Makefile)
  24. #
  25.  
  26. # Top level hierarchy
  27. prefix = @prefix@
  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
  32. LIBDEST =  @libdir@
  33. # Pathname of directory to install the man page
  34. MANDEST = @mandir@
  35.  
  36. # VPATH
  37. srcdir = @srcdir@
  38. VPATH = @srcdir@
  39.  
  40. #
  41. # You shouldn't need to edit anything below.
  42. #
  43.  
  44. CC = @CC@
  45. CCOPT = @V_CCOPT@
  46. INCLS = -I. @V_INCLS@
  47. DEFS = @DEFS@
  48.  
  49. # Standard CFLAGS
  50. CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
  51.  
  52. INSTALL = @INSTALL@
  53. RANLIB = @V_RANLIB@
  54.  
  55. #
  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.
  59. #
  60. LEX = @V_LEX@
  61. YACC = @V_YACC@
  62.  
  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.
  66. .c.o:
  67.     @rm -f $@
  68.     $(CC) $(CFLAGS) -c $(srcdir)/$*.c
  69.  
  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
  74.  
  75. SRC =    $(PSRC) $(CSRC) $(GENSRC)
  76.  
  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
  82. GENHDR = \
  83.     tokdefs.h
  84.  
  85. TAGHDR = \
  86.     bpf/net/bpf.h
  87.  
  88. TAGFILES = \
  89.     $(SRC) $(HDR) $(TAGHDR)
  90.  
  91. CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
  92.  
  93. all: libpcap.a
  94.  
  95. libpcap.a: $(OBJ)
  96.     @rm -f $@
  97.     ar rc $@ $(OBJ)
  98.     $(RANLIB) $@
  99.  
  100. scanner.c: $(srcdir)/scanner.l
  101.     @rm -f $@
  102.     $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
  103.  
  104. scanner.o: scanner.c tokdefs.h
  105. tokdefs.h: grammar.c
  106. grammar.c: $(srcdir)/grammar.y
  107.     @rm -f grammar.c tokdefs.h
  108.     $(YACC) -d $<
  109.     mv y.tab.c grammar.c
  110.     mv y.tab.h tokdefs.h
  111.  
  112. grammar.o: grammar.c
  113.     @rm -f $@
  114.     $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
  115.  
  116. version.o: version.c
  117. version.c: $(srcdir)/VERSION
  118.     @rm -f $@
  119.     sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
  120.  
  121. install: force
  122.     $(INSTALL) -m 444 -o bin -g bin libpcap.a $(DESTDIR)$(LIBDEST)/libpcap.a
  123.     $(RANLIB) $(DESTDIR)$(LIBDEST)/libpcap.a
  124.  
  125. install-incl: force
  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
  132.  
  133. install-man: force
  134.     $(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap.3 \
  135.         $(DESTDIR)$(MANDEST)/man3/pcap.3
  136.  
  137. clean:
  138.     rm -f $(CLEANFILES)
  139.  
  140. distclean:
  141.     rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
  142.         gnuc.h os-proto.h bpf_filter.c net
  143.  
  144. tags: $(TAGFILES)
  145.     ctags -wtd $(TAGFILES)
  146.  
  147. tar:    force
  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; \
  151.         echo \
  152.         "rm -f ../$$name; ln -s $$dir ../$$name" ; \
  153.          rm -f ../$$name; ln -s $$dir ../$$name ; \
  154.         echo \
  155.         "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
  156.          (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
  157.         echo \
  158.         "rm -f ../$$name" ; \
  159.          rm -f ../$$name
  160.  
  161. force:    /tmp
  162. depend:    $(GENSRC) force
  163.     ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
  164.