scc

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

make.h (1518B)


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