-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathMakefile
42 lines (31 loc) · 992 Bytes
/
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
HSRCS= data.h decl.h defs.h
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) $(HSRCS)
cc -o comp1 -g -Wall $(SRCS)
compn: $(SRCN) $(HSRCS)
cc -o compn -g -Wall $(SRCN)
comp1arm: $(ARMSRCS) $(HSRCS)
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)
test27: comp1 input27a.c input27b.c
./comp1 input27a.c
cc -o out input27b.c out.s lib/printint.c
./out
test27n: compn input27a.c input27b.c
./compn input27a.c
nasm -f elf64 out.s
cc -o out input27b.c out.o lib/printint.c
./out