1 # SPDX-FileCopyrightText: 2022 Frank Doepper
3 # SPDX-License-Identifier: GPL-3.0-only
8 build: konsum.1 agitprop.1 arbeite.1 plane.1
10 doc: konsum.md agitprop.md arbeite.md plane.md
12 callbacks.readme: callbacks.md
13 tail -n +7 $^ | perl -pe 's/^(?=# ENV)/##/' > $@
15 footer.readme: footer.md
18 %.readme: %.head %.options %.rest
19 tail -n +15 $*.head | perl -ne 'if(s/^# NAME/## /){chomp;print;next;} next if /^# (SYNOPSIS|DESCRIPTION)/; s/^#/###/; print' > $@
20 perl -pe 's/^#/###/' $*.options >> $@
21 tail -n +6 $*.rest | perl -pe 's/^#/###/' >> $@
23 ../README.md: header.md konsum.readme agitprop.readme plane.readme arbeite.readme callbacks.readme footer.readme
27 konsum.md arbeite.md: EXTRA = callbacks.md
28 %.md: %.head %.options %.rest
32 pandoc -s $< -f markdown -t man -o $@
34 %.options: ../dist/build/%
35 ../dist/build/$*/$* --help 2>&1 | perl -ne 'print " $$_" if /^Options/../^\(/' | head -n-1 | tail +2 > $@
38 rm -f *.options *.readme *.1
40 install: konsum.1 agitprop.1 arbeite.1 plane.1
41 install -d -m755 $(DESTDIR)$(pfx)/share/man/man1
42 install -m644 $^ $(DESTDIR)$(pfx)/share/man/man1/