Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / solenv / gbuild / AllLangMoTarget.mk
blob63789f768ec09bb6580a1f57011e13091c93ef23
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 # Overview of dependencies and tasks of AllLangMoTarget
22 # target task depends on
23 # AllLangMoTarget nothing MoTarget for all active langs
24 # MoTarget running msgfmt
26 # MoTarget
28 $(call gb_MoTarget_get_clean_target,%) :
29 $(call gb_Output_announce,$*,$(false),RES,2)
30 $(call gb_Helper_abbreviate_dirs,\
31 rm -f \
32 $(call gb_MoTarget_get_target,$*) \
33 $(call gb_MoTarget_get_install_target,$*))
35 #to-do, remove missing .po support when writerfilter .po files exist
36 $(call gb_MoTarget_get_target,%) : \
37 $(gb_Helper_MISCDUMMY) \
38 $(call gb_ExternalExecutable_get_dependencies,python)
39 $(call gb_Output_announce,$*,$(true),MO ,2)
40 $(call gb_Helper_abbreviate_dirs,\
41 mkdir -p $(dir $@) && \
42 if test -e $(gb_POLOCATION)/$(LANGUAGE)/$(POLOCATION)/messages.po; then \
43 $(MSGUNIQ) --force-po $(gb_POLOCATION)/$(LANGUAGE)/$(POLOCATION)/messages.po | $(MSGFMT) - -o $@; \
44 else \
45 echo missing $(gb_POLOCATION)/$(LANGUAGE)/$(POLOCATION)/messages.po && \
46 $(MSGUNIQ) --force-po $(SRCDIR)/solenv/bin/dummy.po | $(MSGFMT) - -o $@; \
47 fi)
49 #$(info $(call gb_MoTarget_get_target,$(1)))
50 define gb_MoTarget_MoTarget
51 $(call gb_MoTarget_get_target,$(1)) : LIBRARY = $(2)
52 $(call gb_MoTarget_get_target,$(1)) : LANGUAGE = $(3)
53 $(call gb_MoTarget_get_target,$(1)) : POLOCATION = $(2)
54 $(call gb_AllLangMoTarget_get_clean_target,$(2)) : $(call gb_MoTarget_get_clean_target,$(1))
56 endef
58 define gb_MoTarget_set_polocation
59 $(call gb_MoTarget_get_target,$(1)) : POLOCATION = $(2)
61 endef
63 # AllLangMoTarget
65 gb_AllLangMoTarget_LANGS := $(filter-out qtz,$(filter-out en-US,$(gb_WITH_LANG)))
67 define gb_AllLangMoTarget_set_langs
68 gb_AllLangMoTarget_LANGS := $(1)
69 endef
71 $(call gb_AllLangMoTarget_get_clean_target,%) :
72 $(call gb_Helper_abbreviate_dirs,\
73 rm -f $(call gb_AllLangMoTarget_get_target,$*))
75 $(call gb_AllLangMoTarget_get_target,%) :
76 $(call gb_Helper_abbreviate_dirs,\
77 mkdir -p $(dir $@) && touch $@)
79 gb_MoTarget_get_install_target = $(INSTROOT)/$(LIBO_SHARE_RESOURCE_FOLDER)/$(1).mo
81 define gb_AllLangMoTarget_AllLangMoTarget
82 ifeq (,$$(filter $(1),$$(gb_AllLangMoTarget_REGISTERED)))
83 $$(eval $$(call gb_Output_info,Currently known AllLangMoTargets are: $(sort $(gb_AllLangMoTarget_REGISTERED)),ALL))
84 $$(eval $$(call gb_Output_error,AllLangMoTarget $(1) must be registered in Repository.mk))
85 endif
86 $(foreach lang,$(gb_AllLangMoTarget_LANGS),\
87 $(call gb_MoTarget_MoTarget,$(1)$(lang),$(1),$(lang)))
89 $(foreach lang,$(gb_AllLangMoTarget_LANGS),\
90 $(call gb_Helper_install,$(call gb_AllLangMoTarget_get_target,$(1)), \
91 $(call gb_MoTarget_get_install_target,$(shell $(SRCDIR)/solenv/bin/localestr $(lang))/LC_MESSAGES/$(1)), \
92 $(call gb_MoTarget_get_target,$(1)$(lang))))
94 $$(eval $$(call gb_Module_register_target,$(call gb_AllLangMoTarget_get_target,$(1)),$(call gb_AllLangMoTarget_get_clean_target,$(1))))
95 $(call gb_Helper_make_userfriendly_targets,$(1),AllLangMoTarget)
96 $(call gb_Postprocess_register_target,AllResources,AllLangMoTarget,$(1))
98 endef
100 define gb_AllLangMoTarget_set_polocation
101 $(foreach lang,$(gb_AllLangMoTarget_LANGS),\
102 $(call gb_MoTarget_set_polocation,$(1)$(lang),$(2)))
104 endef
106 # vim: set noet sw=4: