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 $(call gb_CustomTarget_get_target
,readlicense_oo
/readme
) : \
19 $(foreach lang
,$(readlicense_oo_LANGS
),$(readlicense_oo_DIR
)/$(call gb_README
,$(lang
)))
21 ifeq ($(strip $(gb_WITH_LANG
)),)
22 readlicense_oo_README_XRM
:= $(SRCDIR
)/readlicense_oo
/docs
/readme.xrm
24 readlicense_oo_README_XRM
:= $(readlicense_oo_DIR
)/readme.xrm
26 $(readlicense_oo_DIR
)/readme.xrm
: \
27 $(SRCDIR
)/readlicense_oo
/docs
/readme.xrm \
28 $(call gb_Executable_get_runtime_dependencies
,xrmex
) \
29 $(foreach lang
,$(filter-out qtz
,$(filter-out en-US
,$(gb_WITH_LANG
))),$(gb_POLOCATION
)/$(lang
)/readlicense_oo
/docs.po
) \
30 |
$(readlicense_oo_DIR
)/.
dir
31 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),XRM
,1)
32 $(call gb_Helper_abbreviate_dirs
, \
33 MERGEINPUT
=`$(gb_MKTEMP)` && \
34 echo
$(foreach lang
,$(filter-out qtz
,$(filter-out en-US
,$(gb_WITH_LANG
))),$(gb_POLOCATION
)/$(lang
)/readlicense_oo
/docs.po
) > $${MERGEINPUT} && \
35 $(call gb_Executable_get_command
,xrmex
) \
40 rm -rf
$${MERGEINPUT})
44 readlicense_oo_README_SED
:= \
45 -e
's,$${PRODUCTNAME},$(PRODUCTNAME),g' \
46 -e
's,$${PRODUCTVERSION},$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR),g' \
48 $(readlicense_oo_DIR
)/$(call gb_README
,%) : \
49 $(SRCDIR
)/readlicense_oo
/docs
/readme.xsl \
50 $(readlicense_oo_README_XRM
) \
51 |
$(readlicense_oo_DIR
)/.
dir \
52 $(call gb_ExternalExecutable_get_dependencies
,xsltproc
)
53 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),XSL
,1)
54 $(call gb_Helper_abbreviate_dirs
, \
55 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
--novalid
-o
$@.out \
56 --stringparam com1
$(COM
) \
57 --stringparam cp1
$(CPUNAME
) \
58 --stringparam lang1
$(word 2,$(subst _
, ,$(basename $(notdir $@
)))) \
59 --stringparam os1
$(OS
) \
60 --stringparam type text \
62 $(readlicense_oo_README_XRM
) \
63 $(if
$(filter WNT
,$(OS
)), \
64 && $(gb_AWK
) 'sub("$$","\r")' $@.out
> $@.tmp \
67 && sed
$(readlicense_oo_README_SED
) $@.out
> $@ \
71 # vim:set shiftwidth=4 tabstop=4 noexpandtab: