home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3952 / Makefile < prev    next >
Encoding:
Makefile  |  1991-09-02  |  2.5 KB  |  80 lines

  1. # @(#) Makefile 1.1 91/09/01 23:08:32
  2.  
  3. ## BEGIN CONFIGURATION STUFF
  4.  
  5. # For maximal flexibility, the "/lib/cpp | unproto" pipeline can be
  6. # packaged as an executable shell script (see the provided file "cpp.sh")
  7. # that should be installed as "/whatever/cpp". This script should then be
  8. # specified to the C compiler as a non-default preprocessor.
  9. #
  10. # PROG    = unproto
  11. # PIPE    = 
  12.  
  13. # For maximal performance, the overhead of shell script inpretation can
  14. # be eliminated by having the unprototyper program itself open the pipe
  15. # to the preprocessor.  In that case, define the CPP_PROG macro as the
  16. # path name of the default C preprocessor (usually "/lib/cpp"), install
  17. # the unprototyper as "/whatever/cpp" and specify it to the C compiler as
  18. # a non-default preprocessor.
  19. PROG    = cpp
  20. PIPE    = -DPIPE_THROUGH_CPP=\"/lib/cpp\"
  21.  
  22. # Some compilers complain about some #directives. An example follows.
  23. # This is only a partial solution, because the directives are still seen
  24. # by /lib/cpp.
  25. #
  26. # SKIP    = -DIGNORE_DIRECTIVES=\"foo\",\"bar\"
  27. #
  28. SKIP    = -DIGNORE_DIRECTIVES=\"pragma\"
  29.  
  30. # If you need support for functions that implement ANSI-style variable
  31. # length argument lists, edit the stdarg.h file provided with this
  32. # package so that it contains the proper definitions for your machine.
  33.  
  34. ## END CONFIGURATION STUFF
  35.  
  36. CFILES    = tok_io.c tok_class.c tok_pool.c unproto.c vstring.c
  37. HFILES    = parse.h token.h vstring.h
  38. SCRIPTS    = cpp.sh
  39. SAMPLES    = stdarg.h varargs.c example.c example.out 
  40. SOURCES    = README Makefile $(CFILES) $(HFILES) $(SCRIPTS) $(SAMPLES)
  41. FILES    = $(SOURCES) unproto.1
  42. OBJECTS    = tok_io.o tok_class.o tok_pool.o unproto.o vstring.o
  43.  
  44. CFLAGS    = -O $(PIPE) $(SKIP)
  45. #CFLAGS    = -O -pg -Dstatic= $(PIPE) $(SKIP)
  46. #CFLAGS    = -g $(PIPE) $(SKIP) -DDEBUG
  47.  
  48. $(PROG): $(OBJECTS)
  49.     cc $(CFLAGS) -o $@ $(OBJECTS) 
  50.  
  51. # For linting, enable all bells and whistles.
  52.  
  53. lint:
  54.     lint -DPIPE_THROUGH_CPP=\"foo\" -DIGNORE_DIRECTIVES=\"foo\",\"bar\" \
  55.     $(CFILES)
  56.  
  57. # Testing requires that the program is compiled with -DDEBUG
  58.  
  59. test:    $(PROG) example.c example.out
  60.     ./cpp example.c >example.tmp
  61.     @echo the following diff command should produce no output
  62.     diff -b example.out example.tmp
  63.     rm -f example.tmp
  64.  
  65. shar:    $(FILES)
  66.     @shar $(FILES)
  67.  
  68. archive:
  69.     $(ARCHIVE) $(SOURCES)
  70.  
  71. clean:
  72.     rm -f *.o core cpp unproto mon.out varargs.o varargs example.tmp
  73.  
  74. tok_class.o : tok_class.c parse.h token.h 
  75. tok_io.o : tok_io.c token.h vstring.h 
  76. tok_pool.o : tok_pool.c token.h vstring.h 
  77. unproto.o : unproto.c vstring.h stdarg.h parse.h token.h 
  78. vstring.o : vstring.c vstring.h 
  79.