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
,officecfg
/registry
))
12 $(call gb_CustomTarget_get_target
,officecfg
/registry
) : \
13 $(foreach i
,officecfg_qa_allheaders
$(officecfg_XCSFILES
),\
14 $(call gb_CustomTarget_get_workdir
,officecfg
/registry
)/officecfg
/$(i
).hxx
)
16 # via define so it can end with a newline
17 define officecfg_geninclude
18 #include <officecfg/$(1).hxx>
22 # auto generated header file for unit test qa/cppheader.cxx
23 $(call gb_CustomTarget_get_workdir
,officecfg
/registry
)/officecfg
/officecfg_qa_allheaders.hxx
: \
24 $(SRCDIR
)/officecfg
/files.mk
25 $(call gb_Output_announce
,officecfg_qa_allheaders.hxx
,$(true
),CAT
,1)
26 ifeq ($(HAVE_GNUMAKE_FILE_FUNC
),)
27 mkdir
-p
$(dir $@
) && \
29 $(foreach file
,$(officecfg_XCSFILES
),\
30 && echo
"#include <officecfg/$(file).hxx>" >> $@
)
32 mv
$(call var2file
,$(shell mkdir
-p
$(dir $@
) && cat
/dev
/null
>$@.tmp
&& echo
$@.tmp
),100,$(foreach file
,$(officecfg_XCSFILES
),$(call officecfg_geninclude
,$(file
)))) $@
35 # pass the stem as space separated path elements and get a set of --stringparam ns<level> <element> in return
36 officecfg_xsltparams
=$(if
$(filter-out $(lastword
$1),$1),$(call officecfg_xsltparams
,$(filter-out $(lastword
$1),$1))) --stringparam ns
$(words $1) $(lastword
$1)
38 $(call gb_CustomTarget_get_workdir
,officecfg
/registry
)/officecfg
/%.hxx
: \
39 $(SRCDIR
)/officecfg
/registry
/schema
/org
/openoffice
/%.xcs \
40 $(SRCDIR
)/officecfg
/registry
/cppheader.xsl\
41 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
)
42 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),XSL
,1)
43 $(call gb_Helper_abbreviate_dirs
, \
44 mkdir
-p
$(dir $@
) && \
45 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
$(call officecfg_xsltparams
,$(subst /, ,$*)) \
46 -o
$@
$(SRCDIR
)/officecfg
/registry
/cppheader.xsl
$<)
48 # vim: set noet sw=4 ts=4: