diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-04-21 07:20:43 +0200 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-06-29 16:54:29 +0200 |
commit | 7e0014607513fc335f96baf9408cdeb6d29c1375 (patch) | |
tree | d1daed29b458d90136658dbce8e55e6cab3e4220 /Makefile-tools.am | |
parent | af97f472b16ceef6c33b8fd6b9f36eef0e60c7cb (diff) | |
download | gobject-introspection-7e0014607513fc335f96baf9408cdeb6d29c1375.tar.gz |
tools: use a template to generate the tools scripts
g-ir-annotation-tool, g-ir-doc-tool and g-ir-scanner where identical
except for the module and function being invoked.
Avoid code duplication and generate these from a common template.
Diffstat (limited to 'Makefile-tools.am')
-rw-r--r-- | Makefile-tools.am | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Makefile-tools.am b/Makefile-tools.am index 34d2a255..dbd264c3 100644 --- a/Makefile-tools.am +++ b/Makefile-tools.am @@ -6,22 +6,20 @@ bin_SCRIPTS += g-ir-doc-tool endif EXTRA_DIST += \ - tools/g-ir-scanner.in \ - tools/g-ir-annotation-tool.in \ - tools/g-ir-doc-tool.in + tools/g-ir-tool-template.in -TOOL_SUBSTITUTIONS = sed -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON), +TOOL_SUBSTITUTIONS = -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON), -g-ir-scanner: tools/g-ir-scanner.in _giscanner.la Makefile - $(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@ +g-ir-scanner: tools/g-ir-tool-template.in _giscanner.la Makefile + $(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,scannermain, -e s,@TOOL_FUNCTION\@,scanner_main, $< > $@.tmp && mv $@.tmp $@ @chmod a+x $@ -g-ir-annotation-tool: tools/g-ir-annotation-tool.in _giscanner.la Makefile - $(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@ +g-ir-annotation-tool: tools/g-ir-tool-template.in _giscanner.la Makefile + $(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,annotationmain, -e s,@TOOL_FUNCTION\@,annotation_main, $< > $@.tmp && mv $@.tmp $@ @chmod a+x $@ -g-ir-doc-tool: tools/g-ir-doc-tool.in _giscanner.la Makefile - $(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@ +g-ir-doc-tool: tools/g-ir-tool-template.in _giscanner.la Makefile + $(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,docmain, -e s,@TOOL_FUNCTION\@,doc_main, $< > $@.tmp && mv $@.tmp $@ @chmod a+x $@ g_ir_compiler_SOURCES = tools/compiler.c |