home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CPM3 / CPMMAKE.ARK / H.H < prev    next >
C/C++ Source or Header  |  1986-08-31  |  3KB  |  124 lines

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