From 517f9c6ec992212576aaef7b510486650dd99f50 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 3 Mar 2018 18:26:00 +0100 Subject: 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. --- Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3