1#include <stddef.h>2#include <time.h>34typedef struct target Target;56enum {7 NOEXPORT,8 EXPORT,9};1011enum {12 UNDEF,13 ENVIRON,14 CMDLINE,15 INTERNAL,16 MAKEFILE,17 MAKEFLAGS,18};1920struct loc {21 char *fname;22 int lineno;23};2425struct action {26 char *line;27 struct loc loc;28};2930struct target {31 char *name;32 char *target;33 char *req;34 time_t stamp;35 int defined;3637 int ndeps;38 struct target **deps;3940 int nactions;41 struct action *actions;4243 struct target *next;44};4546void *emalloc(size_t);47void *erealloc(void *, size_t);48char *estrdup(char *);4950void dumprules(void);51void dumpmacros(void);5253char *expandstring(char *, Target *, struct loc *);54void addtarget(char *, int);55void inject(char *);56int build(char *);57int hash(char *);58int parse(char *);59void debug(char *, ...);60void error(char *, ...);61void warning(char *, ...);62void adddep(char *, char *);63void addrule(char *, struct action *, int);64void freeloc(struct loc *);6566char *getmacro(char *);67void setmacro(char *, char *, int, int);6869/* system depdendant */70void killchild(void);71time_t stamp(char *);72int launch(char *, int);73int putenv(char *);74void exportvar(char *, char *);75int is_dir(char *);7677/* main.c */78extern int kflag, dflag, nflag, iflag, sflag;79extern int eflag, pflag, tflag, qflag;80extern int exitstatus;8182#ifdef SIGABRT83extern volatile sig_atomic_t stop;84#endif8586/* defaults.c */87extern char defaults[];