aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-10-04 10:15:26 -0700
committerJohn MacFarlane <[email protected]>2022-10-04 10:17:33 -0700
commit11ec70cfeb3c6ce34fe6f7daf6dca4d75426764f (patch)
treeab5d485b7ec5493cb76ce4b0126b4dcc4b370940 /Makefile
parente33d61dff99e500cb63b2a1ed63cc0041ce37a21 (diff)
Better 'make moduledeps' target.
ROOT can now be multiple modules, and the complete transitive dependencies of all of them will be printed. make moduledeps ROOT="Text.Pandoc.Class Text.Pandoc.Parsing"
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 9 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 99b5bdde6..97d7928be 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ COMMIT=$(shell git rev-parse --short HEAD)
TIMESTAMP=$(shell date "+%Y%m%d_%H%M")
LATESTBENCH=$(word 1,$(shell ls -t bench_*.csv 2>/dev/null))
BASELINE?=$(LATESTBENCH)
-ROOTNODE?=T.P
+ROOT?=Text.Pandoc
ifeq ($(BASELINE),)
BASELINECMD=
else
@@ -176,19 +176,18 @@ modules.csv: $(PANDOCSOURCEFILES)
modules.dot: modules.csv
@echo "digraph G {" > $@
@echo "overlap=\"scale\"" >> $@
- @sed -e 's/\([^,]*\),\(.*\)/ "\1" -> "\2";/' $< \
- | sed -e 's/Text\.Pandoc/T.P/g' \
- >> $@
+ @sed -e 's/\([^,]*\),\(.*\)/ "\1" -> "\2";/' $< >> $@
@echo "}" >> $@
-# To get the module dependencies of T.P.Parsing:
-# make modules.pdf ROOTNODE=T.P.Parsing
+# To get the module dependencies of Text.Pandoc.Parsing:
+# make modules.pdf ROOT=Text.Pandoc.Parsing
modules.pdf: modules.dot
- gvpr -f tools/cliptree.gvpr -a '"$(ROOTNODE)"' $< | dot -Tpdf > $@
+ gvpr -f tools/cliptree.gvpr -a '"$(ROOT)"' $< | dot -Tpdf > $@
-# make moduledeps ROOTNODE=T.P.Parsing
-moduledeps: modules.dot ## Print dependencies of a module ROOTNODE
- gvpr -f tools/depthfirst.gvpr -a '"$(ROOTNODE)"' modules.dot
+# make moduledeps ROOT=Text.Pandoc.Parsing
+moduledeps: modules.csv ## Print transitive dependencies of a module ROOT
+ @echo "$(ROOT)"
+ @lua tools/moduledeps.lua transitive $(ROOT) | sort
.PHONY: moduledeps
clean: ## clean up