mirror of
https://github.com/frida/tinycc
synced 2025-01-18 09:19:22 +03:00
7acf9aa862
- configure/Makefiles: minor adjustments
- build-tcc.bat: add -static to gcc options
(avoids libgcc_s*.dll dependency with some mingw versions)
- tccpe.c/tcctools.c: eliminate MAX_PATH
(not available for cross compilers)
- tccasm.c: use uint64_t/strtoull in unary()
(unsigned long sometimes is only uint32_t, as always on windows)
- tccgen.c: Revert (f077d16c
) "tccgen: gen_cast: cast FLOAT to DOUBLE"
Was a rather experimental, tentative commit, not really necessary
and somewhat ugly too.
- cleanup recent osx support:
- Makefile/libtcc.c: cleanup copy&paste code
- tccpp.c: restore deleted function
81 lines
1.8 KiB
Makefile
81 lines
1.8 KiB
Makefile
#
|
|
# Tiny C Compiler Makefile for libtcc1.a
|
|
#
|
|
|
|
TOP = ..
|
|
include $(TOP)/Makefile
|
|
VPATH = $(TOPSRC)/lib $(TOPSRC)/win32/lib
|
|
T = $(or $(CROSS_TARGET),$(NATIVE_TARGET),unknown)
|
|
X = $(if $(CROSS_TARGET),$(CROSS_TARGET)-)
|
|
BIN = $(TOP)/libtcc1$(if $(CROSS_TARGET),-$(CROSS_TARGET)).a
|
|
|
|
TCC = $(TOP)/$(X)tcc$(EXESUF)
|
|
XCC = $(TCC)
|
|
XAR = $(TCC) -ar
|
|
XFLAGS-unx = -B$(TOPSRC)
|
|
XFLAGS-win = -B$(TOPSRC)/win32 -I$(TOPSRC)/include
|
|
XFLAGS = $(XFLAGS$(XCFG))
|
|
XCFG = $(or $(findstring -win,$T),-unx)
|
|
|
|
ifeq ($(X),)
|
|
BCHECK_O = bcheck.o
|
|
ifeq "$T" "arm"
|
|
XCC = $(CC)
|
|
XAR = $(AR)
|
|
XFLAGS = $(CFLAGS) -fPIC
|
|
endif
|
|
endif
|
|
|
|
ifdef CONFIG_OSX
|
|
XFLAGS += -D_ANSI_SOURCE
|
|
endif
|
|
|
|
ifeq ($(CONFIG_musl),yes)
|
|
BCHECK_O =
|
|
endif
|
|
|
|
I386_O = libtcc1.o alloca86.o alloca86-bt.o
|
|
X86_64_O = libtcc1.o alloca86_64.o alloca86_64-bt.o
|
|
ARM_O = libtcc1.o armeabi.o alloca-arm.o
|
|
ARM64_O = lib-arm64.o
|
|
WIN_O = crt1.o crt1w.o wincrt1.o wincrt1w.o dllcrt1.o dllmain.o
|
|
|
|
OBJ-i386 = $(I386_O) $(BCHECK_O)
|
|
TGT-i386 = -DTCC_TARGET_I386
|
|
|
|
OBJ-x86_64 = $(X86_64_O) $(BCHECK_O)
|
|
TGT-x86_64 = -DTCC_TARGET_X86_64
|
|
|
|
OBJ-x86_64-osx = $(X86_64_O)
|
|
TGT-x86_64-osx = -DTCC_TARGET_X86_64 -DTCC_TARGET_MACHO
|
|
|
|
OBJ-arm = $(ARM_O)
|
|
TGT-arm = -DTCC_TARGET_ARM
|
|
|
|
OBJ-arm64 = $(ARM64_O)
|
|
TGT-arm64 = -DTCC_TARGET_ARM64
|
|
|
|
OBJ-i386-win32 = $(I386_O) chkstk.o bcheck.o $(WIN_O)
|
|
TGT-i386-win32 = -DTCC_TARGET_I386 -DTCC_TARGET_PE
|
|
|
|
OBJ-x86_64-win32 = $(X86_64_O) chkstk.o bcheck.o $(WIN_O)
|
|
TGT-x86_64-win32 = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE
|
|
|
|
OBJ-arm-wince = $(ARM_O) $(WIN_O)
|
|
TGT-arm-wince = -DTCC_TARGET_ARM -DTCC_TARGET_PE
|
|
|
|
$(BIN) : $(patsubst %.o,$(X)%.o,$(OBJ-$T))
|
|
$(XAR) rcs $@ $^
|
|
|
|
$(X)%.o : %.c
|
|
$(XCC) -c $< -o $@ $(TGT-$T) $(XFLAGS)
|
|
|
|
$(X)%.o : %.S
|
|
$(XCC) -c $< -o $@ $(TGT-$T) $(XFLAGS)
|
|
|
|
$(X)crt1w.o : crt1.c
|
|
$(X)wincrt1w.o : wincrt1.c
|
|
|
|
clean :
|
|
rm -f *.a *.o $(BIN)
|