2 # Tiny C Compiler Makefile for libtcc1.a
6 include $(TOP
)/Makefile
7 VPATH
= $(top_srcdir
)/lib
$(top_srcdir
)/win32
/lib
18 ifneq ($(TARGETOS
),Darwin
)
24 ifneq ($(TARGETOS
),Darwin
)
37 cross
: $(DIR
)/libtcc1.a
39 native
: TCC
= $(TOP
)/tcc
$(EXESUF
)
40 cross
: TCC
= $(TOP
)/$(TARGET
)-tcc
$(EXESUF
)
42 I386_O
= libtcc1.o alloca86.o alloca86-bt.o
$(BCHECK_O
)
43 X86_64_O
= libtcc1.o alloca86_64.o
44 WIN32_O
= $(I386_O
) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
45 WIN64_O
= $(X86_64_O
) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
47 ifeq "$(TARGET)" "i386-win32"
48 OBJ
= $(addprefix $(DIR
)/,$(WIN32_O
))
49 TGT
= -DTCC_TARGET_I386
-DTCC_TARGET_PE
50 XCC
= $(TCC
) -B
$(top_srcdir
)/win32
-I
$(top_srcdir
)/include
51 XAR
= $(DIR
)/tiny_libmaker
$(EXESUF
)
53 ifeq "$(TARGET)" "x86_64-win32"
54 OBJ
= $(addprefix $(DIR
)/,$(WIN64_O
))
55 TGT
= -DTCC_TARGET_X86_64
-DTCC_TARGET_PE
56 XCC
= $(TCC
) -B
$(top_srcdir
)/win32
-I
$(top_srcdir
)/include
57 XAR
= $(DIR
)/tiny_libmaker
$(EXESUF
)
59 ifeq "$(TARGET)" "i386"
60 OBJ
= $(addprefix $(DIR
)/,$(I386_O
))
61 TGT
= -DTCC_TARGET_I386
62 XCC ?
= $(TCC
) -B
$(TOP
)
64 ifeq "$(TARGET)" "x86_64"
65 OBJ
= $(addprefix $(DIR
)/,$(X86_64_O
))
66 TGT
= -DTCC_TARGET_X86_64
67 XCC ?
= $(TCC
) -B
$(TOP
)
69 $(error libtcc1.a not supported on target
'$(TARGET)')
75 XFLAGS
= $(CPPFLAGS
) $(CFLAGS
) $(TGT
)
77 ifeq ($(TARGETOS
),Darwin
)
78 XAR
= $(DIR
)/tiny_libmaker
$(EXESUF
)
79 XFLAGS
+= -D_ANSI_SOURCE
87 $(DIR
)/libtcc1.a ..
/libtcc1.a
: $(OBJ
) $(XAR
)
90 $(XCC
) -c
$< -o
$@
$(XFLAGS
)
92 $(XCC
) -c
$< -o
$@
$(XFLAGS
)
93 $(DIR
)/%$(EXESUF
) : $(TOP
)/win32
/tools
/%.c
94 $(CC
) -o
$@
$< $(XFLAGS
) $(LDFLAGS
)
96 $(OBJ
) $(XAR
) : $(DIR
)/exists
102 rm -rfv i386-win32 x86_64-win32 i386 x86_64
104 Makefile
: $(top_srcdir
)/lib
/Makefile