-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 1.64 KB
/
Makefile
File metadata and controls
63 lines (49 loc) · 1.64 KB
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
53
54
55
56
57
58
59
60
61
62
63
PROJ = example
headers = $(PROJ)/header.h $(PROJ)/declare.h $(PROJ)/define.c $(PROJ)/footer.c
additional-deps = Makefile $(shell ls *.py)
CFLAGS = # -O3
TFLAGS =
# clang is faster. TCC is the fastest that I know of
CC = gcc
run: all
./$(PROJ).exe
all: $(PROJ).exe
@echo compiled
test:
$(CC) $@/internal-test.c -O0 -g -o $@.internal.exe
./$@.internal.exe
$(MAKE) all PROJ=test CFLAGS='-O0' CC=tcc TFLAGS='--no-do-caching'
test/checkout.sh
$(MAKE) all PROJ=test CFLAGS='-O0' CC=tcc TFLAGS='--no-do-caching --no-use-typeid'
test/checkout.sh
$(MAKE) all PROJ=test CFLAGS='-O0' CC=tcc TFLAGS='--no-do-caching --no-use-typeid --make-inline'
test/checkout.sh
$(MAKE) all PROJ=test CFLAGS='-O0' CC=tcc TFLAGS='--do-caching --no-use-typeid --make-inline'
test/checkout.sh
$(MAKE) all PROJ=test CFLAGS='-O0' CC=tcc
test/checkout.sh
clean:
- rm -f $(PROJ).c $(PROJ).exe $(PROJ)/script.inline.ini
$(PROJ).exe: $(PROJ).c $(PROJ)/header.c
$(CC) -o $@ $^ $(CFLAGS)
$(PROJ).c: $(PROJ)/script.ini $(headers) $(additional-deps)
./lambdacc.py --source $(PROJ)/script.ini --dest $(PROJ).c \
--no-make-inline \
--do-caching \
--no-print-intermediate \
--count-total-exec \
--no-show-debug \
--use-typeid \
--echo-expr \
--no-track-allocs \
--no-track-pool-allocs \
--flagsfile $(PROJ)/flags.h \
--headerfile $(PROJ)/header.h \
--declare-file $(PROJ)/declare.h \
--define-file $(PROJ)/define.c \
--footerfile $(PROJ)/footer.c \
$(TFLAGS)
@echo translated
$(PROJ)/declare.h $(PROJ)/define.c: $(PROJ)/custom.cfg.py $(additional-deps)
./customwriter.py $(PROJ)/custom.cfg.py $(PROJ)/declare.h $(PROJ)/define.c
.PHONY: test clean all run