Makefile: add moduledeps target.

make moduledeps ROOTNODE=T.P.Parsing
This commit is contained in:
John MacFarlane
2022-10-01 12:46:30 -07:00
parent 20f82b0a8b
commit 89e7e9b636
2 changed files with 23 additions and 0 deletions
+5
View File
@@ -180,6 +180,11 @@ modules.dot: $(SOURCEFILES)
modules.pdf: modules.dot
gvpr -f tools/cliptree.gvpr -a '"$(ROOTNODE)"' $< | 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
.PHONY: moduledeps
clean: ## clean up
cabal clean
.PHONY: clean
+18
View File
@@ -0,0 +1,18 @@
BEGIN {
int i, indent;
int seen[string];
void prInd (int cnt) {
for (i = 0; i < cnt; i++) printf (" "); }
}
BEG_G {
$tvtype = TV_prepostfwd; $tvroot = node($,ARGV[0]);
} N{
if (seen[$.name]) {
indent--;
if (indent == 0) exit(0);
} else {
prInd(indent); print ($.name);
seen[$.name] = 1;
indent++;
}
}