diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-04-13 11:18:26 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-04-13 11:18:26 +0200 |
commit | 8fd5ba3749aa740b3c060db775b42f15a5ce50a7 (patch) | |
tree | 5d6265a702c374d28f0917f965d84a23667512c3 /solenv | |
parent | 0086c3fe17a0aaaa04807b5a394dd6bef9f5e6f1 (diff) |
gbuild: improve handling of paths
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/Helper.mk | 17 | ||||
-rw-r--r-- | solenv/gbuild/platform/WNT_INTEL_MSC.mk | 7 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 8 |
3 files changed, 19 insertions, 13 deletions
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index 3d41f774760a..e5106dbb96a4 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -43,13 +43,28 @@ $(gb_Helper_MISCDUMMY) : define gb_Helper_abbreviate_dirs S=$(SRCDIR) && \ $(subst $(SRCDIR)/,$$S/,O=$(OUTDIR)) && \ -$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,W=$(WORKDIR) && $(subst $(WORKDIR)/,$$W/,$(1)))) +$(subst $(SRCDIR)/,$$S/,W=$(WORKDIR)) && \ +$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,\ +$(call gb_Helper_unix_path,$(1))))) endef define gb_Helper_abbreviate_dirs_native $(call gb_Helper_native_path,$(call gb_Helper_abbreviate_dirs,$(1))) endef +# Convert path to native notation +# First convert to unix style to avoid problems when +# $(SRCDIR) is substring of $(gb_Helper_SRCDIR_NATIVE) +# and $(1) already contains $(gb_Helper_SRCDIR_NATIVE) +define gb_Helper_native_path +$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(call gb_Helper_unix_path,$(1))) +endef + +# $(gb_Helper_SRCDIR_NATIVE) can't be substring of $(SRCDIR) +define gb_Helper_unix_path +$(subst $(gb_Helper_SRCDIR_NATIVE),$(SRCDIR),$(1)) +endef + define gb_Helper_make_clean_target gb_$(1)_get_clean_target = $(WORKDIR)/Clean/$(1)/$$(1) diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index fff0b8a65fd9..a6d88ff67fc2 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -244,15 +244,10 @@ endif gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/bin +gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR)) gb_Helper_set_ld_path := PATH="$${PATH}:$(OUTDIR)/bin" -gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR)) -# Convert path to native notation -define gb_Helper_native_path -$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(1)) -endef - # Convert path to file URL. define gb_Helper_make_url file:///$(strip $(1)) diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 82876241c0a3..cf4dcab24776 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -115,7 +115,7 @@ gb_COMPILERNOOPTFLAGS := -O0 gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) - +# Helper class ifeq ($(OS_FOR_BUILD),MACOSX) gb_Helper_LIBRARY_PATH_VAR := DYLD_LIBRARY_PATH @@ -134,11 +134,6 @@ define gb_Helper_extend_ld_path $(gb_Helper_set_ld_path)$(foreach dir,$(1),:$(dir)) endef -# Convert path to native notation -define gb_Helper_native_path -$(1) -endef - # Convert path to file URL. define gb_Helper_make_url file://$(strip $(1)) @@ -146,5 +141,6 @@ endef gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/lib +gb_Helper_SRCDIR_NATIVE := $(SRCDIR) gb_Helper_get_rcfile = $(1)rc |