blob: d6551b38b9b76d720a0c7869294ba217638cd2d5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
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)
|