2 # Tiny C Compiler Makefile
6 CFLAGS
=-O2
-g
-Wall
-Wno-parentheses
-Wno-missing-braces
-I.
8 #CFLAGS=-O2 -g -Wall -Wno-parentheses -I. -pg -static -DPROFILE
11 CFLAGS
+=-m386
-malign-functions
=0
12 DISAS
=objdump
-D
-b binary
-m i386
20 test: test.ref
test.out
21 @if diff
-u
test.ref
test.out
; then echo
"Auto Test OK"; fi
24 gcc
$(CFLAGS
) -o
$@
$<
35 # iterated test2 (compile tcc then compile prog.c !)
36 test2
: tcc tcc.c prog.c
37 .
/tcc
-I. tcc.c
-I. prog.c
> test.out2
38 @if diff
-u
test.ref
test.out2
; then echo
"Auto Test2 OK"; fi
40 # iterated test3 (compile tcc then compile tcc then compile prog.c !)
41 test3
: tcc tcc.c prog.c
42 .
/tcc
-I. tcc.c
-I. tcc.c
-I. prog.c
> test.out3
43 @if diff
-u
test.ref
test.out3
; then echo
"Auto Test3 OK"; fi
47 time .
/ex2
1238 2 3 4 10 13 4
48 time .
/tcc
-I. .
/ex2.c
1238 2 3 4 10 13 4
50 time .
/tcc
-I. .
/ex3.c
35
53 gcc
$(CFLAGS
) -o
$@
$<
56 gcc
$(CFLAGS
) -o
$@
$<
61 gcc
$(CFLAGS
) -o
$@
$< $(LIBS
)
64 strip -s
-R .comment
-R .note
-o
$@
$<
67 $(INSTALL
) -m755 tcc
$(prefix)/bin
68 mkdir
-p
$(prefix)/lib
/tcc
69 $(INSTALL
) -m644 stdarg.h stddef.h tcclib.h
$(prefix)/lib
/tcc
72 rm -f
*~
*.o tcc tcc1 tcct tcc_g prog.ref
*.bin
*.i ex2 \
73 core gmon.out
test.out
test.ref a.out
75 # target for development
82 gcc
-O2
-Wall
-g
-c
-o
$@
$<
88 cp
-r ..
/tcc
/tmp
/$(FILE
)
89 ( cd
/tmp
; tar zcvf ~
/$(FILE
).
tar.gz \
90 $(FILE
)/Makefile
$(FILE
)/README
$(FILE
)/TODO
$(FILE
)/COPYING \
91 $(FILE
)/tcc.c
$(FILE
)/stddef.h
$(FILE
)/stdarg.h
$(FILE
)/tcclib.h \
92 $(FILE
)/ex
*.c
$(FILE
)/prog.c
)