CFFC ?= cffc SRCS=src/env.cff \ src/fmt.cff \ src/fold.cff \ src/host-target-triple.cff \ src/llvm.cff \ src/main.cff \ src/parse.cff \ src/targ.cff \ src/type.cff \ src/util.cff OBJ=$(foreach o,$(subst .cff,.o,$(SRCS)),build/$o) OUT ?= cffc ifneq ($(VERBOSE),) V= else V=@ endif all: $(OUT) clean: $(RM) -r build/ src/host-target-triple.cff $(OUT): $(OBJ) src/host-target-triple.cff: echo "extern static host_target_triple const *const u8 = \"`clang -print-target-triple`\";" > $@ $(OBJ): $(wildcard src/*.hff) build/%.o: %.cff $Vmkdir -p `dirname $@` @echo -e '\e[1mCFFC\e[0m' '\e[32m'"$<"'\e[0m' '->' '\e[34m'"$@"'\e[0m' $V$(CFFC) $< -o $@.ll $Vset -euo pipefail;\ (opt -Oz -opaque-pointers $@.ll | llc --relocation-model=dynamic-no-pic -opaque-pointers | as - -o $@) || ($(RM) $@; false)