zig-toybox/Makefile

31 lines
727 B
Makefile
Raw Normal View History

2022-05-06 00:50:53 +02:00
all: global-compilation
OPT_CACHE = --global-cache-dir /tmp/.global-cache-dir
OPT_MODE = ReleaseSmall
#OPT_MODE = ReleaseFast
#OPT_MODE = ReleaseSafe
#OPT_MODE = Debug
OPT_STRIP = --strip
opts = -O $(OPT_MODE) $(OPT_CACHE) $(OPT_STRIP)
individual_apps != ls src/*.zig |\
grep -v lib.zig |\
grep -v zig-cache |\
grep -v test.zig |\
sed "s_src/__" |\
sed "s/.zig$$//"
$(individual_apps):
@echo $@
@zig build-exe $(opts) src/$@.zig
individual-compilation:
@echo "individual apps: $(individual_apps)"
@for i in $(individual_apps); do echo "$${i}"; zig build-exe $(opts) src/$${i}.zig; done
global-compilation: src/main.zig
zig build-exe $(opts) src/main.zig
.PHONY: $(global-compilation) $(individual-compilation)