aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-10-04 09:11:01 -0700
committerJohn MacFarlane <[email protected]>2022-10-04 10:17:33 -0700
commite33d61dff99e500cb63b2a1ed63cc0041ce37a21 (patch)
tree35c812f6f5ee4e498e4c6892034a9b802d2e503a /Makefile
parent6ad05b74514f23a023718e199e7ef3c0509e99b2 (diff)
Makefile: add modules.csv target.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index f46ff4090..99b5bdde6 100644
--- a/Makefile
+++ b/Makefile
@@ -163,17 +163,22 @@ update-website: ## update website and upload
make -C $(WEBSITE) upload
.PHONY: update-website
-modules.dot: $(PANDOCSOURCEFILES)
- @echo "digraph G {" > $@
- @echo "overlap=\"scale\"" >> $@
+modules.csv: $(PANDOCSOURCEFILES)
@rg '^import.*Text\.Pandoc\.' --with-filename $^ \
| rg -v 'Text\.Pandoc\.(Definition|Builder|Walk|Generic)' \
| sort \
| uniq \
| sed -e 's/src\///' \
| sed -e 's/\//\./g' \
- | sed -e 's/\.hs:import *\(qualified *\)*\([^ ]*\).*/ -> \2/' \
- | sed -e 's/Text\.Pandoc\([^ ]*\)/"T\.P\1"/g' >> $@
+ | sed -e 's/\.hs:import *\(qualified *\)*\([^ ]*\).*/,\2/' \
+ > $@
+
+modules.dot: modules.csv
+ @echo "digraph G {" > $@
+ @echo "overlap=\"scale\"" >> $@
+ @sed -e 's/\([^,]*\),\(.*\)/ "\1" -> "\2";/' $< \
+ | sed -e 's/Text\.Pandoc/T.P/g' \
+ >> $@
@echo "}" >> $@
# To get the module dependencies of T.P.Parsing: