summaryrefslogtreecommitdiff
path: root/graph/graph.mk
diff options
context:
space:
mode:
Diffstat (limited to 'graph/graph.mk')
-rw-r--r--graph/graph.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/graph/graph.mk b/graph/graph.mk
new file mode 100644
index 00000000..1d5eb95a
--- /dev/null
+++ b/graph/graph.mk
@@ -0,0 +1,11 @@
+# Include after defining chapter source variables. Works in linearized checkouts too.
+GRAPH_DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+graph_javas := $(wildcard $(GRAPH_DIR)/src/main/java/com/seaofnodes/graph/*.java)
+main_javas += $(graph_javas)
+
+# Defining view here must not change the chapter's default target.
+graph_goal := $(.DEFAULT_GOAL)
+.PHONY: view
+view: build
+ java -ea -cp "$(CLZDIR)/main" com.seaofnodes.simple.print.SimpleGraphObserver
+.DEFAULT_GOAL := $(graph_goal)