COMP: compile wmake toolchain for host when cross-compiling

This commit is contained in:
Mark Olesen 2019-06-07 10:32:37 +02:00 committed by Andrew Heather
parent 137130e437
commit b46992f66b
2 changed files with 24 additions and 6 deletions

View File

@ -7,6 +7,16 @@ then
export WM_DIR
fi
make # Compile tools for wmake
# Compile wmake toolchain
make
case "$WM_COMPILER" in
Mingw*)
# Host wmake toolchain with system gcc (when cross-compiling)
make \
WM_COMPILER=Gcc WM_COMPILER_TYPE=system \
WMAKE_BIN="${WM_DIR}/platforms/${WM_ARCH}${WM_COMPILER}"
;;
esac
#------------------------------------------------------------------------------

View File

@ -54,19 +54,27 @@ WM_COMPILE_OPTION = Opt
GENERAL_RULES = $(WM_DIR)/rules/General
include $(GENERAL_RULES)/general
archHost := $(WM_ARCH)$(WM_COMPILER)
archTarget := $(shell basename $(WMAKE_BIN))
#------------------------------------------------------------------------------
# Targets
#------------------------------------------------------------------------------
.PHONY: all clean
.PHONY: all clean message
all: \
$(WMAKE_BIN)/wmkdepend$(EXT_EXE)
@echo "built wmake-bin for $(WM_ARCH)$(WM_COMPILER)"
all: $(WMAKE_BIN)/wmkdepend$(EXT_EXE) message
message:
ifneq ($(archHost),$(archTarget))
@echo "built wmake-bin ($(archTarget)) for $(archHost) host"
else
@echo "built wmake-bin ($(archTarget))"
endif
clean:
@echo "clean wmake-bin for $(WM_ARCH)$(WM_COMPILER)"
@echo "clean wmake-bin ($(archTarget))"
@rm -rf $(WMAKE_BIN) 2>/dev/null
@rmdir $(shell dirname $(WMAKE_BIN)) 2>/dev/null || true