| @@ -62,6 +62,9 @@ else · 61 unmodified lines |
| 62 | 62 | endif |
| 63 | 63 | export MACOSX_DEPLOYMENT_TARGET := 10.6 |
| 64 | 64 | endif |
| 65 | + ifdef CONFIG_BSD |
| 66 | + NATIVE_TARGET = $(ARCH)-$(TARGETOS) |
| 67 | + endif |
| 65 | 68 | endif |
| 66 | 69 | |
| 67 | 70 | # run local version of tcc with local libraries and includes |
| @@ -70,11 +73,6 @@ TCCFLAGS-win = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) -L$(TO · 2 unmodified lines |
| 70 | 73 | TCCFLAGS = $(TCCFLAGS$(CFG)) |
| 71 | 74 | TCC = $(TOP)/tcc$(EXESUF) $(TCCFLAGS) |
| 72 | 75 | |
| 73 | | −# cross compiler targets to build |
| 74 | | −TCC_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm-wince c67 |
| 75 | | −TCC_X += riscv64 |
| 76 | | −# TCC_X += arm-fpa arm-fpa-ld arm-vfp arm-eabi |
| 77 | | − |
| 78 | 76 | CFLAGS_P = $(CFLAGS) -pg -static -DCONFIG_TCC_STATIC -DTCC_PROFILE |
| 79 | 77 | LIBS_P = $(LIBS) |
| 80 | 78 | LDFLAGS_P = $(LDFLAGS) |
| @@ -99,6 +97,27 @@ NATIVE_DEFINES_no_$(CONFIG_bcheck) += -DCONFIG_TCC_BCHECK=0 · 18 unmodified lines |
| 99 | 97 | NATIVE_DEFINES_no_$(CONFIG_backtrace) += -DCONFIG_TCC_BACKTRACE=0 |
| 100 | 98 | NATIVE_DEFINES += $(NATIVE_DEFINES_yes) $(NATIVE_DEFINES_no_no) |
| 101 | 99 | |
| 100 | +DEF-i386 = -DTCC_TARGET_I386 |
| 101 | +DEF-i386-win32 = -DTCC_TARGET_I386 -DTCC_TARGET_PE |
| 102 | +DEF-x86_64 = -DTCC_TARGET_X86_64 |
| 103 | +DEF-x86_64-win32= -DTCC_TARGET_X86_64 -DTCC_TARGET_PE |
| 104 | +DEF-x86_64-osx = -DTCC_TARGET_X86_64 -DTCC_TARGET_MACHO |
| 105 | +DEF-arm-fpa = -DTCC_TARGET_ARM |
| 106 | +DEF-arm-fpa-ld = -DTCC_TARGET_ARM -DLDOUBLE_SIZE=12 |
| 107 | +DEF-arm-vfp = -DTCC_TARGET_ARM -DTCC_ARM_VFP |
| 108 | +DEF-arm-eabi = -DTCC_TARGET_ARM -DTCC_ARM_VFP -DTCC_ARM_EABI |
| 109 | +DEF-arm-eabihf = $(DEF-arm-eabi) -DTCC_ARM_HARDFLOAT |
| 110 | +DEF-arm = $(DEF-arm-eabihf) |
| 111 | +DEF-arm-wince = $(DEF-arm-eabihf) -DTCC_TARGET_PE |
| 112 | +DEF-arm64 = -DTCC_TARGET_ARM64 |
| 113 | +DEF-riscv64 = -DTCC_TARGET_RISCV64 |
| 114 | +DEF-c67 = -DTCC_TARGET_C67 -w # disable warnigs |
| 115 | +DEF-x86_64-FreeBSD = $(DEF-x86_64) -DTARGETOS_FreeBSD |
| 116 | +DEF-x86_64-NetBSD = $(DEF-x86_64) -DTARGETOS_NetBSD |
| 117 | +DEF-x86_64-OpenBSD = $(DEF-x86_64) -DTARGETOS_OpenBSD |
| 118 | + |
| 119 | +DEF-$(NATIVE_TARGET) = $(NATIVE_DEFINES) |
| 120 | + |
| 102 | 121 | ifeq ($(INCLUDED),no) |
| 103 | 122 | # -------------------------------------------------------------------------- |
| 104 | 123 | # running top Makefile |
| @@ -109,6 +128,11 @@ TCCDOCS = tcc.1 tcc-doc.html tcc-doc.info · 4 unmodified lines |
| 109 | 128 | |
| 110 | 129 | all: $(PROGS) $(TCCLIBS) $(TCCDOCS) |
| 111 | 130 | |
| 131 | +# cross compiler targets to build |
| 132 | +TCC_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm-wince c67 |
| 133 | +TCC_X += riscv64 |
| 134 | +# TCC_X += arm-fpa arm-fpa-ld arm-vfp arm-eabi |
| 135 | + |
| 112 | 136 | # cross libtcc1.a targets to build |
| 113 | 137 | LIBTCC1_X = i386 x86_64 i386-win32 x86_64-win32 x86_64-osx arm arm64 arm-wince |
| 114 | 138 | LIBTCC1_X += riscv64 |
| @@ -122,7 +146,7 @@ cross: $(LIBTCC1_CROSS) $(PROGS_CROSS) · 7 unmodified lines |
| 122 | 146 | # build specific cross compiler & lib |
| 123 | 147 | cross-%: %-tcc$(EXESUF) %-libtcc1.a ; |
| 124 | 148 | |
| 125 | | −install: ; @$(MAKE) --no-print-directory install$(CFG) CONFIG_strip=no |
| 149 | +install: ; @$(MAKE) --no-print-directory install$(CFG) |
| 126 | 150 | install-strip: ; @$(MAKE) --no-print-directory install$(CFG) CONFIG_strip=yes |
| 127 | 151 | uninstall: ; @$(MAKE) --no-print-directory uninstall$(CFG) |
| 128 | 152 | |
| @@ -135,23 +159,6 @@ endif · 6 unmodified lines |
| 135 | 159 | T = $(or $(CROSS_TARGET),$(NATIVE_TARGET),unknown) |
| 136 | 160 | X = $(if $(CROSS_TARGET),$(CROSS_TARGET)-) |
| 137 | 161 | |
| 138 | | −DEF-i386 = -DTCC_TARGET_I386 |
| 139 | | −DEF-x86_64 = -DTCC_TARGET_X86_64 |
| 140 | | −DEF-i386-win32 = -DTCC_TARGET_PE -DTCC_TARGET_I386 |
| 141 | | −DEF-x86_64-win32= -DTCC_TARGET_PE -DTCC_TARGET_X86_64 |
| 142 | | −DEF-x86_64-osx = -DTCC_TARGET_MACHO -DTCC_TARGET_X86_64 |
| 143 | | −DEF-arm-wince = -DTCC_TARGET_PE -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_VFP -DTCC_ARM_HARDFLOAT |
| 144 | | −DEF-arm64 = -DTCC_TARGET_ARM64 |
| 145 | | −DEF-c67 = -DTCC_TARGET_C67 -w # disable warnigs |
| 146 | | −DEF-arm-fpa = -DTCC_TARGET_ARM |
| 147 | | −DEF-arm-fpa-ld = -DTCC_TARGET_ARM -DLDOUBLE_SIZE=12 |
| 148 | | −DEF-arm-vfp = -DTCC_TARGET_ARM -DTCC_ARM_VFP |
| 149 | | −DEF-arm-eabi = -DTCC_TARGET_ARM -DTCC_ARM_VFP -DTCC_ARM_EABI |
| 150 | | −DEF-arm-eabihf = -DTCC_TARGET_ARM -DTCC_ARM_VFP -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT |
| 151 | | −DEF-arm = $(DEF-arm-eabihf) |
| 152 | | −DEF-riscv64 = -DTCC_TARGET_RISCV64 |
| 153 | | −DEF-$(NATIVE_TARGET) = $(NATIVE_DEFINES) |
| 154 | | − |
| 155 | 162 | DEFINES += $(DEF-$T) $(DEF-all) |
| 156 | 163 | DEFINES += $(if $(ROOT-$T),-DCONFIG_SYSROOT="\"$(ROOT-$T)\"") |
| 157 | 164 | DEFINES += $(if $(CRT-$T),-DCONFIG_TCC_CRTPREFIX="\"$(CRT-$T)\"") |
| @@ -214,7 +221,6 @@ ifeq ($(CONFIG_strip),no) · 56 unmodified lines |
| 214 | 221 | CFLAGS += -g |
| 215 | 222 | LDFLAGS += -g |
| 216 | 223 | else |
| 217 | | −CONFIG_strip = yes |
| 218 | 224 | ifndef CONFIG_OSX |
| 219 | 225 | LDFLAGS += -s |
| 220 | 226 | endif |