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/.
12 # Allows to bundle a set of packages under one name.
14 # This is intended to be used by gbuild classes that want to provide a
15 # filelist for installer, but for implementation reasons have to use
16 # several Packages internally (e.g., because of different source dirs).
18 $(dir $(call gb_PackageSet_get_target
,%)).
dir :
19 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
21 $(dir $(call gb_PackageSet_get_target
,%))%/.
dir :
22 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
24 $(call gb_PackageSet_get_target
,%) :
25 $(call gb_Output_announce
,$*,$(true
),PKS
,2)
26 cat
$(sort $(FILELISTS
)) > $@
28 .PHONY
: $(call gb_PackageSet_get_clean_target
,%)
29 $(call gb_PackageSet_get_clean_target
,%) :
30 $(call gb_Output_announce
,$*,$(false
),PKS
,2)
31 rm -f
$(call gb_PackageSet_get_target
,$*)
33 # Create and register a package set.
35 # gb_PackageSet_PackageSet set
36 define gb_PackageSet_PackageSet
37 $(call gb_PackageSet_PackageSet_internal
,$(1))
39 $$(eval
$$(call gb_Module_register_target
,$(call gb_PackageSet_get_target
,$(1)),$(call gb_PackageSet_get_clean_target
,$(1))))
40 $(call gb_Helper_make_userfriendly_targets
,$(1),PackageSet
)
44 # Create a package set.
46 # gb_PackageSet_PackageSet_internal set
47 define gb_PackageSet_PackageSet_internal
48 $(call gb_PackageSet_get_target
,$(1)) : FILELISTS
:=
50 $(call gb_PackageSet_get_target
,$(1)) :|
$(dir $(call gb_PackageSet_get_target
,$(1))).
dir
54 # Add a package to the set.
56 # A package can be added more than once.
58 # gb_PackageSet_add_package set package
59 define gb_PackageSet_add_package
60 $(call gb_PackageSet_get_target
,$(1)) : FILELISTS
+= $(call gb_Package_get_target
,$(2))
62 $(call gb_PackageSet_get_target
,$(1)) : $(call gb_Package_get_target
,$(2))
63 $(call gb_PackageSet_get_clean_target
,$(1)) : $(call gb_Package_get_clean_target
,$(2))
67 # Add several packages to the set at once.
69 # gb_PackageSet_add_packages set package(s)
70 define gb_PackageSet_add_packages
71 $(foreach package
,$(2),$(call gb_PackageSet_add_package
,$(1),$(package
)))
75 # vim: set noet sw=4 ts=4: