aruu

[MIRROR] Actual replacement for Busybox | suckless
git clone https://git.daat.foo/aruu.git
Log | Files | Refs | README | LICENSE

GNUmakefile (2957B)


      1 CC       ?= cc -static
      2 CFLAGS   ?= -std=c99 -Wall -Wextra -pedantic
      3 
      4 BACKEND  ?= auto
      5 
      6 CPPFLAGS ?= -Ishared -D_POSIX_C_SOURCE=200809L \
      7             -DFEATURE_NOFORK=0 -DFEATURE_NOEXEC=0
      8 # NOEXEC cannot be on the bootstrap compile, but it can
      9 # be on when one compiles aruu-box with ninqu included
     10 
     11 NINQU_LIB_SRC =\
     12         shared/libutil/ealloc.c\
     13         shared/libutil/eprintf.c\
     14         shared/libutil/strlcpy.c\
     15         shared/libutil/strlcat.c\
     16         shared/libutil/estrlcpy.c\
     17         shared/libutil/estrlcat.c\
     18         shared/libutil/strtonum.c\
     19         shared/libutil/fshut.c\
     20         shared/libutil/mkdirp.c\
     21         shared/libutil/recurse_dir.c\
     22         shared/libutil/wexec.c
     23 
     24 NINQU_SRC =\
     25         cmd/dev/ninqu/main.c\
     26         cmd/dev/ninqu/strlist.c\
     27         cmd/dev/ninqu/kv.c\
     28         cmd/dev/ninqu/sexpr.c\
     29         cmd/dev/ninqu/gate.c\
     30         cmd/dev/ninqu/registry.c\
     31         cmd/dev/ninqu/fs.c\
     32         cmd/dev/ninqu/exec.c\
     33         cmd/dev/ninqu/backend.c\
     34         cmd/dev/ninqu/parse.c\
     35         cmd/dev/ninqu/expand.c\
     36         cmd/dev/ninqu/schedule.c\
     37         cmd/dev/ninqu/query.c\
     38         cmd/dev/ninqu/resolve.c\
     39         cmd/dev/ninqu/ninja.c
     40 
     41 # map make's -j to ninqu's -j flag
     42 NINQU ?= cmd/dev/ninqu/ninqu
     43 JOBS  ?= $(filter -j%,$(MAKEFLAGS))
     44 
     45 # rebuild the config first so a build.cfg edit lands before ninqu
     46 # compiles. ninqu does this lazily too, this saves a shell startup
     47 $(NINQU): $(NINQU_SRC) cmd/dev/ninqu/ninqu.h scripts/mk/config.set scripts/mk/features.h shared/libutil/nofork_list.h $(NINQU_LIB_SRC)
     48 	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(NINQU_SRC) $(NINQU_LIB_SRC)
     49 
     50 # FORCE has no rule, thus making any pattern
     51 # that depends on it be always outdated
     52 .PHONY: FORCE
     53 FORCE:
     54 
     55 # ninqu generates build.ninja if ninja/samu is available and execs that
     56 # instead of running its own backend, but you can use make backend=internal
     57 # to force the internal one to be used anyways
     58 %: $(NINQU) FORCE
     59 	$(NINQU) $(JOBS) $@
     60 
     61 clean: $(NINQU)
     62 	$(NINQU) clean
     63 	rm -f $(NINQU) build.ninja
     64 
     65 scripts/mk/config.set: build.cfg scripts/genconfig.sh
     66 	sh scripts/genconfig.sh config-set
     67 
     68 scripts/mk/features.h: build.cfg scripts/genconfig.sh
     69 	sh scripts/genconfig.sh features-h
     70 
     71 shared/libutil/nofork_list.h: build.cfg scripts/genconfig.sh
     72 	sh scripts/genconfig.sh nofork-list-h
     73 
     74 # keep the % pattern rule from rebuilding these as stale targets. make
     75 # remakes its own makefiles by running the rule on this file name, and
     76 # on Makefile when one sits next to it
     77 GNUmakefile: ;
     78 Makefile: ;
     79 ninqu.rules: ;
     80 cmd/dev/ninqu/ninqu.h: ;
     81 cmd/dev/ninqu/main.c: ;
     82 cmd/dev/ninqu/strlist.c: ;
     83 cmd/dev/ninqu/kv.c: ;
     84 cmd/dev/ninqu/sexpr.c: ;
     85 cmd/dev/ninqu/gate.c: ;
     86 cmd/dev/ninqu/registry.c: ;
     87 cmd/dev/ninqu/fs.c: ;
     88 cmd/dev/ninqu/exec.c: ;
     89 cmd/dev/ninqu/backend.c: ;
     90 cmd/dev/ninqu/parse.c: ;
     91 cmd/dev/ninqu/expand.c: ;
     92 cmd/dev/ninqu/schedule.c: ;
     93 cmd/dev/ninqu/query.c: ;
     94 cmd/dev/ninqu/resolve.c: ;
     95 cmd/dev/ninqu/ninja.c: ;
     96 build.cfg: ;
     97 scripts/genconfig.sh: ;