nss: upgrade to release 3.73
[LibreOffice.git] / solenv / gbuild / AllLangMoTarget.mk
blobe1fbdc732f7c2b1d52f1502aa1b8b36b7d70f233
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_Trace_StartRange,$*,MO )
41 $(call gb_Helper_abbreviate_dirs,\
42 mkdir -p $(dir $@) && \
43 if test -e $(gb_POLOCATION)/$(LANGUAGE)/$(POLOCATION)/messages.po; then \
44 $(MSGUNIQ) --force-po $(gb_POLOCATION)/$(LANGUAGE)/$(POLOCATION)/messages.po | $(MSGFMT) - -o $@; \
45 else \
46 echo missing $(gb_POLOCATION)/$(LANGUAGE)/$(POLOCATION)/messages.po && \
47 $(MSGUNIQ) --force-po $(SRCDIR)/solenv/bin/dummy.po | $(MSGFMT) - -o $@; \
48 fi)
49 $(call gb_Trace_EndRange,$*,MO )
51 #$(info $(call gb_MoTarget_get_target,$(1)))
52 define gb_MoTarget_MoTarget
53 $(call gb_MoTarget_get_target,$(1)) : LIBRARY = $(2)
54 $(call gb_MoTarget_get_target,$(1)) : LANGUAGE = $(3)
55 $(call gb_MoTarget_get_target,$(1)) : POLOCATION = $(2)
56 $(call gb_AllLangMoTarget_get_clean_target,$(2)) : $(call gb_MoTarget_get_clean_target,$(1))
58 endef
60 define gb_MoTarget_set_polocation
61 $(call gb_MoTarget_get_target,$(1)) : POLOCATION = $(2)
63 endef
65 # AllLangMoTarget
67 gb_AllLangMoTarget_LANGS := $(filter-out qtz,$(filter-out en-US,$(gb_WITH_LANG)))
69 define gb_AllLangMoTarget_set_langs
70 gb_AllLangMoTarget_LANGS := $(1)
71 endef
73 $(call gb_AllLangMoTarget_get_clean_target,%) :
74 $(call gb_Helper_abbreviate_dirs,\
75 rm -f $(call gb_AllLangMoTarget_get_target,$*))
77 $(call gb_AllLangMoTarget_get_target,%) :
78 $(call gb_Helper_abbreviate_dirs,\
79 mkdir -p $(dir $@) && touch $@)
81 gb_MoTarget_get_install_target = $(INSTROOT)/$(LIBO_SHARE_RESOURCE_FOLDER)/$(1).mo
83 define gb_AllLangMoTarget_AllLangMoTarget
84 ifeq (,$$(filter $(1),$$(gb_AllLangMoTarget_REGISTERED)))
85 $$(eval $$(call gb_Output_info,Currently known AllLangMoTargets are: $(sort $(gb_AllLangMoTarget_REGISTERED)),ALL))
86 $$(eval $$(call gb_Output_error,AllLangMoTarget $(1) must be registered in Repository.mk))
87 endif
88 $(foreach lang,$(gb_AllLangMoTarget_LANGS),\
89 $(call gb_MoTarget_MoTarget,$(1)$(lang),$(1),$(lang)))
91 $(foreach lang,$(gb_AllLangMoTarget_LANGS),\
92 $(call gb_Helper_install,$(call gb_AllLangMoTarget_get_target,$(1)), \
93 $(call gb_MoTarget_get_install_target,$(shell $(SRCDIR)/solenv/bin/localestr $(lang))/LC_MESSAGES/$(1)), \
94 $(call gb_MoTarget_get_target,$(1)$(lang))))
96 $$(eval $$(call gb_Module_register_target,$(call gb_AllLangMoTarget_get_target,$(1)),$(call gb_AllLangMoTarget_get_clean_target,$(1))))
97 $(call gb_Helper_make_userfriendly_targets,$(1),AllLangMoTarget)
98 $(call gb_Postprocess_register_target,AllResources,AllLangMoTarget,$(1))
100 endef
102 define gb_AllLangMoTarget_set_polocation
103 $(foreach lang,$(gb_AllLangMoTarget_LANGS),\
104 $(call gb_MoTarget_set_polocation,$(1)$(lang),$(2)))
106 endef
108 # vim: set noet sw=4: