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
))
19 readlicense_oo_READMEs
:= $(foreach lang
,$(readlicense_oo_LANGS
),$(readlicense_oo_DIR
)/README_
$(lang
))
20 readlicense_oo_README_PATTERN
:= $(readlicense_oo_DIR
)/README_
%
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
26 readlicense_XRMEXTARGET
:= $(call gb_Executable_get_target_for_build
,xrmex
)
27 readlicense_XRMEXCOMMAND
:= $(gb_Helper_set_ld_path
) $(readlicense_XRMEXTARGET
)
29 $(call gb_CustomTarget_get_target
,readlicense_oo
/readme
) : $(readlicense_oo_READMEs
)
31 ifeq ($(strip $(gb_WITH_LANG
)),)
32 readlicense_oo_README_XRM
:= $(SRCDIR
)/readlicense_oo
/docs
/readme.xrm
34 readlicense_oo_README_XRM
:= $(readlicense_oo_DIR
)/readme.xrm
36 $(readlicense_oo_DIR
)/readme.xrm
: \
37 $(SRCDIR
)/readlicense_oo
/docs
/readme.xrm \
38 $(readlicense_XRMEXTARGET
) \
39 $(foreach lang
,$(filter-out qtz
,$(filter-out en-US
,$(gb_WITH_LANG
))),$(gb_POLOCATION
)/$(lang
)/readlicense_oo
/docs.po
) \
40 |
$(readlicense_oo_DIR
)/.
dir
41 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),XRM
,1)
42 $(call gb_Helper_abbreviate_dirs
, \
43 MERGEINPUT
=`$(gb_MKTEMP)` && \
44 echo
$(foreach lang
,$(filter-out qtz
,$(filter-out en-US
,$(gb_WITH_LANG
))),$(gb_POLOCATION
)/$(lang
)/readlicense_oo
/docs.po
) > $${MERGEINPUT} && \
45 $(readlicense_XRMEXCOMMAND
) \
51 rm -rf
$${MERGEINPUT})
55 $(readlicense_oo_README_PATTERN
) : \
56 $(SRCDIR
)/readlicense_oo
/docs
/readme.xsl \
57 $(readlicense_oo_README_XRM
) \
58 |
$(readlicense_oo_DIR
)/.
dir \
59 $(call gb_ExternalExecutable_get_dependencies
,xsltproc
)
60 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),XSL
,1)
61 $(call gb_Helper_abbreviate_dirs
, \
62 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
--novalid
-o
$@.out \
63 --stringparam com1
$(COM
) \
64 --stringparam cp1
$(CPUNAME
) \
65 --stringparam gui1
$(GUI
) \
66 --stringparam lang1
$(word 2,$(subst _
, ,$(basename $(notdir $@
)))) \
67 --stringparam os1
$(OS
) \
68 --stringparam type text \
70 $(readlicense_oo_README_XRM
) && \
71 $(if
$(filter WNT
,$(GUI
)) \
72 ,$(gb_AWK
) 'sub("$$","\r")' $@.out
> $@.tmp
&& \
79 # vim:set shiftwidth=4 tabstop=4 noexpandtab: