home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume12 / cake / part06 / Lib / C < prev    next >
Encoding:
Text File  |  1987-10-15  |  1.8 KB  |  84 lines

  1. $    Cakefile to handle C programs.
  2.  
  3. $    The value of the macro CC names the C compiler. The values
  4. $    of the macros CPPFLAGS, CFLAGS and LDFLAGS are passed on to
  5. $    cpp, cc and ld respectively. By default, the object file
  6. $    depends only on the source file. This can be changed. You
  7. $    should define DEPCCINCL if you want the .o file to depend
  8. $    on the files included in .c; the value of CCINCLFLAGS will
  9. $    be passed along to ccincl. You may define DEPHDR instead,
  10. $    in which case the .o file will depend on either the files
  11. $    named in the macro HDR (without the .h suffix), or on all
  12. $    the .h files in the current directory. In any case, you
  13. $    may define OBJDEP yourself.
  14.  
  15. $    This cakefile was written to work in conjunction with the
  16. $    cakefile Grammar (or Lex and Yacc) and the cakefile Main
  17. $    or System. The order of inclusion of these should be e.g.
  18. $    Grammar, C, and Main.
  19.  
  20. #ifndef    CC
  21. #define    CC        cc
  22. #endif
  23. #ifndef    CPPFLAGS
  24. #define    CPPFLAGS
  25. #endif
  26. #ifndef    CFLAGS
  27. #define    CFLAGS
  28. #endif
  29. #ifndef    LINTFLAGS
  30. #define    LINTFLAGS
  31. #endif
  32. #ifndef    LDFLAGS
  33. #define    LDFLAGS
  34. #endif
  35. #ifndef    OBJDEP
  36. # ifdef    DEPCCINCL
  37. #  ifndef    CCINCLFLAGS
  38. #   define    CCINCLFLAGS
  39. #  endif
  40. #  define    OBJDEP        [[ccincl CCINCLFLAGS %.c]]
  41. #  define    WHENFLAG    *
  42. # else
  43. #  ifdef    DEPHDR
  44. #   ifdef    HDR
  45. #    define    OBJDEP        [[sub X X.h HDR]]
  46. #   else
  47. #    define    OBJDEP        [[ls *.h]]
  48. #   endif
  49. #  else
  50. #   define OBJDEP
  51. #  endif
  52. # endif
  53. #endif
  54. #ifndef    WHENFLAG
  55. #define    WHENFLAG
  56. #endif
  57.  
  58. %.o:    %.c WHENFLAG OBJDEP
  59.     CC CPPFLAGS CFLAGS -c %.c
  60.  
  61. #define    LINK_CMD    CC LDFLAGS -o %
  62. #define    CHECK_CMD    lint CPPFLAGS LINTFLAGS
  63. #define    TAGS_CMD    ctags
  64. #define    DEFS_CMD    defn
  65.  
  66. #define    SRCSUFF    .c
  67. #define    OBJSUFF .o
  68.  
  69. #ifndef    SUFFIXLIST
  70. #ifdef    USE_YACC
  71. #ifdef    USE_LEX
  72. #define    SUFFIXLIST    .c .l .y
  73. #else
  74. #define    SUFFIXLIST    .c .y
  75. #endif
  76. #else
  77. #ifdef    USE_LEX
  78. #define    SUFFIXLIST    .c .l
  79. #else
  80. #define    SUFFIXLIST    .c
  81. #endif
  82. #endif
  83. #endif
  84.