aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-03-03 18:26:00 +0100
committerTeddy Wing2018-03-03 18:26:00 +0100
commit517f9c6ec992212576aaef7b510486650dd99f50 (patch)
tree74ced33a5744c9225233b86f051a06e0b664acde
parentaf1720c73402fbac95ce05a03acf153fdbf404b3 (diff)
downloadPassextract-517f9c6ec992212576aaef7b510486650dd99f50.tar.bz2
Makefile: Clean up man page bold literal transformation
Instead of the messy variables we were using, which caused `passextract.1.txt.tmp` and `passextract.1` files to be generated at the root of the project, create a few new targets to do the "`"` to "*" transformation and build the man page from a temporary file.
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ec9e50a..1248d57 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,14 @@
-MAN_PAGE := doc/passextract.1.txt
-TRANSFORMED_MAN_PAGE := $(patsubst %,%.tmp,$(MAN_PAGE))
+TRANSFORMED_MAN_PAGE := doc/passextract.1.transformed
-doc/passextract.1: doc/passextract.1.txt
- sed 's/`/*/g' $< > $(TRANSFORMED_MAN_PAGE) && \
- a2x --no-xmllint --format manpage $(TRANSFORMED_MAN_PAGE) && \
+$(TRANSFORMED_MAN_PAGE): doc/passextract.1.txt
+ sed 's/`/*/g' $< > $@
+
+clean_transformed:
rm $(TRANSFORMED_MAN_PAGE)
+
+doc/passextract.1: $(TRANSFORMED_MAN_PAGE)
+ a2x --no-xmllint --format manpage $<
+
+doc: doc/passextract.1 clean_transformed
+
+.PHONY: clean_transformed doc