summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-06-28 16:49:45 +0530
committerArun Isaac2021-06-28 17:04:28 +0530
commit5c19b1f0a67a0bb737c87a374f6e1cd0fb51e1f0 (patch)
treebdc0985a57b64d83ceba32e9f392507448de57dc
parent3d9954a73564e1e7d8296c50971f3e5c63bf3a02 (diff)
downloadccwl-5c19b1f0a67a0bb737c87a374f6e1cd0fb51e1f0.tar.gz
ccwl-5c19b1f0a67a0bb737c87a374f6e1cd0fb51e1f0.tar.lz
ccwl-5c19b1f0a67a0bb737c87a374f6e1cd0fb51e1f0.zip
Makefile: Build workflow images.
* configure.ac: Search for cwltool, dot and sed. * Makefile.am (DOC_IMAGES): New variable. ($(SKRIBILO_BUILD_DIR)/%.cwl, %.dot, %.svg): New rules. ($(SKRIBILO_BUILD_DIR)/ccwl.info): Depend on $(DOC_IMAGES). ($(SKRIBILO_BUILD_DIR)/ccwl.html): Depend on $(DOC_IMAGES). Build HTML into a directory. Copy $(DOC_IMAGES) into that directory.
-rw-r--r--Makefile.am26
-rw-r--r--configure.ac3
2 files changed, 23 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index d7c0823..b23a302 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,6 +66,19 @@ EXTRA_DIST += \
# Build documentation
SKRIBILO_BUILD_DIR = $(srcdir)/doc/skribilo
+DOC_IMAGES = $(addprefix $(SKRIBILO_BUILD_DIR)/,)
+
+$(SKRIBILO_BUILD_DIR)/%.cwl: doc/%.scm
+ $(MKDIR_P) $(SKRIBILO_BUILD_DIR)
+ $(AM_V_GEN)$(top_builddir)/pre-inst-env ccwl compile $< > $@
+
+# Print out graph for graphviz's dot, but remove file path prefix from
+# workflow step identifiers.
+%.dot: %.cwl
+ $(CWLTOOL) --print-dot $< | $(SED) 's/file:[^#]*#//g' > $@
+
+%.svg: %.dot
+ $(DOT) -Tsvg -o$@ $<
# The info and html targets depend on the info-local and html-local
# targets respectively. So, we use them to extend the info and html
@@ -73,13 +86,15 @@ SKRIBILO_BUILD_DIR = $(srcdir)/doc/skribilo
info-local: $(SKRIBILO_BUILD_DIR)/ccwl.info
html-local: $(SKRIBILO_BUILD_DIR)/ccwl.html
-$(SKRIBILO_BUILD_DIR)/ccwl.info: doc/ccwl.skb ccwl/skribilo.scm
+$(SKRIBILO_BUILD_DIR)/ccwl.info: doc/ccwl.skb ccwl/skribilo.scm $(DOC_IMAGES)
$(MKDIR_P) $(SKRIBILO_BUILD_DIR)
$(AM_V_GEN)$(top_builddir)/pre-inst-env $(SKRIBILO) -t info $< -o $@
-$(SKRIBILO_BUILD_DIR)/ccwl.html: doc/ccwl.skb ccwl/skribilo.scm
- $(MKDIR_P) $(SKRIBILO_BUILD_DIR)
- $(AM_V_GEN)$(top_builddir)/pre-inst-env $(SKRIBILO) -t html $< -o $@
+$(SKRIBILO_BUILD_DIR)/ccwl.html: doc/ccwl.skb ccwl/skribilo.scm $(DOC_IMAGES)
+ rm -rf $@
+ $(MKDIR_P) $@
+ $(AM_V_GEN)$(top_builddir)/pre-inst-env $(SKRIBILO) -t html $< -o $@/index.html
+ cp -vr $(DOC_IMAGES) $@
install-data-local: install-info-local
@@ -104,8 +119,7 @@ website/index.html: README.org
website/manual/dev/en: $(SKRIBILO_BUILD_DIR)/ccwl.html
rm -rf $@
- $(MKDIR_P) $@
- cp -v $< $@/index.html
+ cp -vr $< $@
# The clean target depends on clean-local. We use clean-local to clean
# up the website and the skribilo build directory.
diff --git a/configure.ac b/configure.ac
index d75c699..e40d794 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,9 @@ AM_SILENT_RULES([yes])
GUILE_PKG([3.0 2.2])
GUILE_PROGS
+AC_PROG_SED
+AC_PATH_PROG([DOT], [dot])
+AC_PATH_PROG([CWLTOOL], [cwltool])
AC_PATH_PROG([EMACS], [emacs])
AC_PATH_PROG([SKRIBILO], [skribilo])