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/.
10 # CliConfigTarget class
12 gb_CliConfigTarget_TARGET
:= $(SRCDIR
)/solenv
/bin
/clipatchconfig.pl
13 gb_CliConfigTarget_COMMAND
:= $(PERL
) -w
$(gb_CliConfigTarget_TARGET
)
15 define gb_CliConfigTarget__command
16 $(call gb_Output_announce
,$(2),$(true
),CPA
,1)
17 $(call gb_Helper_abbreviate_dirs
,\
18 $(gb_CliConfigTarget_COMMAND
) $(3) $(CLI_CONFIG_VERSIONFILE
) $(1) \
22 $(dir $(call gb_CliConfigTarget_get_target
,%))%/.
dir :
23 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
25 $(call gb_CliConfigTarget_get_target
,%) :
26 $(call gb_CliConfigTarget__command
,$@
,$*,$<)
28 $(call gb_CliConfigTarget_get_clean_target
,%) :
29 $(call gb_Output_announce
,$*,$(false
),CPA
,1)
30 rm -f
$(call gb_CliConfigTarget_get_target
,$*)
32 # Subst. variables in a config file
34 # gb_CliConfigTarget_CliConfigTarget target source
35 define gb_CliConfigTarget_CliConfigTarget
36 $(call gb_CliConfigTarget_get_target
,$(1)) : CLI_CONFIG_VERSIONFILE
:= $(3)
38 $(call gb_CliConfigTarget_get_target
,$(1)) : $(2)
39 $(call gb_CliConfigTarget_get_target
,$(1)) : $(gb_CliConfigTarget_TARGET
)
40 $(call gb_CliConfigTarget_get_target
,$(1)) : $(3)
41 $(call gb_CliConfigTarget_get_target
,$(1)) :|
$(dir $(call gb_CliConfigTarget_get_target
,$(1))).
dir
45 # CliAssemblyTarget class
48 # CliAssemblyTarget_POLICYEXT
49 # CliAssemblyTarget_get_dll
51 gb_CliAssemblyTarget_KEYFILE_DEFAULT
:= $(SRCDIR
)/cli_ure
/source
/cliuno.snk
53 define gb_CliAssemblyTarget__command
54 $(call gb_Output_announce
,$(2),$(true
),AL
,2)
55 $(call gb_Helper_abbreviate_dirs
,\
56 $(GNUCOPY
) $(CLI_ASSEMBLY_KEYFILE
) $(1).tmp.snk
&& \
59 -out
:$(CLI_ASSEMBLY_OUTFILE
) \
60 -version
:$(CLI_ASSEMBLY_VERSION
) \
61 -keyfile
:$(1).tmp.snk \
62 -link
:$(CLI_ASSEMBLY_CONFIGFILE
) \
63 $(if
$(CLI_ASSEMBLY_PLATFORM
),-platform
:$(CLI_ASSEMBLY_PLATFORM
)) && \
64 rm -f
$(1).tmp.snk
&& \
69 $(dir $(call gb_CliAssemblyTarget_get_target
,%)).
dir :
70 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
72 $(dir $(call gb_CliAssemblyTarget_get_target
,%))%/.
dir :
73 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
75 $(call gb_CliAssemblyTarget_get_target
,%) :
76 $(if
$(strip $(CLI_ASSEMBLY_VERSION
)),,$(call gb_Output_error
,assembly version not set
))
77 $(if
$(strip $(CLI_ASSEMBLY_CONFIGFILE
)),,$(call gb_Output_error
,assembly configuration file not set
))
78 $(if
$(strip $(CLI_ASSEMBLY_OUTFILE
)),,$(call gb_Output_error
,assembly name not set
))
79 $(call gb_CliAssemblyTarget__command
,$@
,$*,$<)
81 $(call gb_CliAssemblyTarget_get_assembly_target
,%) :
84 .PHONY
: $(call gb_CliAssemblyTarget_get_clean_target
,%)
85 $(call gb_CliAssemblyTarget_get_clean_target
,%) :
86 $(call gb_Output_announce
,$*,$(false
),AL
,2)
87 $(call gb_Helper_abbreviate_dirs
,\
88 rm -f
$(call gb_CliAssemblyTarget_get_target
,$*) $(CLI_ASSEMBLY_OUTFILE
) \
91 # Create a CLI assembly
92 define gb_CliAssemblyTarget_CliAssemblyTarget
93 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_CONFIGFILE
:=
94 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_KEYFILE
:= $(gb_CliAssemblyTarget_KEYFILE_DEFAULT
)
95 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_OUTFILE
:=
96 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_PLATFORM
:=
97 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_VERSION
:=
99 $(call gb_CliAssemblyTarget_get_clean_target
,$(1)) : CLI_ASSEMBLY_OUTFILE
:=
101 $(call gb_CliAssemblyTarget_get_target
,$(1)) :|
$(dir $(call gb_CliAssemblyTarget_get_target
,$(1))).
dir
105 define gb_CliAssemblyTarget_set_configfile
106 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_CONFIGFILE
:= $(2)
107 $(call gb_CliAssemblyTarget_get_target
,$(1)) : $(2)
108 $(call gb_CliAssemblyTarget_get_clean_target
,$(1)) : $(3)
112 define gb_CliAssemblyTarget_set_keyfile
113 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_KEYFILE
:= $(2)
114 $(call gb_CliAssemblyTarget_get_target
,$(1)) : $(2)
118 define gb_CliAssemblyTarget_set_name
119 $(call gb_CliAssemblyTarget_get_target
,$(1)) \
120 $(call gb_CliAssemblyTarget_get_clean_target
,$(1)) : \
121 CLI_ASSEMBLY_OUTFILE
:= $(call gb_CliAssemblyTarget_get_assembly_target
,$(2))
122 $(call gb_CliAssemblyTarget_get_assembly_target
,$(2)) : $(call gb_CliAssemblyTarget_get_target
,$(1))
126 define gb_CliAssemblyTarget_set_platform
127 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_PLATFORM
:= $(2)
131 define gb_CliAssemblyTarget_set_version
132 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_VERSION
:= $(2)
138 gb_CliAssembly_KEYFILE_DEFAULT
:= $(gb_CliAssemblyTarget_KEYFILE_DEFAULT
)
139 gb_CliAssembly_POLICYEXT
:= $(gb_CliAssemblyTarget_POLICYEXT
)
141 gb_CliAssembly_get_dll
= $(call gb_CliAssemblyTarget_get_dll
,$(1))
143 $(call gb_CliAssembly_get_target
,%) :
144 $(call gb_Output_announce
,$*,$(true
),CLA
,3)
145 mkdir
-p
$(dir $@
) && touch
$@
147 .PHONY
: $(call gb_CliAssembly_get_clean_target
,%)
148 $(call gb_CliAssembly_get_clean_target
,%) :
149 $(call gb_Output_announce
,$*,$(false
),CLA
,3)
150 rm -f
$(call gb_CliAssembly_get_target
,$*)
152 # call gb_CliAssembly_CliAssembly,dllname,dlltarget
153 define gb_CliAssembly_CliAssembly
154 $(call gb_CliAssemblyTarget_CliAssemblyTarget
,$(1))
155 $(call gb_Package_Package_internal
,$(1)_assembly
,$(WORKDIR
))
156 $(call gb_Package_set_outdir
,$(1)_assembly
,$(dir $(2)))
158 $(call gb_CliAssembly_get_target
,$(1)) : $(call gb_CliAssemblyTarget_get_target
,$(1))
159 $(call gb_CliAssembly_get_target
,$(1)) :|
$(call gb_Package_get_target
,$(1)_assembly
)
160 $(call gb_CliAssembly_get_clean_target
,$(1)) : $(call gb_CliAssemblyTarget_get_clean_target
,$(1))
161 $(call gb_CliAssembly_get_clean_target
,$(1)) : $(call gb_Package_get_clean_target
,$(1)_assembly
)
165 define gb_CliAssembly__add_file
166 $(call gb_Package_add_file
,$(1)_assembly
,$(notdir $(2)),$(subst $(WORKDIR
)/,,$(2)))
170 define gb_CliAssembly__set_configfile_impl
171 $(call gb_CliAssemblyTarget_set_configfile
,$(1),$(2),$(3))
172 $(call gb_CliAssembly__add_file
,$(1),$(2))
176 define gb_CliAssembly__set_configfile
177 $(call gb_CliConfigTarget_CliConfigTarget
,$(2),$(3),$(4))
178 $(call gb_CliAssembly__set_configfile_impl
,$(1),$(call gb_CliConfigTarget_get_target
,$(2)),$(call gb_CliConfigTarget_get_clean_target
,$(2)))
182 define gb_CliAssembly_set_configfile
183 $(call gb_CliAssembly__set_configfile
,$(1),$(patsubst %_config
,%,$(2)),$(SRCDIR
)/$(2),$(SRCDIR
)/$(3))
187 define gb_CliAssembly_set_keyfile
188 $(call gb_CliAssemblyTarget_set_keyfile
,$(1),$(2))
192 define gb_CliAssembly_set_platform
193 $(call gb_CliAssemblyTarget_set_platform
,$(1),$(2))
197 define gb_CliAssembly_set_policy
198 $(call gb_CliAssemblyTarget_set_version
,$(1),$(3))
199 $(call gb_CliAssemblyTarget_set_name
,$(1),$(2))
200 $(call gb_CliAssembly__add_file
,$(1),$(call gb_CliAssemblyTarget_get_assembly_target
,$(2)))
204 # vim: set noet sw=4 ts=4: