office-gobmx/solenv/gbuild/Deliver.mk
2011-01-10 21:35:27 -06:00

79 lines
2.8 KiB
Makefile

#*************************************************************************
#
# 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: