home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume7 / make / h.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-12-02  |  2.4 KB  |  131 lines

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