Set up proper -m flag manipulation for cross-compiling builds.

This commit is contained in:
Pietro Gagliardi 2015-05-07 16:02:34 -04:00
parent 598a499072
commit 49595bb18d
4 changed files with 8 additions and 7 deletions

View File

@ -19,11 +19,13 @@ xCFLAGS = \
-Wno-switch \
--std=c99 \
$(CFLAGS) \
$(archmflag) \
$(baseCFLAGS)
xLDFLAGS = \
-g \
$(LDFLAGS) \
$(archmflag) \
$(baseLDFLAGS)
OUT = $(OUTDIR)/$(OUTBASE)$(baseSUFFIX)

View File

@ -39,5 +39,5 @@ baseSUFFIX = $(osLIBSUFFIX)
include GNUbase.mk
test: $(OUT)
$(MAKE) -f GNUmaketest.mk osLIB=$(OUT) osEXESUFFIX=$(osEXESUFFIX) CC=$(CC)
$(MAKE) -f GNUmaketest.mk osLIB=$(OUT) osEXESUFFIX=$(osEXESUFFIX) CC=$(CC) archmflag=$(archmflag)
.PHONY: test

View File

@ -31,6 +31,7 @@ osLIBSUFFIX = .dylib
osEXESUFFIX =
ifeq ($(ARCH),386)
osCFLAGS += -m32
osLDFLAGS += -m32
archmflag = -m32
else
archmflag = -m64
endif

View File

@ -38,11 +38,9 @@ osEXESUFFIX = .exe
ifeq ($(ARCH),amd64)
CC = x86_64-w64-mingw32-gcc
RC = x86_64-w64-mingw32-windres
osCFLAGS += -m64
osLDFLAGS += -m64
archmflag = -m64
else
CC = i686-w64-mingw32-gcc
RC = i686-w64-mingw32-windres
osCFLAGS += -m32
osLDFLAGS += -m32
archmflag = -m32
endif