From 733486cff227fe558d4efc117e215b7e5a93c337 Mon Sep 17 00:00:00 2001
From: Alejandro Mery
+-make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabi- TARGET=arm ++make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabi- ++
+ You can cross-compile for Android (ARM) using the » Android NDK. +@@ -368,7 +368,7 @@ NDKABI=8 + NDKVER=$NDK/toolchains/arm-linux-androideabi-4.4.3 + NDKP=$NDKVER/prebuilt/linux-x86/bin/arm-linux-androideabi- + NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm" +-make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF" TARGET=arm ++make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF" + +
+ You can cross-compile for iOS 3.0+ (iPhone/iPad) using the » iOS SDK. +@@ -387,7 +387,7 @@ ISDKVER=iPhoneOS4.3.sdk + ISDKP=$ISDK/usr/bin/ + ISDKF="-arch armv6 -isysroot $ISDK/SDKs/$ISDKVER" + make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" \ +- TARGET=arm TARGET_SYS=iOS ++ TARGET_SYS=iOS + +
+ You can cross-compile for a PPC target or a +@@ -398,11 +398,11 @@ of the toolchain: +
++ # PPC +-make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- TARGET=ppc ++make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- ++
+ # PPC/e500v2 +-make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe- TARGET=ppcspe ++make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe- ++
+ Whenever the host OS and the target OS differ, you need to specify +diff --git a/src/Makefile b/src/Makefile +index d4f8033..3e5b6dc 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -173,13 +173,11 @@ XCFLAGS= + # + # Cross-compilation examples: + # make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows +-# make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe- TARGET=ppcspe ++# make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- + + CCOPTIONS= $(CCDEBUG) $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS) + LDOPTIONS= $(CCDEBUG) $(LDFLAGS) + +-TARGET_ARCH= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET)) +- + HOST_CC= $(CC) + HOST_RM= rm -f + # NOTE: The LuaJIT distribution comes with pre-generated buildvm_*.h files. +@@ -214,6 +212,7 @@ TARGET_DYNXLDOPTS= + TARGET_XCFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U_FORTIFY_SOURCE + TARGET_XLDFLAGS= + TARGET_XLIBS= -lm ++TARGET_TCFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) + TARGET_ACFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_ARCH) $(TARGET_FLAGS) $(TARGET_CFLAGS) + TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAGS) + TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS) +@@ -223,7 +222,7 @@ ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs))) + TARGET_XCFLAGS+= -fno-stack-protector + endif + +-TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_ACFLAGS) -E lj_arch.h -dM) ++TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_TCFLAGS) -E lj_arch.h -dM) + ifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH))) + TARGET_CCARCH= x64 + TARGET_XCFLAGS+= $(CCOPT_X64) +@@ -251,6 +250,8 @@ endif + endif + endif + ++TARGET_ARCH= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_CCARCH)) ++ + ifneq (,$(PREFIX)) + ifneq (/usr/local,$(PREFIX)) + TARGET_XCFLAGS+= -DLUA_XROOT=\"$(PREFIX)/\" +-- +1.6.5.GIT +