-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathMakefile
46 lines (34 loc) · 1.02 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
SRCS= cg.c decl.c expr.c gen.c main.c misc.c scan.c stmt.c \
sym.c tree.c types.c
SRCN= cgn.c decl.c expr.c gen.c main.c misc.c scan.c stmt.c \
sym.c tree.c types.c
ARMSRCS= cg_arm.c decl.c expr.c gen.c main.c misc.c scan.c stmt.c \
sym.c tree.c types.c
comp1: $(SRCS)
cc -o comp1 -g -Wall $(SRCS)
compn: $(SRCN)
cc -o compn -g $(SRCN)
comp1arm: $(ARMSRCS)
cc -o comp1arm -g -Wall $(ARMSRCS)
cp comp1arm comp1
clean:
rm -f comp1 comp1arm compn *.o *.s out
test: comp1 tests/runtests
(cd tests; chmod +x runtests; ./runtests)
armtest: comp1arm tests/runtests
(cd tests; chmod +x runtests; ./runtests)
testn: compn tests/runtestsn
(cd tests; chmod +x runtestsn; ./runtestsn)
test14: comp1 tests/input14 lib/printint.c
./comp1 tests/input14
cc -o out out.s lib/printint.c
./out
armtest14: comp1arm tests/input14 lib/printint.c
./comp1 tests/input14
cc -o out out.s lib/printint.c
./out
test14n: compn tests/input14 lib/printint.c
./compn tests/input14
nasm -f elf64 out.s
cc -no-pie -o out lib/printint.c out.o
./out