create gbuild class for install scripts

This commit is contained in:
David Tardon
2012-05-29 07:34:16 +02:00
parent 8f102d9d70
commit 5fb958bc31
13 changed files with 839 additions and 7 deletions
+3 -5
View File
@@ -321,18 +321,16 @@ sub fileexists
}
############################################
# Checking the existence of ulf and
# jlf/mlf files
# Checking the existence of ulf file
############################################
sub check_existence_of_langfiles
{
my ($langfilename, $ulffilename) = @_;
my ($langfilename) = @_;
my $do_localize = 0;
if (( fileexists($ulffilename) ) && ( ! fileexists($langfilename) )) { pre2par::exiter::exit_program("Error: Did not find language file $langfilename", "check_existence_of_langfiles"); }
if (( fileexists($ulffilename) ) && ( fileexists($langfilename) )) { $do_localize = 1; }
if ( fileexists($langfilename) ) { $do_localize = 1; }
return $do_localize;
}
+1 -2
View File
@@ -53,9 +53,8 @@ my $parfile = pre2par::work::convert($prefile);
pre2par::work::formatter($parfile);
my $langfilename = pre2par::work::getlangfilename();
my $ulffilename = pre2par::work::getulffilename($pre2par::globals::prefilename);
my $dolocalization = pre2par::work::check_existence_of_langfiles($langfilename, $ulffilename);
my $dolocalization = pre2par::work::check_existence_of_langfiles($langfilename);
if ( $dolocalization )
{
+139
View File
@@ -0,0 +1,139 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
# (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
# InstallModule class
$(dir $(call gb_InstallModule_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_InstallModule_get_target,%) :
$(call gb_Output_announce,$*,$(true),IMO,3)
touch $@
$(call gb_InstallModule_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),IMO,3)
rm -f $(call gb_InstallModule_get_target,$*)
define gb_InstallModule_InstallModule
$(call gb_InstallModuleTarget_InstallModuleTarget,$(1))
$(call gb_Package_Package,$(1)_par,$(call gb_InstallModuleTarget_get_workdir,$(1)))
$(call gb_InstallModule_get_target,$(1)) : $(call gb_InstallModuleTarget_get_target,$(1))
$(call gb_InstallModule_get_target,$(1)) : $(call gb_Package_get_target,$(1)_par)
$(call gb_InstallModule_get_target,$(1)) :| $(dir $(call gb_InstallModule_get_target,$(1))).dir
$(call gb_Package_get_preparation_target,$(1)_par) :| $(call gb_InstallModuleTarget_get_target,$(1))
$(call gb_InstallModule_get_clean_target,$(1)) : $(call gb_InstallModuleTarget_get_clean_target,$(1))
$(call gb_InstallModule_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(1)_par)
$$(eval $$(call gb_Module_register_target,$(call gb_InstallModule_get_target,$(1)),$(call gb_InstallModule_get_clean_target,$(1))))
endef
define gb_InstallModule_set_include
$(call gb_InstallModuleTarget_set_include,$(1),$(2))
endef
define gb_InstallModule_add_defs
$(call gb_InstallModuleTarget_add_defs,$(1),$(2))
endef
define gb_InstallModule_define_if_set
$(call gb_InstallModuleTarget_define_if_set,$(1),$(2))
endef
define gb_InstallModule_define_value_if_set
$(call gb_InstallModuleTarget_define_value_if_set,$(1),$(2))
endef
define gb_InstallModule_define_mingw_dll_if_set
$(call gb_InstallModuleTarget_define_mingw_dll_if_set,$(1),$(2))
endef
define gb_InstallModule_use_package
$(call gb_InstallModuleTarget_use_package,$(1),$(2))
endef
define gb_InstallModule_use_packages
$(call gb_InstallModuleTarget_use_packages,$(1),$(2))
endef
define gb_InstallModule__add_scpfile_impl
$(call gb_Package_add_file,$(1)_par,par/osl/$(2),$(2))
endef
define gb_InstallModule__add_scpfile
$(call gb_InstallModule__add_scpfile_impl,$(1),$(notdir $(call gb_ScpTarget_get_target,$(2))))
endef
define gb_InstallModule__add_scpfiles
$(foreach scpfile,$(2),$(call gb_InstallModule__add_scpfile,$(1),$(scpfile)))
endef
define gb_InstallModule_add_scpfile
$(call gb_InstallModuleTarget_add_scpfile,$(1),$(2))
$(call gb_InstallModule__add_scpfile,$(1),$(2))
endef
define gb_InstallModule_add_scpfiles
$(call gb_InstallModuleTarget_add_scpfiles,$(1),$(2))
$(call gb_InstallModule__add_scpfiles,$(1),$(2))
endef
define gb_InstallModule_add_localized_scpfile
$(call gb_InstallModuleTarget_add_localized_scpfile,$(1),$(2))
$(call gb_InstallModule__add_scpfile,$(1),$(2))
endef
define gb_InstallModule_add_localized_scpfiles
$(call gb_InstallModuleTarget_add_localized_scpfiles,$(1),$(2))
endef
define gb_InstallModule_add_template
$(call gb_InstallModuleTarget_add_template,$(1),$(2))
endef
define gb_InstallModule_add_templates
$(call gb_InstallModuleTarget_add_templates,$(1),$(2))
endef
# vim: set shiftwidth=4 tabstop=4 noexpandtab:
+381
View File
@@ -0,0 +1,381 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
# (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
# Overview of dependencies and tasks of InstallModuleTarget
# target task depends on
# ScpTemplateTarget class
gb_ScpTemplateTarget_TARGET := $(SRCDIR)/scp2/source/templates/modules.pl
gb_ScpTemplateTarget_COMMAND := $(PERL) -w $(gb_ScpTemplateTarget_TARGET)
gb_ScpTemplateTarget_LANGS := $(sort $(ALL_LANGS))
gb_ScpTemplateTarget_get_source = $(SRCDIR)/$(1).sct
# TODO: verbose mode
define gb_ScpTemplateTarget__command
$(call gb_Output_announce,$(2),$(true),SCT,1)
$(call gb_Helper_abbreviate_dirs,\
export COMPLETELANGISO_VAR='$(gb_ScpTemplateTarget_LANGS)' && \
$(gb_ScpTemplateTarget_COMMAND) -verbose -i $(3) -o $(1) \
)
endef
$(dir $(call gb_ScpTemplateTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_ScpTemplateTarget_get_target,%) :
$(call gb_ScpTemplateTarget__command,$@,$*,$<)
.PHONY : $(call gb_ScpTemplateTarget_get_clean_target,%)
$(call gb_ScpTemplateTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),SCT,1)
rm -f $(call gb_ScpTemplateTarget_get_target,$*)
# gb_ScpTemplateTarget_ScpTemplateTarget(<target>)
define gb_ScpTemplateTarget_ScpTemplateTarget
$(call gb_ScpTemplateTarget_get_target,$(1)) : $(call gb_ScpTemplateTarget_get_source,$(1))
$(call gb_ScpTemplateTarget_get_target,$(1)) :| $(dir $(call gb_ScpTemplateTarget_get_target,$(1))).dir
endef
# ScpPreprocessTarget class
gb_ScpPreprocessTarget_TARGET := $(call gb_Executable_get_target_for_build,cpp.lcc)
gb_ScpPreprocessTarget_COMMAND := $(gb_Helper_set_ld_path) $(gb_ScpPreprocessTarget_TARGET)
gb_ScpPreprocessTarget_get_source = $(SRCDIR)/$(1).scp
define gb_ScpPreprocessTarget__command
$(call gb_Output_announce,$(2),$(true),SPP,2)
$(call gb_Helper_abbreviate_dirs,\
$(gb_ScpPreprocessTarget_COMMAND) \
-+ -P \
$(SCPDEFS) $(SCP_DEFS) -DDLLPOSTFIX=$(gb_Library_DLLPOSTFIX) \
$(SCP_INCLUDE) $(SCP_TEMPLATE_INCLUDE) \
$(3) > $(1) \
)
endef
$(dir $(call gb_ScpPreprocessTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_ScpPreprocessTarget_get_target,%) :
$(call gb_ScpPreprocessTarget__command,$@,$*,$<)
.PHONY : $(call gb_ScpPreprocessTarget_get_clean_target,%)
$(call gb_ScpPreprocessTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),SPP,2)
rm -f $(call gb_ScpPreprocessTarget_get_target,$*)
# gb_ScpPreprocessTarget_ScpPreprocessTarget(<target>)
define gb_ScpPreprocessTarget_ScpPreprocessTarget
$(call gb_ScpPreprocessTarget_get_target,$(1)) : $(call gb_ScpPreprocessTarget_get_source,$(1))
$(call gb_ScpPreprocessTarget_get_target,$(1)) :| $(dir $(call gb_ScpPreprocessTarget_get_target,$(1))).dir
endef
# ScpMergeTarget class
gb_ScpMergeTarget_TARGET := $(call gb_Executable_get_target_for_build,ulfex)
gb_ScpMergeTarget_COMMAND := $(gb_Helper_set_ld_path) $(gb_ScpMergeTarget_TARGET)
gb_ScpMergeTarget_get_source = $(SRCDIR)/$(1).ulf
define gb_ScpMergeTarget__command
$(call gb_Output_announce,$(2),$(true),SUM,1)
$(call gb_Helper_abbreviate_dirs,\
$(gb_ScpMergeTarget_COMMAND) -p scp2 -i $(3) -o $(1) -m $(SCP_SDF) -l all \
)
endef
$(dir $(call gb_ScpMergeTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_ScpMergeTarget_get_target,%) :
$(call gb_ScpMergeTarget__command,$@,$*,$<)
.PHONY : $(call gb_ScpMergeTarget_get_clean_target,%)
$(call gb_ScpMergeTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),SUM,1)
rm -f $(call gb_ScpMergeTarget_get_target,$*)
# gb_ScpMergeTarget_ScpMergeTarget(<target>)
define gb_ScpMergeTarget_ScpMergeTarget
$(call gb_ScpMergeTarget_get_target,$(1)) : $(call gb_ScpMergeTarget_get_source,$(1))
$(call gb_ScpMergeTarget_get_target,$(1)) :| $(dir $(call gb_ScpMergeTarget_get_target,$(1))).dir
$(call gb_ScpMergeTarget_get_target,$(1)) : SCP_SDF := $(gb_SDFLOCATION)/$(dir $(1))/localize.sdf
$(call gb_ScpMergeTarget_get_target,$(1)) : $$(SCP_SDF)
endef
# ScpConvertTarget class
# platform:
# gb_ScpConvertTarget_ScpConvertTarget_platform
gb_ScpConvertTarget_TARGET := $(call gb_Executable_get_target_for_build,ulfconv)
gb_ScpConvertTarget_COMMAND := $(gb_Helper_set_ld_path) $(gb_ScpConvertTarget_TARGET)
define gb_ScpConvertTarget__command
$(call gb_Output_announce,$(2),$(true),SCC,1)
$(call gb_Helper_abbreviate_dirs,\
$(gb_ScpConvertTarget_COMMAND) $(SCP_FLAGS) -o $(1) $(3) \
)
endef
$(dir $(call gb_ScpConvertTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_ScpConvertTarget_get_target,%) :
$(call gb_ScpConvertTarget__command,$@,$*,$<)
.PHONY : $(call gb_ScpConvertTarget_get_clean_target,%)
$(call gb_ScpConvertTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),SCC,1)
rm -f $(call gb_ScpConvertTarget_get_target,$*)
# gb_ScpConvertTarget_ScpConvertTarget(<target>,<ulffile>)
define gb_ScpConvertTarget_ScpConvertTarget
$(call gb_ScpConvertTarget_get_target,$(1)) : $(2)
$(call gb_ScpConvertTarget_get_target,$(1)) :| $(dir $(call gb_ScpConvertTarget_get_target,$(1))).dir
$(call gb_ScpConvertTarget_get_target,$(1)) : SCP_FLAGS :=
$(call gb_ScpConvertTarget_ScpConvertTarget_platform,$(1))
endef
# ScpTarget class
gb_ScpTarget_TARGET := $(SOLARENV)/bin/pre2par.pl
gb_ScpTarget_COMMAND := $(PERL) $(gb_ScpTarget_TARGET)
gb_ScpTarget_DEPTARGET := $(call gb_Executable_get_target_for_build,makedepend)
gb_ScpTarget_DEPCOMMAND := $(gb_Helper_set_ld_path) $(gb_ScpTarget_DEPTARGET)
define gb_ScpTarget__command
$(call gb_Output_announce,$(2),$(true),SCP,2)
$(call gb_Helper_abbreviate_dirs,\
$(gb_ScpTarget_COMMAND) -l $(SCP_ULF) -s $(3) -o $(1) \
)
endef
$(dir $(call gb_ScpTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_ScpTarget_get_target,%) :
$(call gb_ScpTarget__command,$@,$*,$<)
$(call gb_ScpTarget_get_external_target,%) :
touch $@
.PHONY : $(call gb_ScpTarget_get_clean_target,%)
$(call gb_ScpTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),SCP,2)
rm -f \
$(call gb_ScpTarget_get_target,$*) \
$(call gb_ScpTarget_get_external_target,$*) \
$(call gb_ScpTarget_get_dep_target,$*)
ifneq ($(gb_FULLDEPS),)
define gb_ScpTarget__command_dep
$(call gb_Output_announce,SCP:$(2),$(true),DEP,2)
$(call gb_Helper_abbreviate_dirs,\
$(gb_ScpTarget_DEPCOMMAND) \
$(SCPDEFS) $(SCP_DEFS) -DDLLPOSTFIX=$(gb_Library_DLLPOSTFIX) \
$(SCP_INCLUDE) $(SCP_TEMPLATE_INCLUDE) \
-f $(1) \
-p \
)
endef
$(dir $(call gb_ScpTarget_get_dep_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_ScpTarget_get_dep_target,%) :
$(call gb_ScpTarget__command_dep,$@,$*)
endif
# gb_ScpTarget_ScpTarget(<target>)
define gb_ScpTarget_ScpTarget
$(call gb_ScpPreprocessTarget_ScpPreprocessTarget,$(1))
$(call gb_ScpTarget_get_target,$(1)) : $(call gb_ScpPreprocessTarget_get_target,$(1))
$(call gb_ScpTarget_get_target,$(1)) :| $(call gb_ScpTarget_get_external_target,$(1))
$(call gb_ScpTarget_get_external_target,$(1)) :| $(dir $(call gb_ScpTarget_get_target,$(1))).dir
$(call gb_ScpPreprocessTarget_get_target,$(1)) :| $(call gb_ScpTarget_get_external_target,$(1))
$(call gb_ScpTarget_get_clean_target,$(1)) : $(call gb_ScpPreprocessTarget_get_clean_target,$(1))
$(call gb_ScpTarget_get_target,$(1)) : SCP_ULF := $(gb_Helper_PHONY)
ifneq ($(gb_FULLDEPS),)
$(call gb_ScpTarget_get_dep_target,$(1)) :| $(dir $(call gb_ScpTarget_get_dep_target,$(1))).dir
endif
endef
define gb_ScpTarget_set_localized
ifneq ($(gb_WITH_LANG),)
$(call gb_ScpMergeTarget_ScpMergeTarget,$(1))
$(call gb_ScpConvertTarget_ScpConvertTarget,$(1),$(call gb_ScpMergeTarget_get_target,$(1)))
$(call gb_ScpTarget_get_clean_target,$(1)) : $(call gb_ScpMergeTarget_get_clean_target,$(1))
else
$(call gb_ScpConvertTarget_ScpConvertTarget,$(1),$(call gb_ScpMergeTarget_get_source,$(1)))
endif
$(call gb_ScpTarget_get_target,$(1)) : $(call gb_ScpConvertTarget_get_target,$(1))
$(call gb_ScpTarget_get_clean_target,$(1)) : $(call gb_ScpConvertTarget_get_clean_target,$(1))
$(call gb_ScpTarget_get_target,$(1)) : SCP_ULF := $(call gb_ScpConvertTarget_get_target,$(1))
endef
# InstallModuleTarget class
# platform:
# gb_InstallModuleTarget_InstallModuleTarget_platform
define gb_InstallModuleTarget__command
$(call gb_Output_announce,$(2),$(true),INM,3)
$(foreach scpfile,$(SCP_FILES),$(call gb_Deliver_deliver,$(scpfile),$(3)/$(notdir $(scpfile))) &&) \
touch $(1)
endef
$(dir $(call gb_InstallModuleTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_InstallModuleTarget_get_target,%) :
$(call gb_InstallModuleTarget__command,$@,$*,$(call gb_InstallModuleTarget_get_workdir,$*))
$(call gb_InstallModuleTarget_get_external_target,%) :
touch $@
.PHONY : $(call gb_InstallModuleTarget_get_clean_target,%)
$(call gb_InstallModuleTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),INM,3)
rm -rf \
$(call gb_InstallModuleTarget_get_workdir,$*) \
$(call gb_InstallModuleTarget_get_target,$*) \
$(call gb_InstallModuleTarget_get_external_target,$*)
define gb_InstallModuleTarget_InstallModuleTarget
$(call gb_InstallModuleTarget_get_target,$(1)) :| \
$(call gb_InstallModuleTarget_get_external_target,$(1)) \
$(call gb_InstallModuleTarget_get_workdir,$(1))/.dir
$(call gb_InstallModuleTarget_get_external_target,$(1)) :| \
$(dir $(call gb_InstallModuleTarget_get_target,$(1))).dir
$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_FILES :=
$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_DEFS :=
$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_INCLUDE :=
$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_TEMPLATE_INCLUDE :=
$(call gb_InstallModuleTarget_InstallModuleTarget_platform,$(1))
endef
define gb_InstallModuleTarget_set_include
$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_INCLUDE := $(2)
endef
define gb_InstallModuleTarget_add_defs
$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_DEFS += $(2)
endef
define gb_InstallModuleTarget_define_if_set
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(foreach def,$(2),$(if $(filter TRUE YES,$($(def))),-D$(def))) \
)
endef
define gb_InstallModuleTarget_define_value_if_set
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(foreach def,$(2),$(if $($(def)),-D$(def)=\""$($(def))"\")) \
)
endef
define gb_InstallModuleTarget_define_mingw_dll_if_set
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(foreach def,$(2),$(if $($(def)),-DNEEDS_$(def) -D$(def)=\""$($(def))"\")) \
)
endef
define gb_InstallModuleTarget_use_package
$(call gb_InstallModuleTarget_get_external_target,$(1)) :| $(call gb_Package_get_target,$(2))
endef
define gb_InstallModuleTarget_use_packages
$(foreach package,$(2),$(call gb_InstallModuleTarget_use_package,$(1),$(package)))
endef
define gb_InstallModuleTarget_add_scpfile
$(call gb_ScpTarget_ScpTarget,$(2))
$(call gb_InstallModuleTarget_get_target,$(1)) : $(call gb_ScpTarget_get_target,$(2))
$(call gb_InstallModuleTarget_get_clean_target,$(1)) : $(call gb_ScpTarget_get_clean_target,$(2))
$(call gb_InstallModuleTarget_get_target,$(1)) : SCP_FILES += $(call gb_ScpTarget_get_target,$(2))
$(call gb_ScpTarget_get_external_target,$(2)) :| $(call gb_InstallModuleTarget_get_external_target,$(1))
endef
define gb_InstallModuleTarget_add_scpfiles
$(foreach scpfile,$(2),$(call gb_InstallModuleTarget_add_scpfile,$(1),$(scpfile)))
endef
define gb_InstallModuleTarget_add_localized_scpfile
$(call gb_InstallModuleTarget_add_scpfile,$(1),$(2))
$(call gb_ScpTarget_set_localized,$(2))
endef
define gb_InstallModuleTarget_add_localized_scpfiles
$(foreach scpfile,$(2),$(call gb_InstallModuleTarget_add_localized_scpfile,$(1),$(scpfile)))
endef
define gb_InstallModuleTarget_add_template
$(call gb_ScpTemplateTarget_ScpTemplateTarget,$(2))
$(call gb_InstallModuleTarget_get_external_target,$(1)) : $(call gb_ScpTemplateTarget_get_target,$(2))
$(call gb_InstallModuleTarget_get_clean_target,$(1)) : $(call gb_ScpTemplateTarget_get_clean_target,$(2))
$(call gb_InstallModuleTarget_get_target,$(1)) : \
SCP_TEMPLATE_INCLUDE := $$(sort $$(SCP_TEMPLATE_INCLUDE) -I$(call gb_ScpTemplateTarget_get_dir,$(2)))
endef
define gb_InstallModuleTarget_add_templates
$(foreach template,$(2),$(call gb_InstallModuleTarget_add_template,$(1),$(template)))
endef
# vim: set shiftwidth=4 tabstop=4 noexpandtab:
+110
View File
@@ -0,0 +1,110 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
# (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
# InstallScriptTarget class
# TODO: make par2script quiet, if necessary
gb_InstallScriptTarget_TARGET := $(SOLARENV)/bin/par2script.pl
gb_InstallScriptTarget_COMMAND := $(PERL) $(gb_InstallScriptTarget_TARGET)
gb_InstallScriptTarget__make_arglist = $(subst $(WHITESPACE),$(COMMA),$(strip $(1)))
define gb_InstallScriptTarget__command
$(call gb_Output_announce,$(2),$(true),INS,4)
$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\
$(call gb_InstallScriptTarget__make_arglist,\
$(notdir $(foreach module,$(SCP_MODULE_DIRS),$(wildcard $(module)/*$(SCP_SUFFIX))))) \
) && \
$(gb_InstallScriptTarget_COMMAND) \
-i $(call gb_InstallScriptTarget__make_arglist,$(SCP_MODULE_DIRS) $(OUTDIR)/par) \
-o $(1) \
@@$${RESPONSEFILE} && \
rm -f $${RESPONSEFILE} \
)
endef
$(dir $(call gb_InstallScriptTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(dir $(call gb_InstallScriptTarget_get_target,%)).dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_InstallScriptTarget_get_target,%) :
$(call gb_InstallScriptTarget__command,$@,$*)
.PHONY : $(call gb_InstallScriptTarget_get_clean_target,%)
$(call gb_InstallScriptTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),INS,4)
rm -f $(call gb_InstallScriptTarget_get_target,$*)
# gb_InstallScriptTarget_InstallScriptTarget(<target>)
define gb_InstallScriptTarget_InstallScriptTarget
$(call gb_InstallScriptTarget_get_target,$(1)) :| $(dir $(call gb_InstallScriptTarget_get_target,$(1))).dir
$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_MODULE_DIRS :=
$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_SUFFIX := $(suffix $(call gb_ScpTarget_get_target,%))
endef
define gb_InstallScriptTarget_use_module
$(call gb_InstallScriptTarget_get_target,$(1)) : $(call gb_InstallModuleTarget_get_target,$(2))
$(call gb_InstallScriptTarget_get_clean_target,$(1)) : $(call gb_InstallModuleTarget_get_clean_target,$(2))
$(call gb_InstallScriptTarget_get_target,$(1)) : SCP_MODULE_DIRS += $(call gb_InstallModuleTarget_get_workdir,$(2))
endef
define gb_InstallScriptTarget_use_modules
$(foreach module,$(2),$(call gb_InstallScriptTarget_use_module,$(1),$(module)))
endef
# InstallScript class
# gb_InstallScript_InstallScript(<target>)
define gb_InstallScript_InstallScript
$(call gb_InstallScriptTarget_InstallScriptTarget,$(1))
$(call gb_InstallScript_get_target,$(1)) : $(call gb_InstallScriptTarget_get_target,$(1))
$(call gb_InstallScript_get_clean_target,$(1)) : $(call gb_InstallScriptTarget_get_clean_target,$(1))
$(call gb_Deliver_add_deliverable,$(call gb_InstallScript_get_target,$(1)),$(call gb_InstallScriptTarget_get_target,$(1)),$(1))
$$(eval $$(call gb_Module_register_target,$(call gb_InstallScript_get_target,$(1)),$(call gb_InstallScript_get_clean_target,$(1))))
endef
define gb_InstallScript_use_module
$(call gb_InstallScriptTarget_use_module,$(1),$(2))
endef
define gb_InstallScript_use_modules
$(call gb_InstallScriptTarget_use_modules,$(1),$(2))
endef
# vim: set shiftwidth=4 tabstop=4 noexpandtab:
+24
View File
@@ -38,11 +38,13 @@ gb_PackagePart_get_destinations = \
$(OUTDIR)/idl \
$(OUTDIR)/inc \
$(OUTDIR)/lib \
$(OUTDIR)/par \
$(OUTDIR)/pck \
$(OUTDIR)/rdb \
$(OUTDIR)/unittest \
$(OUTDIR)/xml \
gb_InstallScript_get_target = $(OUTDIR)/bin/$(1)$(gb_InstallScript_EXT)
gb_InternalUnoApi_get_target = $(OUTDIR)/rdb/$(1).rdb
gb_PackagePart_get_target = $(OUTDIR)/$(1)
gb_Rdb_get_outdir_target = $(OUTDIR)/xml/$(1).rdb
@@ -92,6 +94,11 @@ gb_Extension_get_workdir = $(WORKDIR)/Extension/$(1)
gb_ExternalLib_get_workdir = $(WORKDIR)/ExternalLib/$(1)
gb_ExternalLib_get_builddir = $(WORKDIR)/ExternalLib/$(1)/build
gb_ExternalLib_get_target = $(WORKDIR)/ExternalLib/$(1).done
gb_InstallModule_get_target = $(WORKDIR)/InstallModule/$(1).done
gb_InstallModuleTarget_get_external_target = $(WORKDIR)/InstallModuleTarget/$(1).external
gb_InstallModuleTarget_get_target = $(WORKDIR)/InstallModuleTarget/$(1).done
gb_InstallModuleTarget_get_workdir = $(WORKDIR)/InstallModuleTarget/$(1)
gb_InstallScriptTarget_get_target = $(WORKDIR)/InstallScriptTarget/$(1)$(gb_InstallScript_EXT)
gb_Jar_get_target = $(WORKDIR)/Jar/$(1).jar
gb_Jar_get_classsetname = Jar/$(1)
gb_JavaClassSet_get_classdir = $(WORKDIR)/JavaClassSet/$(1)
@@ -119,6 +126,13 @@ gb_PyunoFile_get_target = $(WORKDIR)/Pyuno/$(1)/contents/$(2)
gb_Rdb_get_target = $(WORKDIR)/Rdb/$(1).rdb
gb_ResTarget_get_imagelist_target = $(WORKDIR)/ResTarget/$(1).ilst
gb_ResTarget_get_target = $(WORKDIR)/ResTarget/$(1).res
gb_ScpConvertTarget_get_target = $(WORKDIR)/ScpConvertTarget/$(1).ulf
gb_ScpMergeTarget_get_target = $(WORKDIR)/ScpMergeTarget/$(1).ulf
gb_ScpPreprocessTarget_get_target = $(WORKDIR)/ScpPreprocessTarget/$(1).pre
gb_ScpTarget_get_external_target = $(WORKDIR)/ScpTarget/$(1).external
gb_ScpTarget_get_target = $(WORKDIR)/ScpTarget/$(1).par
gb_ScpTemplateTarget_get_dir = $(abspath $(WORKDIR)/ScpTemplateTarget/$(dir $(1)))
gb_ScpTemplateTarget_get_target = $(abspath $(WORKDIR)/ScpTemplateTarget/$(dir $(1))$(subst pack,modules,$(subst module_,all,$(notdir $(1)))).inc)
gb_SdiTarget_get_target = $(WORKDIR)/SdiTarget/$(1)
gb_SrsPartMergeTarget_get_target = $(WORKDIR)/SrsPartMergeTarget/$(1)
gb_SrsPartTarget_get_target = $(WORKDIR)/SrsPartTarget/$(1)
@@ -177,6 +191,9 @@ $(eval $(call gb_Helper_make_clean_targets,\
ComponentTarget \
ComponentsTarget \
Extension \
InstallModule \
InstallModuleTarget \
InstallScriptTarget \
JavaClassSet \
Jar \
JunitTest \
@@ -188,6 +205,11 @@ $(eval $(call gb_Helper_make_clean_targets,\
Pyuno \
Rdb \
ResTarget \
ScpConvertTarget \
ScpMergeTarget \
ScpPreprocessTarget \
ScpTarget \
ScpTemplateTarget \
SdiTarget \
SrsTarget \
SrsTemplateTarget \
@@ -211,6 +233,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
$(eval $(call gb_Helper_make_outdir_clean_targets,\
Executable \
InstallScript \
InternalUnoApi \
Library \
StaticLibrary \
@@ -227,6 +250,7 @@ $(eval $(call gb_Helper_make_dep_targets,\
GenCObject \
GenCxxObject \
LinkTarget \
ScpTarget \
SdiTarget \
SrsPartTarget \
SrsTarget \
+3
View File
@@ -321,6 +321,9 @@ include $(foreach class, \
Zip \
Configuration \
Extension \
InstallModuleTarget \
InstallModule \
InstallScript \
,$(GBUILDDIR)/$(class).mk)
# optional extensions that should never be essential
+28
View File
@@ -295,6 +295,34 @@ $(call gb_LinkTarget_get_target,$(2)) : LAYER := NONE
endef
# InstallModuleTarget class
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=gcc3 \
-DCOMNAME=gcc3 \
-D_gcc3 \
$(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \
)
$(call gb_InstallModuleTarget_set_include,$(1),\
-I$(SRCDIR)/scp2/inc \
$(SOLARINC) \
$(SCP_INCLUDE) \
)
endef
# ScpConvertTarget class
gb_ScpConvertTarget_ScpConvertTarget_platform :=
# InstallScript class
gb_InstallScript_EXT := .ins
# Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib
+32
View File
@@ -428,6 +428,38 @@ else
gb_WinResTarget__command_dep =
endif
# InstallModuleTarget class
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=gcc3 \
-DCOMNAME=gcc3 \
-D_gcc3 \
$(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \
)
$(call gb_InstallModuleTarget_set_include,$(1),\
-I$(SRCDIR)/scp2/inc \
$(SOLARINC) \
$(SCP_INCLUDE) \
)
endef
# ScpConvertTarget class
define gb_ScpConvertTarget_ScpConvertTarget_platform
$(call gb_ScpConvertTarget_get_target,$(1)) :| $(OUTDIR)/bin/msi-encodinglist.txt
$(call gb_ScpConvertTarget_get_target,$(1)) : SCP_FLAGS := -t $(OUTDIR)/bin/msi-encodinglist.txt
endef
# InstallScript class
gb_InstallScript_EXT := .inf
# Python
gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(OUTDIR_FOR_BUILD)/bin" PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
+31
View File
@@ -696,6 +696,37 @@ else
gb_WinResTarget__command_dep =
endif
# InstallModuleTarget class
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=MSC \
-DCOMNAME=$(if $(filter INTEL,$(CPUNAME)),msci,mscx) \
$(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \
)
$(call gb_InstallModuleTarget_set_include,$(1),\
-I$(SRCDIR)/scp2/inc \
$(SOLARINC) \
$(SCP_INCLUDE) \
)
endef
# ScpConvertTarget class
define gb_ScpConvertTarget_ScpConvertTarget_platform
$(call gb_ScpConvertTarget_get_target,$(1)) :| $(OUTDIR)/bin/msi-encodinglist.txt
$(call gb_ScpConvertTarget_get_target,$(1)) : SCP_FLAGS := -t $(OUTDIR)/bin/msi-encodinglist.txt
endef
# InstallScript class
gb_InstallScript_EXT := .inf
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
+28
View File
@@ -403,6 +403,34 @@ $(call gb_JunitTest_get_target,$(1)) : DEFS := \
endef
# InstallModuleTarget class
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=gcc3 \
-DCOMNAME=gcc3 \
-D_gcc3 \
$(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \
)
$(call gb_InstallModuleTarget_set_include,$(1),\
-I$(SRCDIR)/scp2/inc \
$(SOLARINC) \
$(SCP_INCLUDE) \
)
endef
# ScpConvertTarget class
gb_ScpConvertTarget_ScpConvertTarget_platform :=
# InstallScript class
gb_InstallScript_EXT := .ins
# Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
+26
View File
@@ -395,6 +395,32 @@ $(SHELL) $${OFFICESCRIPT} && \
rm $${OFFICESCRIPT}
endef
# InstallModuleTarget class
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=C52 \
-DCOMNAME=sunpro5 \
$(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \
)
$(call gb_InstallModuleTarget_set_include,$(1),\
-I$(SRCDIR)/scp2/inc \
$(SOLARINC) \
$(SCP_INCLUDE) \
)
endef
# ScpConvertTarget class
gb_ScpConvertTarget_ScpConvertTarget_platform :=
# InstallScript class
gb_InstallScript_EXT := .ins
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload
+33
View File
@@ -397,6 +397,39 @@ $(SHELL) $${OFFICESCRIPT} && \
rm $${OFFICESCRIPT}
endef
# InstallModuleTarget class
# NOTE: values of SHORTSTDC3 and SHORTSTDCPP3 are hardcoded, because we
# do not really need all the variability of definition that was
# originally in solenv/inc/tg_compv.mk . Each of the macros is only used
# on one place, and only for Linux.
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=gcc3 \
-DCOMNAME=gcc3 \
-DSHORTSTDC3=1 \
-DSHORTSTDCPP3=6 \
-D_gcc3 \
$(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \
)
$(call gb_InstallModuleTarget_set_include,$(1),\
-I$(SRCDIR)/scp2/inc \
$(SOLARINC) \
$(SCP_INCLUDE) \
)
endef
# ScpConvertTarget class
gb_ScpConvertTarget_ScpConvertTarget_platform :=
# InstallScript class
gb_InstallScript_EXT := .ins
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload