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