-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (37 loc) · 1.34 KB
/
Makefile
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
43
44
45
46
47
48
49
50
51
52
LIBF_URL := https://rawgit.com/shinh/bflisp/66eefd11889d6ea37225f0060b775b6a44133461/libf.h
$(shell mkdir -p out)
all: out/8cc.unl unlambda/unlambda out/hello.unl
check: unlambda/unlambda out/hello.unl
unlambda/unlambda out/hello.unl
out/%.unl: test/%.bfs
gosh unlcore.scm < $< > $@
unlambda/unlambda: unlambda/unlambda.c out/git_submodule.stamp
$(MAKE) -C unlambda
out/libf.h:
wget $(LIBF_URL) -O [email protected] && mv [email protected] $@
out/8cc.c: merge_8cc.sh out/libf.h 8cc/README.md
./merge_8cc.sh > [email protected] && mv [email protected] $@
out/8cc.bfs: out/8cc.c 8cc/8cc
8cc/8cc -S -o [email protected] $< && mv [email protected] $@
out/8cc.unl out/8cc.2.unl out/8cc.3.unl: out/8cc%.unl: out/8cc%.bfs
BFS24=1 gosh unlcore.scm < $< > [email protected] && mv [email protected] $@
out/8cc.2.bfs: out/8cc.unl out/8cc.c unlambda/unlambda
@echo
@echo "generating $@..."
@echo "Warning: this takes ~1.5 days and consumes more than 10GB RAM!"
@echo
unlambda/unlambda $< < out/8cc.c > [email protected] && mv [email protected] $@
out/8cc.3.bfs: out/8cc.2.unl out/8cc.c unlambda/unlambda
@echo
@echo "generating $@..."
@echo "Warning: this takes ~1.5 days and consumes more than 10GB RAM!"
@echo
unlambda/unlambda $< < out/8cc.c > [email protected] && mv [email protected] $@
clean:
rm -rf out
.PHONY: all check clean
8cc/8cc: $(wildcard 8cc/*.c 8cc/*.h) out/git_submodule.stamp
$(MAKE) -C 8cc
out/git_submodule.stamp: .gitmodules
git submodule update --init
touch $@