2017-02-25 19:49:47 +08:00
|
|
|
# --------------------------------------------------------------------------
|
2015-07-30 04:53:57 +08:00
|
|
|
#
|
|
|
|
# Tiny C Compiler Makefile
|
|
|
|
#
|
2015-07-29 21:05:56 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
ifndef TOP
|
2017-04-26 03:01:54 +08:00
|
|
|
TOP = .
|
|
|
|
INCLUDED = no
|
2017-02-25 19:49:47 +08:00
|
|
|
endif
|
|
|
|
|
2020-04-12 23:34:01 +08:00
|
|
|
ifeq ($(findstring $(MAKECMDGOALS),clean distclean),)
|
|
|
|
include $(TOP)/config.mak
|
|
|
|
endif
|
2016-10-18 02:26:38 +08:00
|
|
|
|
2020-04-12 23:34:01 +08:00
|
|
|
ifeq (-$(GCC_MAJOR)-$(findstring $(GCC_MINOR),56789)-,-4--)
|
2017-05-13 14:59:06 +08:00
|
|
|
CFLAGS += -D_FORTIFY_SOURCE=0
|
2015-07-30 04:53:57 +08:00
|
|
|
endif
|
|
|
|
|
2016-10-02 03:06:33 +08:00
|
|
|
LIBTCC = libtcc.a
|
|
|
|
LIBTCC1 = libtcc1.a
|
|
|
|
LINK_LIBTCC =
|
|
|
|
LIBS =
|
2017-02-25 19:49:47 +08:00
|
|
|
CFLAGS += -I$(TOP)
|
|
|
|
CFLAGS += $(CPPFLAGS)
|
|
|
|
VPATH = $(TOPSRC)
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2016-10-02 03:06:33 +08:00
|
|
|
ifdef CONFIG_WIN32
|
2020-06-27 23:22:04 +08:00
|
|
|
CFG = -win
|
2017-05-13 14:59:06 +08:00
|
|
|
ifneq ($(CONFIG_static),yes)
|
2017-04-26 03:01:54 +08:00
|
|
|
LIBTCC = libtcc$(DLLSUF)
|
2017-02-18 16:55:34 +08:00
|
|
|
LIBTCCDEF = libtcc.def
|
2017-02-14 02:03:29 +08:00
|
|
|
endif
|
2017-04-26 03:01:54 +08:00
|
|
|
NATIVE_TARGET = $(ARCH)-win$(if $(findstring arm,$(ARCH)),ce,32)
|
2015-07-30 04:53:57 +08:00
|
|
|
else
|
2020-06-27 23:22:04 +08:00
|
|
|
CFG = -unx
|
2019-12-11 07:37:18 +08:00
|
|
|
LIBS=-lm -lpthread
|
2017-05-13 14:59:06 +08:00
|
|
|
ifneq ($(CONFIG_ldl),no)
|
2016-10-02 03:06:33 +08:00
|
|
|
LIBS+=-ldl
|
|
|
|
endif
|
|
|
|
# make libtcc as static or dynamic library?
|
2017-05-13 14:59:06 +08:00
|
|
|
ifeq ($(CONFIG_static),no)
|
2017-04-26 03:01:54 +08:00
|
|
|
LIBTCC=libtcc$(DLLSUF)
|
|
|
|
export LD_LIBRARY_PATH := $(CURDIR)/$(TOP)
|
2017-05-13 14:59:06 +08:00
|
|
|
ifneq ($(CONFIG_rpath),no)
|
2020-07-09 18:04:57 +08:00
|
|
|
ifndef CONFIG_OSX
|
|
|
|
LINK_LIBTCC += -Wl,-rpath,"$(libdir)"
|
|
|
|
else
|
2020-07-10 05:00:36 +08:00
|
|
|
# macOS doesn't support env-vars libdir out of the box - which we need for
|
|
|
|
# `make test' when libtcc.dylib is used (configure --disable-static), so
|
|
|
|
# we bake a relative path into the binary. $libdir is used after install.
|
|
|
|
LINK_LIBTCC += -Wl,-rpath,"@executable_path/$(TOP)" -Wl,-rpath,"$(libdir)"
|
2020-07-09 20:25:19 +08:00
|
|
|
DYLIBVER += -current_version $(VERSION)
|
|
|
|
DYLIBVER += -compatibility_version $(VERSION)
|
2020-07-09 18:04:57 +08:00
|
|
|
endif
|
2016-10-02 03:06:33 +08:00
|
|
|
endif
|
|
|
|
endif
|
2017-02-25 19:49:47 +08:00
|
|
|
NATIVE_TARGET = $(ARCH)
|
2017-04-26 03:01:54 +08:00
|
|
|
ifdef CONFIG_OSX
|
|
|
|
NATIVE_TARGET = $(ARCH)-osx
|
2020-06-27 23:22:04 +08:00
|
|
|
ifneq ($(CC_NAME),tcc)
|
2020-06-23 12:51:51 +08:00
|
|
|
LDFLAGS += -flat_namespace -undefined warning
|
|
|
|
endif
|
2020-05-09 06:36:59 +08:00
|
|
|
export MACOSX_DEPLOYMENT_TARGET := 10.6
|
2017-04-26 03:01:54 +08:00
|
|
|
endif
|
2015-07-30 04:53:57 +08:00
|
|
|
endif
|
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# run local version of tcc with local libraries and includes
|
|
|
|
TCCFLAGS-unx = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP)
|
|
|
|
TCCFLAGS-win = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) -L$(TOP)
|
2020-06-27 23:22:04 +08:00
|
|
|
TCCFLAGS = $(TCCFLAGS$(CFG))
|
2017-02-25 19:49:47 +08:00
|
|
|
TCC = $(TOP)/tcc$(EXESUF) $(TCCFLAGS)
|
|
|
|
|
2020-04-12 23:34:01 +08:00
|
|
|
# cross compiler targets to build
|
|
|
|
TCC_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm-wince c67
|
|
|
|
TCC_X += riscv64
|
|
|
|
# TCC_X += arm-fpa arm-fpa-ld arm-vfp arm-eabi
|
|
|
|
|
2016-10-06 00:34:17 +08:00
|
|
|
CFLAGS_P = $(CFLAGS) -pg -static -DCONFIG_TCC_STATIC -DTCC_PROFILE
|
2017-04-26 03:01:54 +08:00
|
|
|
LIBS_P = $(LIBS)
|
2016-10-06 00:34:17 +08:00
|
|
|
LDFLAGS_P = $(LDFLAGS)
|
|
|
|
|
2015-07-30 04:53:57 +08:00
|
|
|
CONFIG_$(ARCH) = yes
|
|
|
|
NATIVE_DEFINES_$(CONFIG_i386) += -DTCC_TARGET_I386
|
2017-02-21 01:58:08 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_x86_64) += -DTCC_TARGET_X86_64
|
2015-07-30 04:53:57 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_WIN32) += -DTCC_TARGET_PE
|
2017-04-26 03:01:54 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_OSX) += -DTCC_TARGET_MACHO
|
2015-07-30 04:53:57 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_uClibc) += -DTCC_UCLIBC
|
2017-04-21 04:01:50 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_musl) += -DTCC_MUSL
|
2017-05-13 14:59:06 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_libgcc) += -DCONFIG_USE_LIBGCC
|
|
|
|
NATIVE_DEFINES_$(CONFIG_selinux) += -DHAVE_SELINUX
|
2015-07-30 04:53:57 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_arm) += -DTCC_TARGET_ARM
|
|
|
|
NATIVE_DEFINES_$(CONFIG_arm_eabihf) += -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
|
|
|
|
NATIVE_DEFINES_$(CONFIG_arm_eabi) += -DTCC_ARM_EABI
|
|
|
|
NATIVE_DEFINES_$(CONFIG_arm_vfp) += -DTCC_ARM_VFP
|
|
|
|
NATIVE_DEFINES_$(CONFIG_arm64) += -DTCC_TARGET_ARM64
|
2019-06-22 12:13:10 +08:00
|
|
|
NATIVE_DEFINES_$(CONFIG_riscv64) += -DTCC_TARGET_RISCV64
|
2015-07-30 04:53:57 +08:00
|
|
|
NATIVE_DEFINES += $(NATIVE_DEFINES_yes)
|
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
ifeq ($(INCLUDED),no)
|
2017-02-23 15:41:57 +08:00
|
|
|
# --------------------------------------------------------------------------
|
|
|
|
# running top Makefile
|
|
|
|
|
|
|
|
PROGS = tcc$(EXESUF)
|
2020-04-12 23:34:01 +08:00
|
|
|
TCCLIBS = $(LIBTCCDEF) $(LIBTCC) $(LIBTCC1)
|
2015-07-30 04:53:57 +08:00
|
|
|
TCCDOCS = tcc.1 tcc-doc.html tcc-doc.info
|
|
|
|
|
|
|
|
all: $(PROGS) $(TCCLIBS) $(TCCDOCS)
|
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# cross libtcc1.a targets to build
|
2017-03-28 13:58:42 +08:00
|
|
|
LIBTCC1_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm-wince
|
2019-07-16 23:30:04 +08:00
|
|
|
LIBTCC1_X += riscv64
|
2017-02-18 16:55:34 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
PROGS_CROSS = $(foreach X,$(TCC_X),$X-tcc$(EXESUF))
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
LIBTCC1_CROSS = $(foreach X,$(LIBTCC1_X),$X-libtcc1.a)
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# build cross compilers & libs
|
bcheck cleanup
- revert Makefiles to state before last bcheck additions
Instead, just load bcheck.o explicitly if that is
what is wanted.
- move tcc_add_bcheck() to the <target>-link.c files and
remove revently added arguments. This function is to
support tccelf.c with linking, not for tccgen.c to
support compilation.
- remove -ba option: It said:
"-ba Enable better address checking with bounds checker"
Okay, if it is better then to have it is not an option.
- remove va_copy. It is C99 and we try to stay C89 in tinycc
when possible. For example, MS compilers do not have va_copy.
- win64: revert any 'fixes' to alloca
It was correct as it was before, except for bound_checking
where it was not implemented. This should now work too.
- remove parasitic filename:linenum features
Such feature is already present with rt_printline in
tccrun.c. If it doesn't work it can be fixed.
- revert changes to gen_bounded_ptr_add()
gen_bounded_ptr_add() was working as it should before
(mostly). For the sake of simplicity I switched it to
CDECL. Anyway, FASTCALL means SLOWCALL with tinycc.
In exchange you get one addition which is required for
bounds_cnecking function arguments. The important thing
is to check them *BEFORE* they are loaded into registers.
New function gbound_args() does that.
In any case, code instrumentation with the bounds-check
functions as such now seems to work flawlessly again,
which means when they are inserted as NOPs, any code that
tcc can compile, seems to behave just the same as without
them.
What these functions then do when fully enabled, is a
differnt story. I did not touch this.
2019-12-12 22:45:45 +08:00
|
|
|
cross: $(LIBTCC1_CROSS) $(PROGS_CROSS)
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# build specific cross compiler & lib
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
cross-%: %-tcc$(EXESUF) %-libtcc1.a ;
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2020-06-27 23:22:04 +08:00
|
|
|
install: ; @$(MAKE) --no-print-directory install$(CFG)
|
|
|
|
install-strip: ; @$(MAKE) --no-print-directory install$(CFG) CONFIG_strip=yes
|
|
|
|
uninstall: ; @$(MAKE) --no-print-directory uninstall$(CFG)
|
2017-02-18 16:55:34 +08:00
|
|
|
|
2017-05-13 14:59:06 +08:00
|
|
|
ifdef CONFIG_cross
|
2017-04-26 03:01:54 +08:00
|
|
|
all : cross
|
|
|
|
endif
|
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# --------------------------------------------
|
2016-10-02 03:06:33 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
T = $(or $(CROSS_TARGET),$(NATIVE_TARGET),unknown)
|
|
|
|
X = $(if $(CROSS_TARGET),$(CROSS_TARGET)-)
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
DEF-i386 = -DTCC_TARGET_I386
|
|
|
|
DEF-x86_64 = -DTCC_TARGET_X86_64
|
|
|
|
DEF-i386-win32 = -DTCC_TARGET_PE -DTCC_TARGET_I386
|
|
|
|
DEF-x86_64-win32= -DTCC_TARGET_PE -DTCC_TARGET_X86_64
|
2017-03-28 13:58:42 +08:00
|
|
|
DEF-x86_64-osx = -DTCC_TARGET_MACHO -DTCC_TARGET_X86_64
|
2017-02-25 19:49:47 +08:00
|
|
|
DEF-arm-wince = -DTCC_TARGET_PE -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_VFP -DTCC_ARM_HARDFLOAT
|
jump optimizations
This unifies VT_CMP with VT_JMP(i) by using mostly VT_CMP
with both a positive and a negative jump target list.
Such we can delay putting the non-inverted or inverted jump
until we can see which one is nore suitable (in most cases).
example:
if (a && b || c && d)
e = 0;
before this patch:
a: 8b 45 fc mov 0xfffffffc(%ebp),%eax
d: 83 f8 00 cmp $0x0,%eax
10: 0f 84 11 00 00 00 je 27 <main+0x27>
16: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
19: 83 f8 00 cmp $0x0,%eax
1c: 0f 84 05 00 00 00 je 27 <main+0x27>
22: e9 22 00 00 00 jmp 49 <main+0x49>
27: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
2a: 83 f8 00 cmp $0x0,%eax
2d: 0f 84 11 00 00 00 je 44 <main+0x44>
33: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
36: 83 f8 00 cmp $0x0,%eax
39: 0f 84 05 00 00 00 je 44 <main+0x44>
3f: e9 05 00 00 00 jmp 49 <main+0x49>
44: e9 08 00 00 00 jmp 51 <main+0x51>
49: b8 00 00 00 00 mov $0x0,%eax
4e: 89 45 ec mov %eax,0xffffffec(%ebp)
51: ...
with this patch:
a: 8b 45 fc mov 0xfffffffc(%ebp),%eax
d: 83 f8 00 cmp $0x0,%eax
10: 0f 84 0c 00 00 00 je 22 <main+0x22>
16: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
19: 83 f8 00 cmp $0x0,%eax
1c: 0f 85 18 00 00 00 jne 3a <main+0x3a>
22: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
25: 83 f8 00 cmp $0x0,%eax
28: 0f 84 14 00 00 00 je 42 <main+0x42>
2e: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
31: 83 f8 00 cmp $0x0,%eax
34: 0f 84 08 00 00 00 je 42 <main+0x42>
3a: b8 00 00 00 00 mov $0x0,%eax
3f: 89 45 ec mov %eax,0xffffffec(%ebp)
42: ...
2019-06-22 17:45:35 +08:00
|
|
|
DEF-arm64 = -DTCC_TARGET_ARM64 -Wno-format
|
2017-02-25 19:49:47 +08:00
|
|
|
DEF-c67 = -DTCC_TARGET_C67 -w # disable warnigs
|
|
|
|
DEF-arm-fpa = -DTCC_TARGET_ARM
|
|
|
|
DEF-arm-fpa-ld = -DTCC_TARGET_ARM -DLDOUBLE_SIZE=12
|
|
|
|
DEF-arm-vfp = -DTCC_TARGET_ARM -DTCC_ARM_VFP
|
|
|
|
DEF-arm-eabi = -DTCC_TARGET_ARM -DTCC_ARM_VFP -DTCC_ARM_EABI
|
|
|
|
DEF-arm-eabihf = -DTCC_TARGET_ARM -DTCC_ARM_VFP -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
|
|
|
|
DEF-arm = $(DEF-arm-eabihf)
|
2019-06-22 12:13:10 +08:00
|
|
|
DEF-riscv64 = -DTCC_TARGET_RISCV64
|
2017-02-25 19:49:47 +08:00
|
|
|
DEF-$(NATIVE_TARGET) = $(NATIVE_DEFINES)
|
2017-02-23 15:41:57 +08:00
|
|
|
|
|
|
|
DEFINES += $(DEF-$T) $(DEF-all)
|
|
|
|
DEFINES += $(if $(ROOT-$T),-DCONFIG_SYSROOT="\"$(ROOT-$T)\"")
|
|
|
|
DEFINES += $(if $(CRT-$T),-DCONFIG_TCC_CRTPREFIX="\"$(CRT-$T)\"")
|
|
|
|
DEFINES += $(if $(LIB-$T),-DCONFIG_TCC_LIBPATHS="\"$(LIB-$T)\"")
|
|
|
|
DEFINES += $(if $(INC-$T),-DCONFIG_TCC_SYSINCLUDEPATHS="\"$(INC-$T)\"")
|
|
|
|
DEFINES += $(DEF-$(or $(findstring win,$T),unx))
|
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
ifneq ($(X),)
|
2017-02-23 15:41:57 +08:00
|
|
|
ifeq ($(CONFIG_WIN32),yes)
|
bcheck cleanup
- revert Makefiles to state before last bcheck additions
Instead, just load bcheck.o explicitly if that is
what is wanted.
- move tcc_add_bcheck() to the <target>-link.c files and
remove revently added arguments. This function is to
support tccelf.c with linking, not for tccgen.c to
support compilation.
- remove -ba option: It said:
"-ba Enable better address checking with bounds checker"
Okay, if it is better then to have it is not an option.
- remove va_copy. It is C99 and we try to stay C89 in tinycc
when possible. For example, MS compilers do not have va_copy.
- win64: revert any 'fixes' to alloca
It was correct as it was before, except for bound_checking
where it was not implemented. This should now work too.
- remove parasitic filename:linenum features
Such feature is already present with rt_printline in
tccrun.c. If it doesn't work it can be fixed.
- revert changes to gen_bounded_ptr_add()
gen_bounded_ptr_add() was working as it should before
(mostly). For the sake of simplicity I switched it to
CDECL. Anyway, FASTCALL means SLOWCALL with tinycc.
In exchange you get one addition which is required for
bounds_cnecking function arguments. The important thing
is to check them *BEFORE* they are loaded into registers.
New function gbound_args() does that.
In any case, code instrumentation with the bounds-check
functions as such now seems to work flawlessly again,
which means when they are inserted as NOPs, any code that
tcc can compile, seems to behave just the same as without
them.
What these functions then do when fully enabled, is a
differnt story. I did not touch this.
2019-12-12 22:45:45 +08:00
|
|
|
DEF-win += -DTCC_LIBTCC1="\"$(X)libtcc1.a\""
|
|
|
|
DEF-unx += -DTCC_LIBTCC1="\"lib/$(X)libtcc1.a\""
|
2017-02-23 15:41:57 +08:00
|
|
|
else
|
bcheck cleanup
- revert Makefiles to state before last bcheck additions
Instead, just load bcheck.o explicitly if that is
what is wanted.
- move tcc_add_bcheck() to the <target>-link.c files and
remove revently added arguments. This function is to
support tccelf.c with linking, not for tccgen.c to
support compilation.
- remove -ba option: It said:
"-ba Enable better address checking with bounds checker"
Okay, if it is better then to have it is not an option.
- remove va_copy. It is C99 and we try to stay C89 in tinycc
when possible. For example, MS compilers do not have va_copy.
- win64: revert any 'fixes' to alloca
It was correct as it was before, except for bound_checking
where it was not implemented. This should now work too.
- remove parasitic filename:linenum features
Such feature is already present with rt_printline in
tccrun.c. If it doesn't work it can be fixed.
- revert changes to gen_bounded_ptr_add()
gen_bounded_ptr_add() was working as it should before
(mostly). For the sake of simplicity I switched it to
CDECL. Anyway, FASTCALL means SLOWCALL with tinycc.
In exchange you get one addition which is required for
bounds_cnecking function arguments. The important thing
is to check them *BEFORE* they are loaded into registers.
New function gbound_args() does that.
In any case, code instrumentation with the bounds-check
functions as such now seems to work flawlessly again,
which means when they are inserted as NOPs, any code that
tcc can compile, seems to behave just the same as without
them.
What these functions then do when fully enabled, is a
differnt story. I did not touch this.
2019-12-12 22:45:45 +08:00
|
|
|
DEF-all += -DTCC_LIBTCC1="\"$(X)libtcc1.a\""
|
2017-02-23 15:41:57 +08:00
|
|
|
DEF-win += -DCONFIG_TCCDIR="\"$(tccdir)/win32\""
|
2016-10-02 03:06:33 +08:00
|
|
|
endif
|
2017-02-25 19:49:47 +08:00
|
|
|
endif
|
2016-10-02 03:06:33 +08:00
|
|
|
|
2017-07-09 18:07:40 +08:00
|
|
|
# include custom configuration (see make help)
|
|
|
|
-include config-extra.mak
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
CORE_FILES = tcc.c tcctools.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c
|
|
|
|
CORE_FILES += tcc.h config.h libtcc.h tcctok.h
|
|
|
|
i386_FILES = $(CORE_FILES) i386-gen.c i386-link.c i386-asm.c i386-asm.h i386-tok.h
|
|
|
|
i386-win32_FILES = $(i386_FILES) tccpe.c
|
|
|
|
x86_64_FILES = $(CORE_FILES) x86_64-gen.c x86_64-link.c i386-asm.c x86_64-asm.h
|
|
|
|
x86_64-win32_FILES = $(x86_64_FILES) tccpe.c
|
2020-05-15 09:46:55 +08:00
|
|
|
x86_64-osx_FILES = $(x86_64_FILES) tccmacho.c
|
2017-02-25 19:49:47 +08:00
|
|
|
arm_FILES = $(CORE_FILES) arm-gen.c arm-link.c arm-asm.c
|
|
|
|
arm-wince_FILES = $(arm_FILES) tccpe.c
|
2019-01-09 02:06:26 +08:00
|
|
|
arm-eabihf_FILES = $(arm_FILES)
|
|
|
|
arm-fpa_FILES = $(arm_FILES)
|
|
|
|
arm-fpa-ld_FILES = $(arm_FILES)
|
|
|
|
arm-vfp_FILES = $(arm_FILES)
|
|
|
|
arm-eabi_FILES = $(arm_FILES)
|
|
|
|
arm-eabihf_FILES = $(arm_FILES)
|
2020-06-16 13:39:48 +08:00
|
|
|
arm64_FILES = $(CORE_FILES) arm64-gen.c arm64-link.c arm-asm.c
|
2017-02-25 19:49:47 +08:00
|
|
|
c67_FILES = $(CORE_FILES) c67-gen.c c67-link.c tcccoff.c
|
2020-06-16 13:39:48 +08:00
|
|
|
riscv64_FILES = $(CORE_FILES) riscv64-gen.c riscv64-link.c riscv64-asm.c
|
2017-02-23 15:41:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# libtcc sources
|
2017-05-13 14:59:06 +08:00
|
|
|
LIBTCC_SRC = $(filter-out tcc.c tcctools.c,$(filter %.c,$($T_FILES)))
|
2017-02-23 15:41:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
ifeq ($(ONE_SOURCE),yes)
|
|
|
|
LIBTCC_OBJ = $(X)libtcc.o
|
|
|
|
LIBTCC_INC = $($T_FILES)
|
2017-05-02 07:39:01 +08:00
|
|
|
TCC_FILES = $(X)tcc.o
|
2017-07-24 03:24:11 +08:00
|
|
|
tcc.o : DEFINES += -DONE_SOURCE=0
|
2017-02-25 19:49:47 +08:00
|
|
|
else
|
|
|
|
LIBTCC_OBJ = $(patsubst %.c,$(X)%.o,$(LIBTCC_SRC))
|
|
|
|
LIBTCC_INC = $(filter %.h %-gen.c %-link.c,$($T_FILES))
|
|
|
|
TCC_FILES = $(X)tcc.o $(LIBTCC_OBJ)
|
2017-07-24 03:24:11 +08:00
|
|
|
$(TCC_FILES) : DEFINES += -DONE_SOURCE=0
|
2017-02-25 19:49:47 +08:00
|
|
|
endif
|
2017-02-23 15:41:57 +08:00
|
|
|
|
2020-04-12 23:34:01 +08:00
|
|
|
ifeq ($(CONFIG_strip),no)
|
|
|
|
CFLAGS += -g
|
|
|
|
LDFLAGS += -g
|
|
|
|
else
|
|
|
|
CONFIG_strip = yes
|
2020-06-24 13:06:48 +08:00
|
|
|
ifndef CONFIG_OSX
|
2020-04-12 23:34:01 +08:00
|
|
|
LDFLAGS += -s
|
|
|
|
endif
|
2020-06-24 13:06:48 +08:00
|
|
|
endif
|
2020-04-12 23:34:01 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# target specific object rule
|
|
|
|
$(X)%.o : %.c $(LIBTCC_INC)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(CC) -o $@ -c $< $(DEFINES) $(CFLAGS)
|
2017-02-23 15:41:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# additional dependencies
|
|
|
|
$(X)tcc.o : tcctools.c
|
|
|
|
|
|
|
|
# Host Tiny C Compiler
|
2017-04-26 03:01:54 +08:00
|
|
|
tcc$(EXESUF): tcc.o $(LIBTCC)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(CC) -o $@ $^ $(LIBS) $(LDFLAGS) $(LINK_LIBTCC)
|
2017-02-23 15:41:57 +08:00
|
|
|
|
|
|
|
# Cross Tiny C Compilers
|
2017-02-25 19:49:47 +08:00
|
|
|
%-tcc$(EXESUF): FORCE
|
|
|
|
@$(MAKE) --no-print-directory $@ CROSS_TARGET=$* ONE_SOURCE=$(or $(ONE_SOURCE),yes)
|
|
|
|
|
|
|
|
$(CROSS_TARGET)-tcc$(EXESUF): $(TCC_FILES)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(CC) -o $@ $^ $(LIBS) $(LDFLAGS)
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
# profiling version
|
|
|
|
tcc_p$(EXESUF): $($T_FILES)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(CC) -o $@ $< $(DEFINES) $(CFLAGS_P) $(LIBS_P) $(LDFLAGS_P)
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
# static libtcc library
|
|
|
|
libtcc.a: $(LIBTCC_OBJ)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(AR) rcs $@ $^
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
# dynamic libtcc library
|
|
|
|
libtcc.so: $(LIBTCC_OBJ)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
libtcc.so: CFLAGS+=-fPIC
|
2017-05-07 18:41:29 +08:00
|
|
|
libtcc.so: LDFLAGS+=-fPIC
|
2017-02-25 19:49:47 +08:00
|
|
|
|
2020-06-02 00:10:58 +08:00
|
|
|
# OSX dynamic libtcc library
|
2020-03-22 20:36:14 +08:00
|
|
|
libtcc.dylib: $(LIBTCC_OBJ)
|
2020-07-09 20:25:19 +08:00
|
|
|
$S$(CC) -dynamiclib $(DYLIBVER) -install_name @rpath/$@ -o $@ $^ $(LDFLAGS)
|
2020-03-21 23:57:00 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# windows dynamic libtcc library
|
|
|
|
libtcc.dll : $(LIBTCC_OBJ)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(CC) -shared -o $@ $^ $(LDFLAGS)
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
libtcc.dll : DEFINES += -DLIBTCC_AS_DLL
|
2017-02-25 19:49:47 +08:00
|
|
|
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
# import file for windows libtcc.dll
|
2017-02-25 19:49:47 +08:00
|
|
|
libtcc.def : libtcc.dll tcc$(EXESUF)
|
2020-04-12 23:34:01 +08:00
|
|
|
$S$(XTCC) -impdef $< -o $@
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
XTCC ?= ./tcc$(EXESUF)
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
# TinyCC runtime libraries
|
|
|
|
libtcc1.a : tcc$(EXESUF) FORCE
|
2020-01-21 21:23:57 +08:00
|
|
|
@$(MAKE) -C lib
|
2017-02-23 15:41:57 +08:00
|
|
|
|
|
|
|
# Cross libtcc1.a
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
%-libtcc1.a : %-tcc$(EXESUF) FORCE
|
2020-01-21 21:23:57 +08:00
|
|
|
@$(MAKE) -C lib CROSS_TARGET=$*
|
2017-02-25 19:49:47 +08:00
|
|
|
|
2020-01-21 21:23:57 +08:00
|
|
|
.PRECIOUS: %-libtcc1.a
|
2017-02-25 19:49:47 +08:00
|
|
|
FORCE:
|
2017-02-23 15:41:57 +08:00
|
|
|
|
2020-04-12 23:34:01 +08:00
|
|
|
run-if = $(if $(shell which $1),$S $1 $2)
|
|
|
|
S = $(if $(findstring yes,$(SILENT)),@$(info * $@))
|
|
|
|
|
2017-02-23 15:41:57 +08:00
|
|
|
# --------------------------------------------------------------------------
|
2017-02-25 19:49:47 +08:00
|
|
|
# documentation and man page
|
|
|
|
tcc-doc.html: tcc-doc.texi
|
2020-04-12 23:34:01 +08:00
|
|
|
$(call run-if,makeinfo,--no-split --html --number-sections -o $@ $<)
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
tcc-doc.info: tcc-doc.texi
|
2020-04-12 23:34:01 +08:00
|
|
|
$(call run-if,makeinfo,$< || true)
|
|
|
|
|
|
|
|
tcc.1 : tcc-doc.pod
|
|
|
|
$(call run-if,pod2man,--section=1 --center="Tiny C Compiler" \
|
|
|
|
--release="$(VERSION)" $< >$@ && rm -f $<)
|
|
|
|
%.pod : %.texi
|
|
|
|
$(call run-if,perl,$(TOPSRC)/texi2pod.pl $< $@)
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# --------------------------------------------------------------------------
|
2015-07-30 04:53:57 +08:00
|
|
|
# install
|
2016-05-20 20:48:02 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
INSTALL = install -m644
|
2017-05-13 14:59:06 +08:00
|
|
|
INSTALLBIN = install -m755 $(STRIP_$(CONFIG_strip))
|
2017-02-25 19:49:47 +08:00
|
|
|
STRIP_yes = -s
|
2015-07-30 04:53:57 +08:00
|
|
|
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
LIBTCC1_W = $(filter %-win32-libtcc1.a %-wince-libtcc1.a,$(LIBTCC1_CROSS))
|
|
|
|
LIBTCC1_U = $(filter-out $(LIBTCC1_W),$(LIBTCC1_CROSS))
|
2020-04-12 23:34:01 +08:00
|
|
|
IB = $(if $1,$(IM) mkdir -p $2 && $(INSTALLBIN) $1 $2)
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
IBw = $(call IB,$(wildcard $1),$2)
|
2020-04-12 23:34:01 +08:00
|
|
|
IF = $(if $1,$(IM) mkdir -p $2 && $(INSTALL) $1 $2)
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
IFw = $(call IF,$(wildcard $1),$2)
|
2020-04-12 23:34:01 +08:00
|
|
|
IR = $(IM) mkdir -p $2 && cp -r $1/. $2
|
|
|
|
IM = $(info -> $2 : $1)@
|
|
|
|
|
2020-01-18 05:58:39 +08:00
|
|
|
B_O = bcheck.o bt-exe.o bt-log.o bt-dll.o
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
# install progs & libs
|
|
|
|
install-unx:
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
$(call IBw,$(PROGS) $(PROGS_CROSS),"$(bindir)")
|
2020-01-18 05:58:39 +08:00
|
|
|
$(call IFw,$(LIBTCC1) $(B_O) $(LIBTCC1_U),"$(tccdir)")
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
$(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include")
|
|
|
|
$(call $(if $(findstring .so,$(LIBTCC)),IBw,IFw),$(LIBTCC),"$(libdir)")
|
|
|
|
$(call IF,$(TOPSRC)/libtcc.h,"$(includedir)")
|
|
|
|
$(call IFw,tcc.1,"$(mandir)/man1")
|
|
|
|
$(call IFw,tcc-doc.info,"$(infodir)")
|
|
|
|
$(call IFw,tcc-doc.html,"$(docdir)")
|
|
|
|
ifneq "$(wildcard $(LIBTCC1_W))" ""
|
|
|
|
$(call IFw,$(TOPSRC)/win32/lib/*.def $(LIBTCC1_W),"$(tccdir)/win32/lib")
|
|
|
|
$(call IR,$(TOPSRC)/win32/include,"$(tccdir)/win32/include")
|
|
|
|
$(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/win32/include")
|
2017-04-26 03:01:54 +08:00
|
|
|
endif
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
# uninstall
|
|
|
|
uninstall-unx:
|
2017-04-26 03:01:54 +08:00
|
|
|
@rm -fv $(foreach P,$(PROGS) $(PROGS_CROSS),"$(bindir)/$P")
|
2020-07-10 16:38:36 +08:00
|
|
|
@rm -fv "$(libdir)/libtcc.a" "$(libdir)/libtcc.so" "$(libdir)/libtcc.dylib" "$(includedir)/libtcc.h"
|
2017-04-26 03:01:54 +08:00
|
|
|
@rm -fv "$(mandir)/man1/tcc.1" "$(infodir)/tcc-doc.info"
|
|
|
|
@rm -fv "$(docdir)/tcc-doc.html"
|
2020-04-12 23:34:01 +08:00
|
|
|
@rm -frv "$(tccdir)"
|
2017-02-23 15:41:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# install progs & libs on windows
|
|
|
|
install-win:
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
$(call IBw,$(PROGS) $(PROGS_CROSS) $(subst libtcc.a,,$(LIBTCC)),"$(bindir)")
|
|
|
|
$(call IF,$(TOPSRC)/win32/lib/*.def,"$(tccdir)/lib")
|
2020-01-18 05:58:39 +08:00
|
|
|
$(call IFw,libtcc1.a $(B_O) $(LIBTCC1_W),"$(tccdir)/lib")
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
$(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include")
|
|
|
|
$(call IR,$(TOPSRC)/win32/include,"$(tccdir)/include")
|
|
|
|
$(call IR,$(TOPSRC)/win32/examples,"$(tccdir)/examples")
|
|
|
|
$(call IF,$(TOPSRC)/tests/libtcc_test.c,"$(tccdir)/examples")
|
|
|
|
$(call IFw,$(TOPSRC)/libtcc.h $(subst .dll,.def,$(LIBTCC)),"$(libdir)")
|
|
|
|
$(call IFw,$(TOPSRC)/win32/tcc-win32.txt tcc-doc.html,"$(docdir)")
|
|
|
|
ifneq "$(wildcard $(LIBTCC1_U))" ""
|
|
|
|
$(call IFw,$(LIBTCC1_U),"$(tccdir)/lib")
|
|
|
|
$(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/lib/include")
|
2017-04-26 03:01:54 +08:00
|
|
|
endif
|
2015-07-29 21:05:56 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# the msys-git shell works to configure && make except it does not have install
|
2020-04-12 23:34:01 +08:00
|
|
|
ifeq ($(CONFIG_WIN32)-$(shell which install || echo no),yes-no)
|
2017-02-25 19:49:47 +08:00
|
|
|
install-win : INSTALL = cp
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
install-win : INSTALLBIN = cp
|
|
|
|
endif
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# uninstall on windows
|
|
|
|
uninstall-win:
|
2020-05-14 05:52:48 +08:00
|
|
|
@rm -fv $(foreach P,libtcc.dll $(PROGS) *-tcc.exe,"$(bindir)"/$P)
|
2020-04-12 23:34:01 +08:00
|
|
|
@rm -fr $(foreach P,doc examples include lib libtcc,"$(tccdir)/$P"/*)
|
|
|
|
@rm -frv $(foreach P,doc examples include lib libtcc,"$(tccdir)/$P")
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
# --------------------------------------------------------------------------
|
|
|
|
# other stuff
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2016-10-02 03:06:33 +08:00
|
|
|
TAGFILES = *.[ch] include/*.h lib/*.[chS]
|
|
|
|
tags : ; ctags $(TAGFILES)
|
2017-02-25 19:49:47 +08:00
|
|
|
# cannot have both tags and TAGS on windows
|
|
|
|
ETAGS : ; etags $(TAGFILES)
|
2015-07-30 04:53:57 +08:00
|
|
|
|
|
|
|
# create release tarball from *current* git branch (including tcc-doc.html
|
|
|
|
# and converting two files to CRLF)
|
2017-04-26 03:01:54 +08:00
|
|
|
TCC-VERSION = tcc-$(VERSION)
|
2020-04-12 23:34:01 +08:00
|
|
|
TCC-VERSION = tinycc-mob-$(shell git rev-parse --short=7 HEAD)
|
2015-07-30 04:53:57 +08:00
|
|
|
tar: tcc-doc.html
|
2020-04-12 23:34:01 +08:00
|
|
|
mkdir -p $(TCC-VERSION)
|
2015-07-30 04:53:57 +08:00
|
|
|
( cd $(TCC-VERSION) && git --git-dir ../.git checkout -f )
|
|
|
|
cp tcc-doc.html $(TCC-VERSION)
|
|
|
|
for f in tcc-win32.txt build-tcc.bat ; do \
|
|
|
|
cat win32/$$f | sed 's,\(.*\),\1\r,g' > $(TCC-VERSION)/win32/$$f ; \
|
|
|
|
done
|
|
|
|
tar cjf $(TCC-VERSION).tar.bz2 $(TCC-VERSION)
|
|
|
|
rm -rf $(TCC-VERSION)
|
|
|
|
git reset
|
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
config.mak:
|
|
|
|
$(if $(wildcard $@),,@echo "Please run ./configure." && exit 1)
|
|
|
|
|
2017-07-15 01:26:01 +08:00
|
|
|
# run all tests
|
2017-02-25 19:49:47 +08:00
|
|
|
test:
|
2020-04-12 23:34:01 +08:00
|
|
|
@$(MAKE) -C tests
|
2017-07-15 01:26:01 +08:00
|
|
|
# run test(s) from tests2 subdir (see make help)
|
|
|
|
tests2.%:
|
2020-04-12 23:34:01 +08:00
|
|
|
@$(MAKE) -C tests/tests2 $@
|
2017-02-25 19:49:47 +08:00
|
|
|
|
2018-01-05 09:13:27 +08:00
|
|
|
testspp.%:
|
2020-04-12 23:34:01 +08:00
|
|
|
@$(MAKE) -C tests/pp $@
|
2018-01-05 09:13:27 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
clean:
|
2020-04-12 23:34:01 +08:00
|
|
|
@rm -f tcc$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tcc.pod
|
|
|
|
@rm -f *.o *.a *.so* *.out *.log lib*.def *.exe *.dll a.out tags TAGS *.dylib
|
|
|
|
@$(MAKE) -s -C lib $@
|
|
|
|
@$(MAKE) -s -C tests $@
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
distclean: clean
|
2020-04-12 23:34:01 +08:00
|
|
|
@rm -fv config.h config.mak config.texi tcc.1 tcc-doc.info tcc-doc.html
|
2015-07-30 04:53:57 +08:00
|
|
|
|
2017-02-25 19:49:47 +08:00
|
|
|
.PHONY: all clean test tar tags ETAGS distclean install uninstall FORCE
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "make"
|
|
|
|
@echo " build native compiler (from separate objects)"
|
|
|
|
@echo ""
|
|
|
|
@echo "make cross"
|
|
|
|
@echo " build cross compilers (from one source)"
|
|
|
|
@echo ""
|
2020-04-12 23:34:01 +08:00
|
|
|
@echo "make ONE_SOURCE=no/yes SILENT=no/yes"
|
|
|
|
@echo " force building from separate/one object(s), less/more silently"
|
2017-02-25 19:49:47 +08:00
|
|
|
@echo ""
|
|
|
|
@echo "make cross-TARGET"
|
2020-04-12 23:34:01 +08:00
|
|
|
@echo " build one specific cross compiler for 'TARGET'. Currently supported:"
|
|
|
|
@echo " $(wordlist 1,6,$(TCC_X))"
|
|
|
|
@echo " $(wordlist 7,99,$(TCC_X))"
|
|
|
|
@echo ""
|
|
|
|
@echo "make test"
|
|
|
|
@echo " run all tests"
|
|
|
|
@echo ""
|
|
|
|
@echo "make tests2.all / make tests2.37 / make tests2.37+"
|
|
|
|
@echo " run all/single test(s) from tests2, optionally update .expect"
|
|
|
|
@echo ""
|
|
|
|
@echo "make testspp.all / make testspp.17"
|
|
|
|
@echo " run all/single test(s) from tests/pp"
|
|
|
|
@echo ""
|
|
|
|
@echo "Other supported make targets:"
|
|
|
|
@echo " install install-strip doc clean tags ETAGS tar distclean help"
|
2017-02-25 19:49:47 +08:00
|
|
|
@echo ""
|
2017-07-09 18:07:40 +08:00
|
|
|
@echo "Custom configuration:"
|
|
|
|
@echo " The makefile includes a file 'config-extra.mak' if it is present."
|
|
|
|
@echo " This file may contain some custom configuration. For example:"
|
|
|
|
@echo " NATIVE_DEFINES += -D..."
|
|
|
|
@echo " Or for example to configure the search paths for a cross-compiler"
|
|
|
|
@echo " that expects the linux files in <tccdir>/i386-linux:"
|
|
|
|
@echo " ROOT-i386 = {B}/i386-linux"
|
|
|
|
@echo " CRT-i386 = {B}/i386-linux/usr/lib"
|
|
|
|
@echo " LIB-i386 = {B}/i386-linux/lib:{B}/i386-linux/usr/lib"
|
|
|
|
@echo " INC-i386 = {B}/lib/include:{B}/i386-linux/usr/include"
|
|
|
|
@echo " DEF-i386 += -D__linux__"
|
2017-02-25 19:49:47 +08:00
|
|
|
|
|
|
|
# --------------------------------------------------------------------------
|
|
|
|
endif # ($(INCLUDED),no)
|