2 # Tiny C Compiler Makefile for libtcc1.a
6 include $(TOP
)/config.mak
31 cross
: $(DIR
)/libtcc1.a
33 native
: TCC
= $(TOP
)/tcc
$(EXESUF
)
34 cross
: TCC
= $(TOP
)/$(TARGET
)-tcc
$(EXESUF
)
36 I386_O
= libtcc1.o alloca86.o alloca86-bt.o
37 X86_64_O
= libtcc1.o alloca86_64.o
38 WIN32_O
= $(I386_O
) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o bcheck.o
39 WIN64_O
= $(X86_64_O
) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
41 VPATH
= $(TOP
)/lib
$(TOP
)/win32
/lib
43 ifeq "$(TARGET)" "i386-win32"
44 OBJ
= $(addprefix $(DIR
)/,$(WIN32_O
))
45 TGT
= -DTCC_TARGET_I386
-DTCC_TARGET_PE
46 XCC
= $(TCC
) -B
$(TOP
)/win32
-I
$(TOP
)/include
47 XAR
= $(DIR
)/tiny_libmaker
$(EXESUF
)
49 ifeq "$(TARGET)" "x86_64-win32"
50 OBJ
= $(addprefix $(DIR
)/,$(WIN64_O
))
51 TGT
= -DTCC_TARGET_X86_64
-DTCC_TARGET_PE
52 XCC
= $(TCC
) -B
$(TOP
)/win32
-I
$(TOP
)/include
53 XAR
= $(DIR
)/tiny_libmaker
$(EXESUF
)
55 ifeq "$(TARGET)" "i386"
56 OBJ
= $(addprefix $(DIR
)/,$(I386_O
))
57 TGT
= -DTCC_TARGET_I386
58 XCC ?
= $(TCC
) -B
$(TOP
)
60 ifeq "$(TARGET)" "x86_64"
61 OBJ
= $(addprefix $(DIR
)/,$(X86_64_O
))
62 TGT
= -DTCC_TARGET_X86_64
63 XCC ?
= $(TCC
) -B
$(TOP
)
65 $(error libtcc1.a not supported on target
'$(TARGET)')
75 $(DIR
)/libtcc1.a ..
/libtcc1.a
: $(OBJ
) $(XAR
)
78 $(XCC
) -c
$< -o
$@
$(TGT
)
80 $(XCC
) -c
$< -o
$@
$(TGT
)
81 $(DIR
)/%$(EXESUF
) : $(TOP
)/win32
/tools
/%.c
82 $(CC
) -Os
-s
-w
-o
$@
$< $(TGT
)
84 $(OBJ
) $(XAR
) : $(DIR
)/exists
90 rm -rfv i386-win32 x86_64-win32 i386 x86_64