Skip to content

Commit

Permalink
Fix manpage makefiles to generate .gz files
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Jan 23, 2012
1 parent 81703c2 commit 8621a8a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
17 changes: 12 additions & 5 deletions docs/en/manpages/man1/Makefile
Expand Up @@ -4,16 +4,23 @@ DIST = ../../dist
MANSFX=1
.SUFFIXES: .1
.PHONY: all
PAGES = *.md

all: roff
all: roff manpages

PAGES = *.md
manpages: $(patsubst %.md,%.1.gz,$(wildcard $(PAGES)))

%.1.gz: %.1
gzip < $< > $@

roff :
%.1: %.md
sed "s/@VERSION@/$(VERSION)/" $*.md | pandoc -s -w man -o $@

roff :
$(ECHO) Generating system man pages
mkdir -p $(DIST)/man/man1
-for f in $(PAGES); do ( sed "s/$${VERSION}/$(VERSION)/" $$f | $(PANDOC) -s -w man -o $(DIST)/man/man1/$${f%.md}.$(MANSFX); ); done

clean :
rm -rf $(DIST)/man/man1

@rm -rf $(DIST)/man/man1
@rm *.gz
16 changes: 12 additions & 4 deletions docs/en/manpages/man5/Makefile
Expand Up @@ -7,13 +7,21 @@ MANSFX=5

PAGES = *.md

all: roff
all: roff manpages

roff :
manpages: $(patsubst %.md,%.5.gz,$(wildcard $(PAGES)))

%.5.gz: %.5
gzip < $< > $@

%.5: %.md
sed "s/@VERSION@/$(VERSION)/" $*.md | pandoc -s -w man -o $@

roff :
$(ECHO) Generating system man pages
mkdir -p $(DIST)/man/man5
-for f in $(PAGES); do ( $(PANDOC) -s -w man $$f -o $(DIST)/man/man5/$${f%.md}.$(MANSFX); ); done

clean :
rm -rf $(DIST)/man/man5

@rm -rf $(DIST)/man/man5
@rm *.gz

0 comments on commit 8621a8a

Please sign in to comment.