mirror of
https://github.com/frida/tinycc
synced 2024-12-19 03:42:33 +03:00
4b3c6e74ab
tccgen.c: doubles need to be aligned, on ARM. The section_reserve() in init_putv does not do that. -D ONE_SOURCE: is now the default and not longer needed. Also, tcc.h now sets the default native target. These both make compiling tcc simple as "gcc tcc.c -o tcc -ldl" again. arm-asm.c: enable pseudo asm also for inline asm tests/tests2/Makefile: disable bitfield tests except on windows and x86_64 and don't generate-always tcc.c: fix a loop with -dt on errors configure: print compiler version (as recognized) tccpp.c: actually define symbols for tcc -dt clear static variables (needed for -dt or libtcc usage) 96_nodata_wanted.c: use __label__ instead of asm lib/files: use native symbols (__i386__ etc.) instead of TCC_TARGET_...
74 lines
1.7 KiB
Makefile
74 lines
1.7 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)
|
|
|
|
# in order to use gcc, tyoe: make <target>lib-usegcc=yes
|
|
armlib-usegcc ?= no
|
|
|
|
ifeq "$($(X)$(T)lib-usegcc)" "yes"
|
|
XCC = $(CC)
|
|
XAR = $(AR)
|
|
XFLAGS = $(CFLAGS) -fPIC
|
|
endif
|
|
|
|
# only for native compiler
|
|
$(X)BCHECK_O = bcheck.o
|
|
|
|
ifeq ($(CONFIG_musl)$(CONFIG_uClibc),yes)
|
|
BCHECK_O =
|
|
endif
|
|
|
|
ifdef CONFIG_OSX
|
|
XFLAGS += -D_ANSI_SOURCE
|
|
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 armflush.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)
|
|
OBJ-x86_64 = $(X86_64_O) va_list.o $(BCHECK_O)
|
|
OBJ-x86_64-osx = $(X86_64_O) va_list.o
|
|
OBJ-i386-win32 = $(I386_O) chkstk.o bcheck.o $(WIN_O)
|
|
OBJ-x86_64-win32 = $(X86_64_O) chkstk.o bcheck.o $(WIN_O)
|
|
OBJ-arm64 = $(ARM64_O)
|
|
OBJ-arm = $(ARM_O)
|
|
OBJ-arm-fpa = $(ARM_O)
|
|
OBJ-arm-fpa-ld = $(ARM_O)
|
|
OBJ-arm-vfp = $(ARM_O)
|
|
OBJ-arm-eabi = $(ARM_O)
|
|
OBJ-arm-eabihf = $(ARM_O)
|
|
OBJ-arm-wince = $(ARM_O) $(WIN_O)
|
|
|
|
$(BIN) : $(patsubst %.o,$(X)%.o,$(OBJ-$T))
|
|
$(XAR) rcs $@ $^
|
|
|
|
$(X)%.o : %.c
|
|
$(XCC) -c $< -o $@ $(XFLAGS)
|
|
|
|
$(X)%.o : %.S
|
|
$(XCC) -c $< -o $@ $(XFLAGS)
|
|
|
|
$(X)crt1w.o : crt1.c
|
|
$(X)wincrt1w.o : wincrt1.c
|
|
|
|
clean :
|
|
rm -f *.a *.o $(BIN)
|