diff options
author | Jeffrey Clark <dude@zaplabs.com> | 2015-11-02 21:05:34 -0600 |
---|---|---|
committer | Jeffrey Clark <dude@zaplabs.com> | 2016-02-15 12:09:35 -0600 |
commit | 36df7413dce0897215d3e01e54ac5334bb65d965 (patch) | |
tree | cd39de38a12b851bafcf992aec2d488ab80f8247 /makefile | |
parent | 4e7f9e86e81af80de19f90b50632a1b579d9e4c3 (diff) |
add TOOLCHAIN make flag for explicit toolchain prefix cross compiling (nw)
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -75,6 +75,7 @@ # BUILDDIR = build # TARGETOS = windows # CROSS_BUILD = 1 +# TOOLCHAIN = # OVERRIDE_CC = cc # OVERRIDE_CXX = c++ # OVERRIDE_LD = ld @@ -270,9 +271,9 @@ WINDRES := $(MINGW32)/bin/windres endif else ifeq ($(ARCHITECTURE),_x64) -WINDRES := x86_64-w64-mingw32-windres +WINDRES := $(word 1,$(TOOLCHAIN) x86_64-w64-mingw32-)windres else -WINDRES := i686-w64-mingw32-windres +WINDRES := $(word 1,$(TOOLCHAIN) i686-w64-mingw32-)windres endif endif @@ -407,6 +408,9 @@ endif PARAMS+= --distro=$(DISTRO) +ifdef TOOLCHAIN +PARAMS += --TOOLCHAIN='$(TOOLCHAIN)' +endif ifdef OVERRIDE_CC PARAMS += --CC='$(OVERRIDE_CC)' ifndef CROSS_BUILD @@ -777,12 +781,12 @@ endif ifeq ($(OS),windows) ifeq (posix,$(SHELLTYPE)) -GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null) -CLANG_VERSION := $(shell $(subst @,,$(CC)) --version 2> /dev/null| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1) +GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null) +CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1) PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python) else -GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> NUL) -CLANG_VERSION := $(shell $(subst @,,$(CC)) --version 2> NUL| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1) +GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> NUL) +CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> NUL| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1) PYTHON_AVAILABLE := $(shell $(PYTHON) --version > NUL 2>&1 && echo python) endif ifdef MSBUILD @@ -799,9 +803,9 @@ MSBUILD_PARAMS += /p:Platform=win32 endif endif else -GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null) +GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null) ifneq ($(OS),solaris) -CLANG_VERSION := $(shell $(subst @,,$(CC)) --version 2> /dev/null | head -n 1 | grep -e 'version [0-9]\.[0-9]\(\.[0-9]\)\?' -o | grep -e '[0-9]\.[0-9]\(\.[0-9]\)\?' -o | tail -n 1) +CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null | head -n 1 | grep -e 'version [0-9]\.[0-9]\(\.[0-9]\)\?' -o | grep -e '[0-9]\.[0-9]\(\.[0-9]\)\?' -o | tail -n 1) endif PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python) endif |