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