-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (40 loc) · 1.36 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
SRC = ./src
OUT = ./out
INFRA_SRC = $(SRC)/infra
INFRA_OUT = $(OUT)/infra
# 32-bit pointers: -m32
CLANG_OPTS = -S -emit-llvm
all: prepare infra
@echo "DONE"
prepare:
mkdir -p $(OUT)
mkdir -p $(INFRA_OUT)
infra: infra_compile infra_link infra_test
infra_compile:
clang $(CLANG_OPTS) $(INFRA_SRC)/arithm.c -o $(INFRA_OUT)/arithm.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/debug.c -o $(INFRA_OUT)/debug.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/jsarray.c -o $(INFRA_OUT)/jsarray.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/jsnumber.c -o $(INFRA_OUT)/jsnumber.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/jsobject.c -o $(INFRA_OUT)/jsobject.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/jsstring.c -o $(INFRA_OUT)/jsstring.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/jsvmap.c -o $(INFRA_OUT)/jsvmap.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/stricteq.c -o $(INFRA_OUT)/stricteq.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/vtable.c -o $(INFRA_OUT)/vtable.ll
clang $(CLANG_OPTS) $(INFRA_SRC)/test.c -o $(INFRA_OUT)/test.ll
infra_link:
llvm-link -S \
$(INFRA_OUT)/arithm.ll \
$(INFRA_OUT)/debug.ll \
$(INFRA_OUT)/jsarray.ll \
$(INFRA_OUT)/jsnumber.ll \
$(INFRA_OUT)/jsobject.ll \
$(INFRA_OUT)/jsstring.ll \
$(INFRA_OUT)/jsvmap.ll \
$(INFRA_OUT)/stricteq.ll \
$(INFRA_OUT)/vtable.ll \
-o $(INFRA_OUT)/infra.ll
infra_test:
llvm-link -S \
$(INFRA_OUT)/infra.ll \
$(INFRA_OUT)/test.ll \
-o $(INFRA_OUT)/test-linked.ll