diff --git a/wmake/src/Allmake b/wmake/src/Allmake index 8130987f83..b4ced0078a 100755 --- a/wmake/src/Allmake +++ b/wmake/src/Allmake @@ -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 #------------------------------------------------------------------------------ diff --git a/wmake/src/Makefile b/wmake/src/Makefile index feb4bb248e..bcaf802af6 100644 --- a/wmake/src/Makefile +++ b/wmake/src/Makefile @@ -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