From 33aba82edfc919174a24e9ca8b3256d350126b97 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Wed, 1 Dec 2010 22:24:21 +0100 Subject: [PATCH] gnumake2: use gnu cp when available, fallback to posix tools outherwise --- solenv/gbuild/Deliver.mk | 18 ++++++++++-------- solenv/gbuild/platform/linux.mk | 5 ----- solenv/gbuild/platform/macosx.mk | 1 - solenv/gbuild/platform/solaris.mk | 2 -- solenv/gbuild/platform/windows.mk | 1 - 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk index ed44af2fae2e..bb3c815b8e1c 100644 --- a/solenv/gbuild/Deliver.mk +++ b/solenv/gbuild/Deliver.mk @@ -25,19 +25,13 @@ # #************************************************************************* -# gb_Deliver_GNUCOPY is set by the platform +gb_Deliver_GNUCOPY := $(GNUCOPY) # if ($true) then old files will get removed from the target location before # they are copied there. In multi-user environments, this is needed you need to # be the owner of the target file to be able to modify timestamps gb_Deliver_CLEARONDELIVER := $(true) -gb_Deliver__deliverprefix = mkdir -p $(dir $(1)) && - -ifeq ($(gb_Deliver_CLEARONDELIVER),$(true)) -gb_Deliver__deliverprefix += rm -rf $(1) && -endif - define gb_Deliver_init gb_Deliver_DELIVERABLES := @@ -49,9 +43,17 @@ gb_Deliver_DELIVERABLES += $$(patsubst $(REPODIR)/%,%,$(2)):$$(patsubst $(REPODI endef +ifeq($(strip $(gb_Deliver_GNUCOPY),) define gb_Deliver_deliver -$(call gb_Deliver__deliverprefix,$(2)) $(gb_Deliver_GNUCOPY) -f $(1) $(2) && touch -r $(1) $(2) +mkdir -p $(dir $(2)) && $(if $(gb_Deliver_CLEARONDELIVER),rm -f $(1) &&) cp -f $(1) $(2) && touch -r $(1) $(2) + endef +else +define gb_Deliver_deliver +mkdir -p $(dir $(2)) && $(gb_Deliver_GNUCOPY) $(if $(gb_Deliver_CLEARONDELIVER),--remove-destination) -pf $(1) $(2) + +endef + # We are currently only creating a deliver.log, if only one module gets build. # As it is possible to add gbuild modules into other (which is done for example for diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk index 31aaf5e4bada..658e11619d66 100755 --- a/solenv/gbuild/platform/linux.mk +++ b/solenv/gbuild/platform/linux.mk @@ -136,11 +136,6 @@ endif gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs) -# Deliver class - -gb_Deliver_GNUCOPY := cp - - # CObject class define gb_CObject__command diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 40ea6ba88906..7b6bfa49af28 100755 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -133,7 +133,6 @@ endif # Helper class gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs) -gb_Deliver_GNUCOPY := cp # CObject class diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 1fb7f047b1b6..a288a6a39368 100755 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -116,8 +116,6 @@ endif # Helper class gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs) -gb_Deliver_GNUCOPY := $(or $(GNUCOPY),gnucp) - # CObject class diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index 019ce4216ca8..df2a821e69b1 100755 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -181,7 +181,6 @@ endif # Helper class -gb_Deliver_GNUCOPY := cp gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR)) gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR)) gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR))