Makefile (802B)
1 .POSIX: 2 3 all: deps 4 5 deps: 6 $(MAKE) dep;\ 7 touch $@;\ 8 9 all dep tests install uninstall: check_config FORCE 10 +@$(MAKE) -f main.mk $@ 11 12 check_config: FORCE 13 @if ! test -f config.mk;\ 14 then\ 15 $(MAKE) config;\ 16 fi 17 18 config: FORCE 19 @if ! command -v qbe > /dev/null;\ 20 then \ 21 echo "qbe code generator is required to use scc" >&2;\ 22 exit 1;\ 23 fi 24 ./scripts/config 25 $(MAKE) -f main.mk config 26 27 config-musl: FORCE 28 $(MAKE) LIBPROFILE=musl config 29 gcc -v 2>&1 |\ 30 sed -En '/COLLECT_LTO_WRAPPER=/ s/.*=(.*)\/lto-wrapper/\1/p' |\ 31 (read -r path; \ 32 printf "g/define GCCLIBPATH/ s@.*@#define GCCLIBPATH \"$$path/\"@\nw\n") |\ 33 ed -s include/bits/scc/sys.h 34 35 clean: FORCE 36 touch config.mk 37 $(MAKE) -f main.mk clean 38 39 distclean: clean FORCE 40 touch config.mk 41 $(MAKE) -f main.mk distclean 42 rm -f config.mk deps 43 44 FORCE: