1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 gb_Deliver_GNUCOPY
:= $(GNUCOPY
)
22 define gb_Deliver_init
23 gb_Deliver_DELIVERABLES
:=
24 gb_Deliver_DELIVERABLES_INDEX
:=
28 define gb_Deliver_register_deliverable
29 gb_Deliver_DELIVERABLES_
$(notdir $(3)) += $(2):$(1)
30 gb_Deliver_DELIVERABLES_INDEX
:= $$(sort $$(gb_Deliver_DELIVERABLES_INDEX
) $(notdir $(3)))
31 $(if
$(gb_LOWRESTIME
),.LOW_RESOLUTION_TIME
: $(1),)
35 define gb_Deliver_add_deliverable
36 $$(if
$(3),,$$(error
- missing third parameter for deliverable
$(1)))
37 ifeq ($(MAKECMDGOALS
),showdeliverables
)
38 $(call gb_Deliver_register_deliverable
,$(1),$(2),$(3))
43 define gb_Deliver__deliver
44 $(if
$(gb_Deliver_CLEARONDELIVER
),rm -f
$(2) &&) cp
-P
-f
$(1) $(2) && $(TOUCH
) -hr
$(1) $(2)
47 ifneq ($(strip $(gb_Deliver_GNUCOPY
)),)
48 define gb_Deliver__deliver
49 $(gb_Deliver_GNUCOPY
) $(if
$(gb_Deliver_CLEARONDELIVER
),--remove-destination
) --no-dereference
--force --preserve
=timestamps
$(1) $(2)
53 define gb_Deliver_deliver
54 $(if
$(1),$(call gb_Deliver__deliver
,$(1),$(2)),\
55 $(error gb_Deliver_deliver
:\
56 file does not exist in instdir
, and cannot be delivered
: $(2)))
59 define gb_Deliver_print_deliverable
64 $(eval MAKEFLAGS
:= s
)
65 $(foreach deliverable
,$(sort $(foreach list
,$(gb_Deliver_DELIVERABLES_INDEX
),$(gb_Deliver_DELIVERABLES_
$(list
)))),\
66 $(call gb_Deliver_print_deliverable
,$(firstword $(subst :, ,$(deliverable
))),$(lastword
$(subst :, ,$(deliverable
)))))