home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / unproto / part01 / Makefile < prev    next >
Encoding:
Makefile  |  1991-12-07  |  2.8 KB  |  86 lines

  1. # @(#) Makefile 1.3 91/12/01 12:37:57
  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 "cpp.sh" script)
  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 PIPE_THROUGH_CPP macro
  16. # as the path name of the default C preprocessor (usually "/lib/cpp"),
  17. # install the unprototyper as "/whatever/cpp" and specify that to the C
  18. # compiler as a non-default preprocessor.
  19. PROG    = cpp
  20. PIPE    = -DPIPE_THROUGH_CPP=\"/lib/cpp\"
  21.  
  22. # Some compilers complain about some #directives. The following is only a 
  23. # partial solution, because the directives are still seen by /lib/cpp.
  24. # Be careful with filtering out #pragma, because some non-ANSI compilers
  25. # (SunOS) rely on its use.
  26. #
  27. # SKIP    = -DIGNORE_DIRECTIVES=\"pragma\",\"foo\",\"bar\"
  28. #
  29. SKIP    =
  30.  
  31. # If you need support for functions that implement ANSI-style variable
  32. # length argument lists, edit the stdarg.h file provided with this
  33. # package so that it contains the proper definitions for your machine.
  34.  
  35. ## END CONFIGURATION STUFF
  36.  
  37. SHELL    = /bin/sh
  38.  
  39. CFILES    = tok_io.c tok_class.c tok_pool.c unproto.c vstring.c symbol.c error.c
  40. HFILES    = error.h token.h vstring.h symbol.h
  41. SCRIPTS    = cpp.sh
  42. SAMPLES    = stdarg.h varargs.c example.c example.out 
  43. SOURCES    = README Makefile $(CFILES) $(HFILES) $(SCRIPTS) $(SAMPLES)
  44. FILES    = $(SOURCES) unproto.1
  45. OBJECTS    = tok_io.o tok_class.o tok_pool.o unproto.o vstring.o symbol.o error.o
  46.  
  47. CFLAGS    = -O $(PIPE) $(SKIP)
  48. #CFLAGS    = -O -pg -Dstatic= $(PIPE) $(SKIP)
  49. #CFLAGS    = -g $(PIPE) $(SKIP) -DDEBUG
  50.  
  51. $(PROG): $(OBJECTS)
  52.     cc $(CFLAGS) -o $@ $(OBJECTS) $(MALLOC)
  53.  
  54. # For linting, enable all bells and whistles.
  55.  
  56. lint:
  57.     lint -DPIPE_THROUGH_CPP=\"foo\" -DIGNORE_DIRECTIVES=\"foo\",\"bar\" \
  58.     $(CFILES)
  59.  
  60. # Testing requires that the program is compiled with -DDEBUG
  61.  
  62. test:    $(PROG) example.c example.out
  63.     ./cpp example.c >example.tmp
  64.     @echo the following diff command should produce no output
  65.     diff -b example.out example.tmp
  66.     rm -f example.tmp
  67.  
  68. shar:    $(FILES)
  69.     @shar $(FILES)
  70.  
  71. archive:
  72.     $(ARCHIVE) $(SOURCES)
  73.  
  74. clean:
  75.     rm -f *.o core cpp unproto mon.out varargs.o varargs example.tmp
  76.  
  77. error.o : error.c token.h error.h Makefile
  78. symbol.o : symbol.c token.h symbol.h Makefile
  79. tok_class.o : tok_class.c error.h vstring.h token.h symbol.h Makefile
  80. tok_io.o : tok_io.c token.h vstring.h error.h Makefile
  81. tok_pool.o : tok_pool.c token.h vstring.h Makefile
  82. unproto.o : unproto.c vstring.h stdarg.h token.h error.h symbol.h Makefile
  83. varargs.o : varargs.c stdarg.h Makefile
  84. vstring.o : vstring.c vstring.h Makefile
  85.