diff options
author | EuAndreh <eu@euandre.org> | 2023-04-01 22:25:46 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-04-01 22:26:11 -0300 |
commit | 76e1a0925fde2cbf25b75409cd353e20b9cfef48 (patch) | |
tree | cc6c3bd8ec0b182011377a20ace0b10f55fd86b5 /aux/dev.mk | |
parent | Revamp CI: simpler variant of the same functionality (diff) | |
download | remembering-76e1a0925fde2cbf25b75409cd353e20b9cfef48.tar.gz remembering-76e1a0925fde2cbf25b75409cd353e20b9cfef48.tar.xz |
Revamp code under aux/
Diffstat (limited to 'aux/dev.mk')
-rw-r--r-- | aux/dev.mk | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/aux/dev.mk b/aux/dev.mk new file mode 100644 index 0000000..8433a49 --- /dev/null +++ b/aux/dev.mk @@ -0,0 +1,101 @@ +.POSIX: + +.SUFFIXES: +.SUFFIXES: .in .md .html + +.in: + sed \ + -e "s:@TLD@:`cat aux/tld.txt`:g" \ + -e "s:@NAME@:`basename $$PWD`:g" \ + -e 's:@MAILING_LIST@:$(MAILING_LIST):g' \ + < $< > $@ + +.in.html: + pandoc -s -r man -w html \ + -H aux/headers.html \ + --metadata lang="`echo $< | awk -F. '{ print $$(NF-2) }'`" \ + < $(<D)/`basename $(<F) .in` > $@ + +.md.html: + pandoc -s -r commonmark -w html \ + -H aux/headers.html \ + --metadata lang="`echo $(<F) | cut -d. -f2`" \ + --metadata title="`basename $$PWD` - `echo $(<F) | cut -d. -f1`" \ + --toc --toc-depth=2 \ + --highlight-style pygments \ + < $< > $@ + +manpages.html = $(manpages.in:.in=.html) + +md_files.html = $(md_files:.md=.html) + +public: manpages.sentinel public/makefile.svg po4a.cfg md.sentinel \ + public/index.html public/ci public/TODOs.html public/style.css \ + public/favicon.svg + touch $@ + +public/index.html: + mkdir -p $(@D) + ln -rs public/en/index.html $@ + +public/ci: + sh aux/ci/report.sh -n `basename "$$PWD"` -o $@ + +public/TODOs.html: TODOs.md aux/preamble-md + mkdir -p $(@D) + td -H | cat aux/preamble-md - | pandoc -s -r commonmark -w html \ + -H aux/headers.html \ + --metadata lang=en \ + --metadata title="`basename $$PWD` - TODOs" \ + --toc --toc-depth=2 \ + --highlight-style pygments \ + > $@ + +public/favicon.svg: aux/favicon.svg + mkdir -p $(@D) + cp aux/favicon.svg $@ + +public/style.css: + mkdir -p $(@D) + td -S > $@ + +md.sentinel: $(md_files.html) + mkdir -p public + sh aux/ext2subdir.sh -o public $? + for d in public/*/; do ln -rfs public/style.css $$d/style.css; done + touch $@ + +manpages.sentinel: $(manpages.html) + mkdir -p public + sh aux/ext2subdir.sh -o public $? + touch $@ + +public/makefile.svg: Makefile + mkdir -p $(@D) + LANG=en.UTF-8 make -Bnd dev | make2graph | dot -Tsvg >$@ + +po4a.cfg: $(en_files) po + sh aux/po4a-cfg.sh -f '$(en_files) aux/checks/manpages/footer.en.0.in' > $@ + + +test-files = \ + aux/checks/changelog.sh \ + aux/checks/manpages.sh \ + aux/checks/readme.sh \ + aux/checks/shellcheck.sh \ + aux/checks/spelling.sh \ + aux/checks/todos.sh \ + aux/checks/repo.sh \ + +$(test-files): ALWAYS manfooter.sentinel + env MAILING_LIST='$(MAILING_LIST)' sh $@ + +aux/checks/assert-manpages.sh: manfooter.sentinel + +manfooter.sentinel: + for f in aux/checks/manpages/*.in; do $(MAKE) -f aux/dev.mk "$${f%.in}"; done + touch $@ + +check: $(test-files) + +ALWAYS: |