h.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * Include header for make
  3. *
  4. * $Header$
  5. */
  6. #ifndef uchar
  7. #ifdef os9
  8. #define uchar char
  9. #define void int
  10. #define fputc putc
  11. #else
  12. #define uchar unsigned char
  13. #endif
  14. #endif
  15. #define bool int
  16. #define time_t long
  17. #define TRUE (1)
  18. #define FALSE (0)
  19. #define max(a,b) ((a)>(b)?(a):(b))
  20. #define DEFN1 "makefile" /* Default names */
  21. #ifdef unix
  22. #define DEFN2 "Makefile"
  23. #endif
  24. #ifdef eon
  25. #define DEFN2 "Makefile"
  26. #endif
  27. /* os9 is case insensitive */
  28. #define LZ (2048) /* Line size */
  29. /*
  30. * A name. This represents a file, either to be made, or existant
  31. */
  32. struct name
  33. {
  34. struct name * n_next; /* Next in the list of names */
  35. char * n_name; /* Called */
  36. struct line * n_line; /* Dependencies */
  37. time_t n_time; /* Modify time of this name */
  38. uchar n_flag; /* Info about the name */
  39. };
  40. #define N_MARK 0x01 /* For cycle check */
  41. #define N_DONE 0x02 /* Name looked at */
  42. #define N_TARG 0x04 /* Name is a target */
  43. #define N_PREC 0x08 /* Target is precious */
  44. #define N_DOUBLE 0x10 /* Double colon target */
  45. /*
  46. * Definition of a target line.
  47. */
  48. struct line
  49. {
  50. struct line * l_next; /* Next line (for ::) */
  51. struct depend * l_dep; /* Dependents for this line */
  52. struct cmd * l_cmd; /* Commands for this line */
  53. };
  54. /*
  55. * List of dependents for a line
  56. */
  57. struct depend
  58. {
  59. struct depend * d_next; /* Next dependent */
  60. struct name * d_name; /* Name of dependent */
  61. };
  62. /*
  63. * Commands for a line
  64. */
  65. struct cmd
  66. {
  67. struct cmd * c_next; /* Next command line */
  68. char * c_cmd; /* Command line */
  69. };
  70. /*
  71. * Macro storage
  72. */
  73. struct macro
  74. {
  75. struct macro * m_next; /* Next variable */
  76. char * m_name; /* Called ... */
  77. char * m_val; /* Its value */
  78. uchar m_flag; /* Infinite loop check */
  79. uchar m_prio; /* 5 levels:
  80. - 0 for internal ($(CC), etc)
  81. - 1 (reserved for environment)
  82. - 2 for makefile
  83. - 3 for command line
  84. - 4 for special ($*,$<, etc)
  85. */
  86. };
  87. extern char * myname;
  88. extern struct name namehead;
  89. extern struct macro * macrohead;
  90. extern struct name * firstname;
  91. extern bool silent;
  92. extern bool ignore;
  93. extern bool rules;
  94. extern bool dotouch;
  95. extern bool quest;
  96. extern bool domake;
  97. extern char str1[];
  98. extern char str2[];
  99. extern int lineno;
  100. char * fgets();
  101. char * index();
  102. char * rindex();
  103. char * malloc();
  104. char * strcpy();
  105. char * strcat();
  106. extern int errno;
  107. void circh();
  108. char * getmacro();
  109. struct macro * setmacro();
  110. void input();
  111. void error();
  112. void expand();
  113. void fatal();
  114. int make();
  115. void modtime();
  116. struct name * newname();
  117. struct depend * newdep();
  118. struct cmd * newcmd();
  119. void newline();
  120. void prt();
  121. char * suffix();
  122. void touch();
  123. void makerules();
  124. char * gettok();
  125. void precious();