2 # Tiny C Compiler Makefile
6 CFLAGS
=-O2
-g
-Wall
-Wno-parentheses
-Wno-missing-braces
-I.
8 CFLAGS_P
=$(CFLAGS
) -pg
-static
-DCONFIG_TCC_STATIC
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 gcc3
$(CFLAGS
) -o
$@
$<
35 # iterated test2 (compile tcc then compile prog.c !)
36 test2
: tcc tcc.c prog.c
test.ref
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
test.ref
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
$@
$<
60 tcc_g
: tcc.c i386-gen.c Makefile
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 float.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 tcc_p
77 gcc
$(CFLAGS_P
) -o
$@
$< $(LIBS_P
)
79 # target for development
89 gcc
-O2
-Wall
-g
-c
-o
$@
$<
95 cp
-r ..
/tcc
/tmp
/$(FILE
)
96 ( cd
/tmp
; tar zcvf ~
/$(FILE
).
tar.gz \
97 $(FILE
)/Makefile
$(FILE
)/README
$(FILE
)/TODO
$(FILE
)/COPYING \
98 $(FILE
)/Changelog
$(FILE
)/tcc-doc.html \
99 $(FILE
)/tcc.c
$(FILE
)/i386-gen.c \
100 $(FILE
)/stddef.h
$(FILE
)/stdarg.h
$(FILE
)/stdbool.h
$(FILE
)/float.h \
102 $(FILE
)/ex
*.c
$(FILE
)/prog.c
)