about summary refs log tree commit diff
path: root/Makefile.am
diff options
context:
space:
mode:
authorArun Isaac2021-08-16 18:21:30 +0530
committerArun Isaac2021-08-16 18:31:12 +0530
commit4b898a0a437f7d0c58e3766202a48c2c2d5f70d2 (patch)
tree3f616bf66f4ba1ef32ca320242cf4c612f1e1ae9 /Makefile.am
parent4ed386f3b6b3763d8acc07074d41ed508814328e (diff)
downloadccwl-4b898a0a437f7d0c58e3766202a48c2c2d5f70d2.tar.gz
ccwl-4b898a0a437f7d0c58e3766202a48c2c2d5f70d2.tar.lz
ccwl-4b898a0a437f7d0c58e3766202a48c2c2d5f70d2.zip
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.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am32
1 files changed, 30 insertions, 2 deletions
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 $@