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