tinycc/Makefile

62 lines
849 B
Makefile
Raw Normal View History

2001-10-28 02:48:39 +03:00
all: test cvt
test: prog.bin
cmp -l prog.bin prog.bin.ref
2001-10-28 18:20:24 +03:00
run: tcc prog.c
./tcc prog.c
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
run2: tcc tcc1.c prog.c
./tcc tcc1.c prog.c
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
run3: tcc tcc1.c prog.c
./tcc tcc1.c tcc1.c prog.c
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
prog.bin: prog.c tcc
./tc prog.c $@
2001-10-28 02:48:39 +03:00
ndisasm -b 32 $@
2001-10-28 18:20:24 +03:00
p2.bin: p2.c tcc
./tcc $< $@
2001-10-28 02:48:39 +03:00
ndisasm -b 32 $@
2001-10-28 18:20:24 +03:00
# Tiny C Compiler
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
tcc: tcc.c
2001-10-28 02:48:39 +03:00
gcc -O2 -Wall -g -o $@ $< -ldl
2001-10-28 18:20:24 +03:00
tcc1: tcc1.c
2001-10-28 02:48:39 +03:00
gcc -O2 -Wall -g -o $@ $<
2001-10-28 18:20:24 +03:00
tcc1.i: tcc.c Makefile
gcc -E -P -o $@ $<
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
tcc1.c: tcc1.i cvt Makefile
./cvt -d $< $@
@ls -l $@
# obfuscated C compiler
otcc: otcc.c
gcc -O2 -Wall -g -o $@ $< -ldl
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
otcc.i: otcc.c Makefile
gcc -E -P -DTINY -o $@ $<
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
otcc1.c: otcc.i cvt Makefile
2001-10-28 02:48:39 +03:00
./cvt $< $@
@ls -l $@
2001-10-28 18:20:24 +03:00
orun: otcc otcc1.c
./otcc otcc1.c ex1.c
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
# misc
cvt: cvt.c
gcc -O2 -Wall -g -o $@ $<
instr.o: instr.S
gcc -O2 -Wall -g -c -o $@ $<
2001-10-28 02:48:39 +03:00
2001-10-28 18:20:24 +03:00
clean:
rm -f *~ *.o tcc tcc1 cvt