From 4b898a0a437f7d0c58e3766202a48c2c2d5f70d2 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 16 Aug 2021 18:21:30 +0530 Subject: Makefile: Generate sample output when building documentation. * Makefile.am (CLEANFILES): Add doc/*.out. (CLEAN_DIRECTORIES): Add doc/cwl-output. (GENERATE_CWL_OUTPUT): New variable. (doc/capture-output-file.out, doc/capture-output-file-with-parameter-reference.out, doc/capture-stdout.out, doc/checksum.out, doc/decompress-compile-run.out, doc/hello-world.out, doc/pass-stdin.out, doc/hello.tar.out): New targets. * doc/capture-output-file-with-parameter-reference.out, doc/capture-output-file.out, doc/capture-stdout.out, doc/checksum.out, doc/decompress-compile-run.out, doc/hello-world.out, doc/hello.tar.out, doc/pass-stdin.out: Delete files. * build-aux/generate-cwl-output.sh.in, doc/hello.c.gz, doc/hello.tar, doc/hello.txt: New files. * configure.ac: Configure build-aux/generate-cwl-output.sh. * doc/ccwl.skb (Tutorial)[Passing input into the standard input stream of a command]: Replace file "foo" with "hello.txt". * .gitignore: Add build-aux/generate-cwl-output.sh, doc/*.out and doc/cwl-output. --- Makefile.am | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index f96a43e..b53ac21 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,11 +95,39 @@ EXTRA_DIST += \ include .depends -CLEANFILES += doc/*.cwl doc/*.dot doc/*.png +CLEANFILES += doc/*.cwl doc/*.dot doc/*.out doc/*.png +CLEAN_DIRECTORIES = doc/cwl-output %.cwl: %.scm $(CCWL_GEN)$(builddir)/pre-inst-env ccwl compile $< > $@ +GENERATE_CWL_OUTPUT = ./build-aux/generate-cwl-output.sh + +doc/capture-output-file.out: doc/capture-output-file.cwl doc/hello.tar $(GENERATE_CWL_OUTPUT) + $(CWLTOOL_GEN)$(GENERATE_CWL_OUTPUT) $< --archive hello.tar + +doc/capture-output-file-with-parameter-reference.out: doc/capture-output-file-with-parameter-reference.cwl doc/hello.tar $(GENERATE_CWL_OUTPUT) + $(CWLTOOL_GEN)$(GENERATE_CWL_OUTPUT) $< --archive hello.tar --extractfile hello.txt + +doc/capture-stdout.out: doc/capture-stdout.cwl $(GENERATE_CWL_OUTPUT) + $(CWLTOOL_GEN)$(GENERATE_CWL_OUTPUT) $< --message '"Hello World!"' + +doc/checksum.out: doc/checksum.cwl doc/hello.txt $(GENERATE_CWL_OUTPUT) + $(CWLTOOL_GEN)$(GENERATE_CWL_OUTPUT) $< --file hello.txt + +doc/decompress-compile-run.out: doc/decompress-compile-run.cwl doc/hello.c.gz $(GENERATE_CWL_OUTPUT) + $(CWLTOOL_GEN)$(GENERATE_CWL_OUTPUT) $< --compressed-source hello.c.gz + +doc/hello-world.out: doc/hello-world.cwl $(GENERATE_CWL_OUTPUT) + $(CWLTOOL_GEN)$(GENERATE_CWL_OUTPUT) $< --message '"Hello World!"' + +doc/pass-stdin.out: doc/pass-stdin.cwl doc/hello.txt $(GENERATE_CWL_OUTPUT) + $(CWLTOOL_GEN)$(GENERATE_CWL_OUTPUT) $< --file hello.txt + +doc/hello.tar.out: doc/hello.tar + echo "$$ tar --list --file $(notdir $<)" > $@ + tar --list --file $< >> $@ + # Print out graph for graphviz's dot, but remove file path prefix from # workflow step identifiers. %.dot: %.cwl @@ -116,7 +144,7 @@ html-local: doc/ccwl.html SKRIBILO_FLAGS = --source-path=$(srcdir) --image-path=$(builddir) CLEANFILES += doc/ccwl.info doc/skribilo.go -CLEAN_DIRECTORIES = doc/ccwl.html +CLEAN_DIRECTORIES += doc/ccwl.html doc/ccwl.info: doc/ccwl.skb doc/skribilo.go $(DOC_IMAGES) $(DOC_OTHER) $(SKRIBILO_GEN)$(builddir)/pre-inst-env $(SKRIBILO) $(SKRIBILO_FLAGS) -t info $< -o $@ -- cgit 1.4.1