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_Helper_abbreviate_dirs
,\
17 $(gb_CliConfigTarget_COMMAND
) $(3) $(CLI_CONFIG_VERSIONFILE
) $(1) \
21 $(dir $(call gb_CliConfigTarget_get_target
,%))%/.
dir :
22 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
24 $(call gb_CliConfigTarget_get_target
,%) :
25 $(call gb_Output_announce
,$*,$(true
),CPA
,1)
26 $(call gb_Trace_StartRange
,$*,CPA
)
27 $(call gb_CliConfigTarget__command
,$@
,$*,$<)
28 $(call gb_Trace_EndRange
,$*,CPA
)
30 $(call gb_CliConfigTarget_get_clean_target
,%) :
31 $(call gb_Output_announce
,$*,$(false
),CPA
,1)
32 rm -f
$(call gb_CliConfigTarget_get_target
,$*)
34 # Subst. variables in a config file
36 # gb_CliConfigTarget_CliConfigTarget target source
37 define gb_CliConfigTarget_CliConfigTarget
38 $(call gb_CliConfigTarget_get_target
,$(1)) : CLI_CONFIG_VERSIONFILE
:= $(3)
40 $(call gb_CliConfigTarget_get_target
,$(1)) : $(2)
41 $(call gb_CliConfigTarget_get_target
,$(1)) : $(gb_CliConfigTarget_TARGET
)
42 $(call gb_CliConfigTarget_get_target
,$(1)) : $(3)
43 $(call gb_CliConfigTarget_get_target
,$(1)) :|
$(dir $(call gb_CliConfigTarget_get_target
,$(1))).
dir
47 # CliAssemblyTarget class
50 # CliAssemblyTarget_POLICYEXT
51 # CliAssemblyTarget_get_dll
53 gb_CliAssemblyTarget_KEYFILE_DEFAULT
:= $(SRCDIR
)/cli_ure
/source
/cliuno.snk
55 define gb_CliAssemblyTarget__command
56 $(call gb_Helper_abbreviate_dirs
,\
57 $(GNUCOPY
) $(CLI_ASSEMBLY_KEYFILE
) $(1).tmp.snk
&& \
60 -out
:$(CLI_ASSEMBLY_OUTFILE
) \
61 -version
:$(CLI_ASSEMBLY_VERSION
) \
62 -keyfile
:$(1).tmp.snk \
63 -link
:$(CLI_ASSEMBLY_CONFIGFILE
) \
64 $(if
$(CLI_ASSEMBLY_PLATFORM
),-platform
:$(CLI_ASSEMBLY_PLATFORM
)) && \
65 rm -f
$(1).tmp.snk
&& \
70 $(dir $(call gb_CliAssemblyTarget_get_target
,%)).
dir :
71 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
73 $(dir $(call gb_CliAssemblyTarget_get_target
,%))%/.
dir :
74 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
76 $(call gb_CliAssemblyTarget_get_target
,%) :
77 $(if
$(strip $(CLI_ASSEMBLY_VERSION
)),,$(call gb_Output_error
,assembly version not set
))
78 $(if
$(strip $(CLI_ASSEMBLY_CONFIGFILE
)),,$(call gb_Output_error
,assembly configuration file not set
))
79 $(if
$(strip $(CLI_ASSEMBLY_OUTFILE
)),,$(call gb_Output_error
,assembly name not set
))
80 $(call gb_Output_announce
,$*,$(true
),AL
,2)
81 $(call gb_Trace_StartRange
,$*,AL
)
82 $(call gb_CliAssemblyTarget__command
,$@
,$*,$<)
83 $(call gb_Trace_EndRange
,$*,AL
)
85 $(call gb_CliAssemblyTarget_get_assembly_target
,%) :
88 .PHONY
: $(call gb_CliAssemblyTarget_get_clean_target
,%)
89 $(call gb_CliAssemblyTarget_get_clean_target
,%) :
90 $(call gb_Output_announce
,$*,$(false
),AL
,2)
91 $(call gb_Helper_abbreviate_dirs
,\
92 rm -f
$(call gb_CliAssemblyTarget_get_target
,$*) $(CLI_ASSEMBLY_OUTFILE
) \
95 # Create a CLI assembly
96 define gb_CliAssemblyTarget_CliAssemblyTarget
97 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_CONFIGFILE
:=
98 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_KEYFILE
:= $(gb_CliAssemblyTarget_KEYFILE_DEFAULT
)
99 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_OUTFILE
:=
100 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_PLATFORM
:=
101 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_VERSION
:=
103 $(call gb_CliAssemblyTarget_get_clean_target
,$(1)) : CLI_ASSEMBLY_OUTFILE
:=
105 $(call gb_CliAssemblyTarget_get_target
,$(1)) :|
$(dir $(call gb_CliAssemblyTarget_get_target
,$(1))).
dir
109 define gb_CliAssemblyTarget_set_configfile
110 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_CONFIGFILE
:= $(2)
111 $(call gb_CliAssemblyTarget_get_target
,$(1)) : $(2)
112 $(call gb_CliAssemblyTarget_get_clean_target
,$(1)) : $(3)
116 define gb_CliAssemblyTarget_set_keyfile
117 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_KEYFILE
:= $(2)
118 $(call gb_CliAssemblyTarget_get_target
,$(1)) : $(2)
122 define gb_CliAssemblyTarget_set_name
123 $(call gb_CliAssemblyTarget_get_target
,$(1)) \
124 $(call gb_CliAssemblyTarget_get_clean_target
,$(1)) : \
125 CLI_ASSEMBLY_OUTFILE
:= $(call gb_CliAssemblyTarget_get_assembly_target
,$(2))
126 $(call gb_CliAssemblyTarget_get_assembly_target
,$(2)) : $(call gb_CliAssemblyTarget_get_target
,$(1))
130 define gb_CliAssemblyTarget_set_platform
131 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_PLATFORM
:= $(2)
135 define gb_CliAssemblyTarget_set_version
136 $(call gb_CliAssemblyTarget_get_target
,$(1)) : CLI_ASSEMBLY_VERSION
:= $(2)
142 gb_CliAssembly_KEYFILE_DEFAULT
:= $(gb_CliAssemblyTarget_KEYFILE_DEFAULT
)
143 gb_CliAssembly_POLICYEXT
:= $(gb_CliAssemblyTarget_POLICYEXT
)
145 gb_CliAssembly_get_dll
= $(call gb_CliAssemblyTarget_get_dll
,$(1))
147 $(call gb_CliAssembly_get_target
,%) :
148 $(call gb_Output_announce
,$*,$(true
),CLA
,3)
149 $(call gb_Trace_MakeMark
,$*,CLA
)
150 mkdir
-p
$(dir $@
) && touch
$@
152 .PHONY
: $(call gb_CliAssembly_get_clean_target
,%)
153 $(call gb_CliAssembly_get_clean_target
,%) :
154 $(call gb_Output_announce
,$*,$(false
),CLA
,3)
155 rm -f
$(call gb_CliAssembly_get_target
,$*)
157 # call gb_CliAssembly_CliAssembly,dllname,dlltarget
158 define gb_CliAssembly_CliAssembly
159 $(call gb_CliAssemblyTarget_CliAssemblyTarget
,$(1))
160 $(call gb_Package_Package_internal
,$(1)_assembly
,$(WORKDIR
))
161 $(call gb_Package_set_outdir
,$(1)_assembly
,$(dir $(2)))
163 $(call gb_CliAssembly_get_target
,$(1)) : $(call gb_CliAssemblyTarget_get_target
,$(1))
164 $(call gb_CliAssembly_get_target
,$(1)) :|
$(call gb_Package_get_target
,$(1)_assembly
)
165 $(call gb_CliAssembly_get_clean_target
,$(1)) : $(call gb_CliAssemblyTarget_get_clean_target
,$(1))
166 $(call gb_CliAssembly_get_clean_target
,$(1)) : $(call gb_Package_get_clean_target
,$(1)_assembly
)
170 define gb_CliAssembly__add_file
171 $(call gb_Package_add_file
,$(1)_assembly
,$(notdir $(2)),$(subst $(WORKDIR
)/,,$(2)))
175 define gb_CliAssembly__set_configfile_impl
176 $(call gb_CliAssemblyTarget_set_configfile
,$(1),$(2),$(3))
177 $(call gb_CliAssembly__add_file
,$(1),$(2))
181 define gb_CliAssembly__set_configfile
182 $(call gb_CliConfigTarget_CliConfigTarget
,$(2),$(3),$(4))
183 $(call gb_CliAssembly__set_configfile_impl
,$(1),$(call gb_CliConfigTarget_get_target
,$(2)),$(call gb_CliConfigTarget_get_clean_target
,$(2)))
187 define gb_CliAssembly_set_configfile
188 $(call gb_CliAssembly__set_configfile
,$(1),$(patsubst %_config
,%,$(2)),$(SRCDIR
)/$(2),$(SRCDIR
)/$(3))
192 define gb_CliAssembly_set_keyfile
193 $(call gb_CliAssemblyTarget_set_keyfile
,$(1),$(2))
197 define gb_CliAssembly_set_platform
198 $(call gb_CliAssemblyTarget_set_platform
,$(1),$(2))
202 define gb_CliAssembly_set_policy
203 $(call gb_CliAssemblyTarget_set_version
,$(1),$(3))
204 $(call gb_CliAssemblyTarget_set_name
,$(1),$(2))
205 $(call gb_CliAssembly__add_file
,$(1),$(call gb_CliAssemblyTarget_get_assembly_target
,$(2)))
209 # vim: set noet sw=4 ts=4: