Makefile target to get module dependeny subgraphs.

E.g. what depends on Text.Pandoc.Parsing?

    make modules.pdf ROOTNODE=T.P.Parsing

This is helpful for figuring out what we can split out as separate
packages.
This commit is contained in:
John MacFarlane
2022-10-01 12:34:27 -07:00
parent c51eeea4c7
commit 20f82b0a8b
2 changed files with 21 additions and 1 deletions
+4 -1
View File
@@ -8,6 +8,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
ifeq ($(BASELINE),)
BASELINECMD=
else
@@ -174,8 +175,10 @@ modules.dot: $(SOURCEFILES)
| sed -e 's/Text\.Pandoc\([^ ]*\)/"T\.P\1"/g' >> $@
@echo "}" >> $@
# To get the module dependencies of T.P.Parsing:
# make modules.pdf ROOTNODE=T.P.Parsing
modules.pdf: modules.dot
cat $< | dot -Tpdf > $@
gvpr -f tools/cliptree.gvpr -a '"$(ROOTNODE)"' $< | dot -Tpdf > $@
clean: ## clean up
cabal clean
+17
View File
@@ -0,0 +1,17 @@
/* Construct subgraph reachable from node ARGV[0] by forward edges */
BEG_G {
node_t r = node($,ARGV[0]);
$tvroot = r;
$tvtype = TV_fwd;
//print ("// Staring node: ", r.name);
}
N{
print ("// subgraph node: ", $.name);
$tvroot=NULL;
subnode($T,$);
}
E{
print ("// subgraph edge: ", $.name);
subedge($T,$);
}