updated
[tinycc.git] / Makefile
blob34203318ec64d168107b0b8219dd1417878e5a3c
1 all: test cvt
3 test: prog.bin
4 cmp -l prog.bin prog.bin.ref
6 run: tcc prog.c
7 ./tcc prog.c
9 run2: tcc tcc1.c prog.c
10 ./tcc tcc1.c prog.c
12 run3: tcc tcc1.c prog.c
13 ./tcc tcc1.c tcc1.c prog.c
15 prog.bin: prog.c tcc
16 ./tc prog.c $@
17 ndisasm -b 32 $@
19 p2.bin: p2.c tcc
20 ./tcc $< $@
21 ndisasm -b 32 $@
23 # Tiny C Compiler
25 tcc: tcc.c
26 gcc -O2 -Wall -g -o $@ $< -ldl
28 tcc1: tcc1.c
29 gcc -O2 -Wall -g -o $@ $<
31 tcc1.i: tcc.c Makefile
32 gcc -E -P -o $@ $<
34 tcc1.c: tcc1.i cvt Makefile
35 ./cvt -d $< $@
36 @ls -l $@
38 # obfuscated C compiler
39 otcc: otcc.c
40 gcc -O2 -Wall -g -o $@ $< -ldl
42 otcc.i: otcc.c Makefile
43 gcc -E -P -DTINY -o $@ $<
45 otcc1.c: otcc.i cvt Makefile
46 ./cvt $< $@
47 @ls -l $@
49 orun: otcc otcc1.c
50 ./otcc otcc1.c ex1.c
52 # misc
54 cvt: cvt.c
55 gcc -O2 -Wall -g -o $@ $<
57 instr.o: instr.S
58 gcc -O2 -Wall -g -c -o $@ $<
60 clean:
61 rm -f *~ *.o tcc tcc1 cvt