1 2 /* 3 * DEFS.H 4 * 5 */ 6 7 #include <sys/types.h> 8 #include <sys/time.h> 9 #include <sys/stat.h> 10 #include <sys/resource.h> 11 #include <sys/wait.h> 12 #include <stdio.h> 13 #include <stdlib.h> 14 #include <stddef.h> 15 #include <stdarg.h> 16 #include <string.h> 17 #include <unistd.h> 18 19 #define Prototype extern 20 21 struct INode; 22 23 typedef struct Node { 24 struct Node *no_Next; 25 struct Node *no_Prev; 26 char *no_Name; /* cannot be NULL if a node */ 27 int no_Value; 28 struct INode *no_INode; /* include node */ 29 int no_ILine; /* line number in include */ 30 int no_Size; /* size of node in bytes */ 31 int no_Type; 32 } Node; 33 34 typedef struct List { 35 Node li_Node; /* li_Node.no_Name == NULL, no_Value == count */ 36 int li_Refs; /* shared references */ 37 } List; 38 39 #define li_Count li_Node.no_ILine 40 41 typedef struct INode { 42 Node in_Node; 43 FILE *in_Fi; 44 List in_EList; /* token expansion list */ 45 int in_LastNl; 46 struct INode *in_Parent; 47 } INode; 48 49 typedef struct VNode { 50 Node vn_Node; 51 List vn_List; 52 } VNode; 53 54 typedef struct Depend { 55 Node de_Node; 56 struct Depend *de_Chain; 57 List *de_XList; /* execution list */ 58 List de_Lhs; /* lhs (one element) */ 59 List *de_Rhs; /* rhs (N elements) */ 60 } Depend; 61 62 typedef struct DNode { 63 Node dn_Node; 64 Depend *dn_Depend; 65 } DNode; 66 67 #define INITLIST(var) { { &var.li_Node, &var.li_Node, NULL, 0 }, 1 } 68 69 #include "xmake-protos.h" 70 71 #define EXITSTATUS 0 72 #define FATALEXIT 1 73 #define MAXLINE 16384 74 #define MAXVARIND 10 75 76 #define TYPE_VARTMP -16 77 #define TYPE_VAR -17 78 #define TYPE_EXEC -18 79 80 #define DEPEND_NOTRUN -2 81 #define DEPEND_UPTODATE -1 82 83 #define EXP_DELAY 0 84 #define EXP_NORMAL 1 85 #define EXP_FORCE 2 86 87 #define INCLS "-I. -I.. -I$HOME/.xmk -I/usr/local/share/xmk -I/usr/share/xmk" 88 89 /* 90 * Set correct CPPCMD here. 91 */ 92 93 /* 94 * Normal CPP 95 */ 96 97 /* #define CPPCMD "cpp -DXMAKE -nostdinc " INCLS */ 98 99 /* 100 * Use GCC for CPP 101 */ 102 103 #define CPPCMD "cc -E -DXMAKE -nostdinc " INCLS " -x c" 104 105