summaryrefslogtreecommitdiff
path: root/solenv/gbuild/Deliver.mk
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-12-20 08:15:59 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-01-10 21:35:27 -0600
commit3b61f3f18684fe07775e68be1320b34a670beeba (patch)
treeb759df5b3b87223222d23623cc2a1364cb741d82 /solenv/gbuild/Deliver.mk
parentbdc248aea4a56adafd2ae8c7e914b785eb30d833 (diff)
first implementation of deliver.log generation
Diffstat (limited to 'solenv/gbuild/Deliver.mk')
-rw-r--r--solenv/gbuild/Deliver.mk79
1 files changed, 79 insertions, 0 deletions
diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk
new file mode 100644
index 000000000000..a71497e0f815
--- /dev/null
+++ b/solenv/gbuild/Deliver.mk
@@ -0,0 +1,79 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# gb_Deliver_GNUCOPY is set by the platform
+
+# 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 :=
+
+endef
+
+# FIXME: this does not really work for real multi repository builds, but the
+# deliver.log format is broken in that case anyway
+define gb_Deliver_add_deliverable
+gb_Deliver_DELIVERABLES += $$(patsubst $(SOURCE_ROOT_DIR)/%,%,$(2)):$$(patsubst $(SOURCE_ROOT_DIR)/%,%,$(1))
+
+endef
+
+define gb_Deliver_get_deliverlog
+$(foreach deliverable,$(gb_Deliver_DELIVERABLES),$(NEWLINE)COPY $(subst :, ,$(deliverable)))
+endef
+
+define gb_Deliver_deliver
+$(call gb_Deliver__deliverprefix,$(2)) $(gb_Deliver_GNUCOPY) -f $(1) $(2)
+endef
+
+define gb_Deliver_setdeliverlogcommand
+ifeq ($$(words $(gb_Module_ALLMODULES)),1)
+$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),LOG,1))
+deliverlog : COMMAND := mkdir -p $$(OUTDIR)/inc/$$(strip $$(gb_Module_ALLMODULES)) &&
+deliverlog : COMMAND += echo "$$(strip $$(call gb_Deliver_DELIVERABLES))" | awk -f $$(GBUILDDIR)/processdelivered.awk > $$(OUTDIR)/inc/$$(strip $(gb_Module_ALLMODULES))/deliver.log
+else
+$$(eval $$(call gb_Output_announce,more than one module - creating no deliver.log,$$(true),LOG,1))
+deliverlog : COMMAND := true
+endif
+endef
+
+.PHONY : deliverlog
+deliverlog:
+ $(eval $(call gb_Deliver_setdeliverlogcommand))
+ $(COMMAND)
+
+all : deliverlog
+
+# vim: set noet sw=4 ts=4: