bump product version to 4.1.6.2
[LibreOffice.git] / readlicense_oo / CustomTarget_readme.mk
blob047f36cc630804b4e48c71cfbe5d8ce2f248d1b0
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 $(eval $(call gb_CustomTarget_CustomTarget,readlicense_oo/readme))
12 readlicense_oo_DIR := $(call gb_CustomTarget_get_workdir,readlicense_oo/readme)
14 # gb_WITH_LANG is empty if --with-lang is not set
15 # what we need here is: gb_WITH_LANG_OR_DEFAULT ;-)
16 readlicense_oo_LANGS := en-US $(filter-out en-US,$(gb_WITH_LANG))
18 ifneq ($(OS),WNT)
19 readlicense_oo_READMEs := $(foreach lang,$(readlicense_oo_LANGS),$(readlicense_oo_DIR)/README_$(lang))
20 readlicense_oo_README_PATTERN := $(readlicense_oo_DIR)/README_%
21 else
22 readlicense_oo_READMEs := $(foreach lang,$(readlicense_oo_LANGS),$(readlicense_oo_DIR)/readme_$(lang).txt)
23 readlicense_oo_README_PATTERN := $(readlicense_oo_DIR)/readme_%.txt
24 endif
26 $(call gb_CustomTarget_get_target,readlicense_oo/readme) : $(readlicense_oo_READMEs)
28 ifeq ($(strip $(gb_WITH_LANG)),)
29 readlicense_oo_README_XRM := $(SRCDIR)/readlicense_oo/docs/readme.xrm
30 else
31 readlicense_oo_README_XRM := $(readlicense_oo_DIR)/readme.xrm
33 $(readlicense_oo_DIR)/readme.xrm : \
34 $(SRCDIR)/readlicense_oo/docs/readme.xrm \
35 $(call gb_Executable_get_runtime_dependencies,xrmex) \
36 $(foreach lang,$(filter-out qtz,$(filter-out en-US,$(gb_WITH_LANG))),$(gb_POLOCATION)/$(lang)/readlicense_oo/docs.po) \
37 | $(readlicense_oo_DIR)/.dir
38 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XRM,1)
39 $(call gb_Helper_abbreviate_dirs, \
40 MERGEINPUT=`$(gb_MKTEMP)` && \
41 echo $(foreach lang,$(filter-out qtz,$(filter-out en-US,$(gb_WITH_LANG))),$(gb_POLOCATION)/$(lang)/readlicense_oo/docs.po) > $${MERGEINPUT} && \
42 $(call gb_Executable_get_command,xrmex) \
43 -i $< \
44 -o $@ \
45 -m $${MERGEINPUT} \
46 -l all && \
47 rm -rf $${MERGEINPUT})
49 endif
51 $(readlicense_oo_README_PATTERN) : \
52 $(SRCDIR)/readlicense_oo/docs/readme.xsl \
53 $(readlicense_oo_README_XRM) \
54 | $(readlicense_oo_DIR)/.dir \
55 $(call gb_ExternalExecutable_get_dependencies,xsltproc)
56 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSL,1)
57 $(call gb_Helper_abbreviate_dirs, \
58 $(call gb_ExternalExecutable_get_command,xsltproc) --nonet --novalid -o $@.out \
59 --stringparam com1 $(COM) \
60 --stringparam cp1 $(CPUNAME) \
61 --stringparam gui1 $(GUI) \
62 --stringparam lang1 $(word 2,$(subst _, ,$(basename $(notdir $@)))) \
63 --stringparam os1 $(OS) \
64 --stringparam type text \
65 $< \
66 $(readlicense_oo_README_XRM) && \
67 $(if $(filter WNT,$(OS)) \
68 ,$(gb_AWK) 'sub("$$","\r")' $@.out > $@.tmp && \
69 mv $@.tmp $@ && \
70 rm $@.out \
71 ,mv $@.out $@ \
72 ) \
75 # vim:set shiftwidth=4 tabstop=4 noexpandtab: