From 254a88a6ab38d79334365d721db9d86e1fb98779 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 23 Nov 2014 13:08:54 +1000 Subject: [PATCH] Fixed absolute path make problem under windows --- tools/gmake_scripts/compiler_gcc.mk | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/gmake_scripts/compiler_gcc.mk b/tools/gmake_scripts/compiler_gcc.mk index 04a68afc..c6225d4d 100644 --- a/tools/gmake_scripts/compiler_gcc.mk +++ b/tools/gmake_scripts/compiler_gcc.mk @@ -9,9 +9,12 @@ # See readme.txt for the make API # +# Copy this pseudo variable so we can path expand it +MLIST := $(MAKEFILE_LIST) + # Win32 Nasty - must convert all paths into a format make can handle ifeq ($(basename $(OPT_OS)),win32) - PATHEXPAND := ARCH XCC XCXX XAS XLD XOC XOD XSZ XAR PROJECT BUILDDIR SRC DEFS LIBS INCPATH LIBPATH $(PATHLIST) + PATHEXPAND := ARCH XCC XCXX XAS XLD XOC XOD XSZ XAR PROJECT BUILDDIR SRC DEFS LIBS INCPATH LIBPATH MLIST $(PATHLIST) # First convert \'s to /'s $(foreach var,$(PATHEXPAND),$(eval $(var):=$$(subst \,/,$($(var))))) @@ -24,7 +27,7 @@ ifeq ($(basename $(OPT_OS)),win32) endif # Where are we -CURRENTDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +CURRENTDIR := $(dir $(abspath $(lastword $(MLIST)))) # Handle cpu specific options ifneq ($(OPT_CPU),) @@ -69,10 +72,10 @@ endif # Default project name is the project directory name ifeq ($(PROJECT),) - ifneq ($(firstword $(abspath $(firstword $(MAKEFILE_LIST)))),$(lastword $(abspath $(firstword $(MAKEFILE_LIST))))) + ifneq ($(firstword $(abspath $(firstword $(MLIST)))),$(lastword $(abspath $(firstword $(MLIST))))) $(error Your directory contains spaces. Gmake barfs at that. Please define PROJECT) endif - PROJECT := $(notdir $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))) + PROJECT := $(notdir $(patsubst %/,%,$(dir $(abspath $(firstword $(MLIST)))))) endif # Output directories