Introduce optional user variable 'PLATFORM' for cross compilation
This commit is contained in:
parent
65e9fc78d7
commit
262143b66d
1 changed files with 22 additions and 0 deletions
|
|
@ -434,6 +434,28 @@ endif
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
#=== target platform ===========================================================
|
||||||
|
|
||||||
|
|
||||||
|
# PLATFORM: optional user variable to define target platform for cross
|
||||||
|
# compilation. Redefine build tools accordingly. PLATFORM should match
|
||||||
|
# the exact target prefix of tools present in $PATH, like x86_64-w64-mingw32,
|
||||||
|
# x86_64-apple-darwin12 etc. Tool definitions are exported to ensure submakes
|
||||||
|
# will get the same.
|
||||||
|
|
||||||
|
ifneq ($(PLATFORM),)
|
||||||
|
ifneq ($(findstring darwin, $(PLATFORM)),)
|
||||||
|
export CC = $(PLATFORM)-cc
|
||||||
|
export CXX = $(PLATFORM)-c++
|
||||||
|
export CPP = $(PLATFORM)-cc
|
||||||
|
else
|
||||||
|
export CC = $(PLATFORM)-gcc
|
||||||
|
export CXX = $(PLATFORM)-g++
|
||||||
|
export CPP = $(PLATFORM)-cpp
|
||||||
|
endif
|
||||||
|
STRIP = $(PLATFORM)-strip
|
||||||
|
endif
|
||||||
|
|
||||||
# Let (native or cross-) compiler report target triplet and isolate individual
|
# Let (native or cross-) compiler report target triplet and isolate individual
|
||||||
# words therein to facilitate later processing.
|
# words therein to facilitate later processing.
|
||||||
target.triplet := $(subst -, ,$(shell $(CC) -dumpmachine))
|
target.triplet := $(subst -, ,$(shell $(CC) -dumpmachine))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue