home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume1 / 8707 / 32 / Makefile < prev    next >
Makefile  |  1990-07-13  |  2KB  |  110 lines

  1. #
  2. # fsfilt - filesystem filtering program for use with find.
  3. # Written by Mark H. Colburn
  4. # Copyright (C) 1987, Mark H. Colburn
  5. #
  6. # Permission is hereby granted to use or modify this program for any 
  7. # non-commercial purpose.
  8. #
  9. # AUTHOR(S)
  10. #    Mark H. Colburn
  11. #
  12. # %W% %G%
  13. #
  14. # HISTORY
  15. #
  16.  
  17. HEADER   = 
  18. SOURCE   = fsfilt.c
  19. OBJECT   = fsfilt.o
  20. CFLAGS   = -O
  21. LDFLAGS  = -s
  22. SCCSDIR  = .
  23. MAKEFILE = Makefile
  24. LINT     = /usr/bin/lint -b -x -h
  25. PR       = /usr/local/bin/cpr
  26. LP       = lp
  27. GFLAGS     = 
  28.  
  29. #
  30. # Program construction rules
  31. #
  32.  
  33. fsfilt: $(OBJECT)
  34.     cc $(LDFLAGS) $(OBJECT) -o fsfilt
  35.  
  36. all: fsfilt
  37.  
  38. #
  39. # Generic Makefile Rules
  40. #
  41.  
  42. install: all
  43.  
  44. build: $(SOURCE) $(HEADER) $(MAKEFILE)
  45.  
  46. edit:
  47.     @for file in $(SOURCE) $(HEADERS) $(MAKEFILE); do \
  48.         if [ ! -w $$file]; then \
  49.             get -e $(SCCSDIR)/s.$$file; \
  50.         fi; \
  51.     done
  52.  
  53. delta:
  54.     @for file in $(SOURCE) $(HEADERS) $(MAKEFILE); do \
  55.         if [ -w $$file]; then \
  56.             delta $(SCCSDIR)/s.$$file; \
  57.         fi; \
  58.     done
  59.     rm -f $(SOURCE)
  60.     rm -f $(HEADER)
  61.     rm -f $(MAKEFILE)
  62.     get $(GFLAGS) $(SCCSDIR)/s.$(MAKEFILE)
  63.  
  64. clean:
  65.     rm -f a.out core
  66.     rm -f cosy
  67.     rm -f $(OBJECT)
  68.  
  69. clobber:
  70.     rm -f $(OBJECT)
  71.     rm -f $(SOURCE)
  72.     rm -f $(HEADER)
  73.     rm -f a.out core
  74.  
  75. lint: $(HEADER) $(SOURCE)
  76.     $(LINT) $(SOURCE)
  77.  
  78. print: $(HEADER) $(SOURCE)
  79.     $(PR) $(HEADER) $(SOURCE) | $(LP) -T"COSY cosy"
  80.  
  81. depend:
  82. # For the moment we are lazy and disregard /usr/include files because
  83. # the sources contain them conditionally. Perhaps we should use cpp.
  84. #        ( /bin/grep '^#[     ]*include' $$i | sed -n \
  85. #            -e 's,<\(.*\)>,"/usr/include/\1",' \
  86. #
  87.     for i in ${SOURCE}; do \
  88.         ( /bin/grep '^#[     ]*include[     ]*"' $$i | sed -n \
  89.             -e 's/[^"]*"\([^"]*\)".*/\1/' \
  90.             -e H -e '$$g' -e '$$s/\n/ /g' \
  91.             -e '$$s/.*/'$$i': &/' -e '$$s/\.c:/.o:/p' \
  92.             >> makedep); done
  93.     @echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
  94.     @echo '$$r makedep' >>eddep
  95.     @echo 'w' >>eddep
  96.     @echo 'q' >>eddep
  97.     @cp $(MAKEFILE) $(MAKEFILE).bak
  98.     ed - $(MAKEFILE) < eddep
  99.     @rm -f eddep makedep
  100.     @echo '# DEPENDENCIES MUST END AT END OF FILE' >> $(MAKEFILE)
  101.     @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> $(MAKEFILE)
  102.     @echo '# see make depend above' >> $(MAKEFILE)
  103.     @rm -f $(MAKEFILE).bak
  104.  
  105. # DO NOT DELETE THIS LINE
  106.  
  107. # DEPENDENCIES MUST END AT END OF FILE
  108. # IF YOU PUT STUFF HERE IT WILL GO AWAY
  109. # see make depend above
  110.