Resolves: tdf#151441 queries don't show any content
[LibreOffice.git] / solenv / gbuild / Deliver.mk
bloba3e85f30cb3497c7d8d69d7bb72c95d444109c84
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 :=
26 endef
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),)
33 endef
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))
39 endif
41 endef
43 define gb_Deliver__deliver
44 $(if $(gb_Deliver_CLEARONDELIVER),rm -f $(2) &&) cp -P -f $(1) $(2) && $(TOUCH) -hr $(1) $(2)
45 endef
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)
50 endef
51 endif
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)))
57 endef
59 define gb_Deliver_print_deliverable
60 $(info $(1) $(2))
61 endef
63 showdeliverables :
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)))))
67 @true
69 # vim: set noet sw=4: