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 $(call gb_Trace_StartRange
,officecfg_qa_allheaders.hxx
,CAT
)
27 ifeq ($(HAVE_GNUMAKE_FILE_FUNC
),)
28 mkdir
-p
$(dir $@
) && \
30 $(foreach file
,$(officecfg_XCSFILES
),\
31 && echo
"#include <officecfg/$(file).hxx>" >> $@
)
33 mv
$(call var2file
,$(shell mkdir
-p
$(dir $@
) && cat
/dev
/null
>$@.tmp
&& echo
$@.tmp
),100,$(foreach file
,$(officecfg_XCSFILES
),$(call officecfg_geninclude
,$(file
)))) $@
35 $(call gb_Trace_EndRange
,officecfg_qa_allheaders.hxx
,CAT
)
37 # pass the stem as space separated path elements and get a set of --stringparam ns<level> <element> in return
38 officecfg_xsltparams
=$(if
$(filter-out $(lastword
$1),$1),$(call officecfg_xsltparams
,$(filter-out $(lastword
$1),$1))) --stringparam ns
$(words $1) $(lastword
$1)
40 $(call gb_CustomTarget_get_workdir
,officecfg
/registry
)/officecfg
/%.hxx
: \
41 $(SRCDIR
)/officecfg
/registry
/schema
/org
/openoffice
/%.xcs \
42 $(SRCDIR
)/officecfg
/registry
/cppheader.xsl\
43 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
)
44 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),XSL
,1)
45 $(call gb_Trace_StartRange
,$(subst $(WORKDIR
)/,,$@
),XSL
)
46 $(call gb_Helper_abbreviate_dirs
, \
47 mkdir
-p
$(dir $@
) && \
48 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
$(call officecfg_xsltparams
,$(subst /, ,$*)) \
49 -o
$@
$(SRCDIR
)/officecfg
/registry
/cppheader.xsl
$<)
50 $(call gb_Trace_EndRange
,$(subst $(WORKDIR
)/,,$@
),XSL
)
52 # vim: set noet sw=4 ts=4: