scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

make.h (1480B)


      1 #include <stddef.h>
      2 #include <time.h>
      3 
      4 typedef struct target Target;
      5 
      6 enum {
      7 	NOEXPORT,
      8 	EXPORT,
      9 };
     10 
     11 enum {
     12 	UNDEF,
     13 	ENVIRON,
     14 	CMDLINE,
     15 	MAKEFILE,
     16 	MAKEFLAGS,
     17 };
     18 
     19 struct loc {
     20 	char *fname;
     21 	int lineno;
     22 };
     23 
     24 struct action {
     25 	char *line;
     26 	struct loc loc;
     27 };
     28 
     29 struct target {
     30 	char *name;
     31 	char *target;
     32 	char *req;
     33 	time_t stamp;
     34 	int defined;
     35 
     36 	int ndeps;
     37 	struct target **deps;
     38 
     39 	int nactions;
     40 	struct action *actions;
     41 
     42 	struct target *next;
     43 };
     44 
     45 extern void *emalloc(size_t);
     46 extern void *erealloc(void *, size_t);
     47 extern char *estrdup(char *);
     48 
     49 extern void dumprules(void);
     50 extern void dumpmacros(void);
     51 
     52 extern char *expandstring(char *, Target *, struct loc *);
     53 extern void addtarget(char *, int);
     54 extern void inject(char *);
     55 extern int build(char *);
     56 extern int hash(char *);
     57 extern int parse(char *);
     58 extern void debug(char *, ...);
     59 extern void error(char *, ...);
     60 extern void warning(char *, ...);
     61 extern void adddep(char *, char *);
     62 extern void addrule(char *, struct action *, int);
     63 extern void freeloc(struct loc *);
     64 
     65 extern char *getmacro(char *);
     66 extern void setmacro(char *, char *, int, int);
     67 
     68 /* system depdendant */
     69 extern time_t stamp(char *);
     70 extern int launch(char *, int);
     71 extern int putenv(char *);
     72 extern void exportvar(char *, char *);
     73 
     74 /* main.c */
     75 extern int kflag, dflag, nflag, iflag, sflag;
     76 extern int eflag, pflag, tflag, qflag;
     77 extern int exitstatus;
     78 
     79 #ifdef SIGABRT
     80 extern volatile sig_atomic_t stop;
     81 #endif
     82 
     83 /* defaults.c */
     84 extern char defaults[];