begin real clean manpage solution
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
ca139aa444
commit
042638943a
1 changed files with 18 additions and 9 deletions
27
Makefile
27
Makefile
|
@ -16,7 +16,10 @@ WEBPAGE=$(WEBBASE).mdwn
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
MANDIR=doc/man
|
MANDIR=doc/man
|
||||||
HTMLDIR=$(MANDIR)/html
|
|
||||||
|
MAN1DSTDIR=$(MANDIR)/man1
|
||||||
|
MAN7DSTDIR=$(MANDIR)/man7
|
||||||
|
MANHTMLDIR=$(MANDIR)/html
|
||||||
|
|
||||||
MAN1SRC= \
|
MAN1SRC= \
|
||||||
$(MANDIR)/cdist-code-run.text \
|
$(MANDIR)/cdist-code-run.text \
|
||||||
|
@ -47,12 +50,14 @@ MAN7SRC=$(MANDIR)/cdist.text \
|
||||||
$(MANDIR)/cdist-reference.text \
|
$(MANDIR)/cdist-reference.text \
|
||||||
$(MANDIR)/cdist-stages.text \
|
$(MANDIR)/cdist-stages.text \
|
||||||
$(MANDIR)/cdist-type.text \
|
$(MANDIR)/cdist-type.text \
|
||||||
$(shell ls conf/type/*/man.text)
|
|
||||||
|
MAN7TYPESRC=$(shell ls conf/type/*/man.text)
|
||||||
|
|
||||||
MAN1DST=$(MAN1SRC:.text=.1)
|
MAN1DST=$(MAN1SRC:.text=.1)
|
||||||
MAN7DST=$(MAN7SRC:.text=.7)
|
MAN7DST=$(MAN7SRC:.text=.7)
|
||||||
MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html)
|
MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html)
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# User targets
|
# User targets
|
||||||
#
|
#
|
||||||
|
@ -69,11 +74,15 @@ all:
|
||||||
@echo ''
|
@echo ''
|
||||||
|
|
||||||
|
|
||||||
%.1 %.7: %.text
|
$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR):
|
||||||
|
mkdir -p $<
|
||||||
|
|
||||||
|
%.1 %.7: %.text $(MAN1DSTDIR) $(MAN7DSTDIR)
|
||||||
$(A2XM) $*.text
|
$(A2XM) $*.text
|
||||||
|
|
||||||
%.html: %.text
|
%.html: %.text
|
||||||
$(A2XH) $*.text
|
$(A2XH) -o $(MANHTMLDIR)/$(@F) $<
|
||||||
|
#$(A2XH) -o $(MANHTMLDIR)/$(@F) $*.text
|
||||||
|
|
||||||
man: $(MAN1DST) $(MAN7DST)
|
man: $(MAN1DST) $(MAN7DST)
|
||||||
|
|
||||||
|
@ -91,11 +100,11 @@ manmove: $(MAN1DST) $(MAN7DST) $(MANHTML)
|
||||||
done
|
done
|
||||||
|
|
||||||
# HTML
|
# HTML
|
||||||
mkdir -p $(HTMLDIR)
|
mkdir -p $(MANHTMLDIR)
|
||||||
mv doc/man/*.html $(HTMLDIR)
|
mv doc/man/*.html $(MANHTMLDIR)
|
||||||
for mantype in conf/type/*/man.html; do \
|
for mantype in conf/type/*/man.html; do \
|
||||||
mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\
|
mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\
|
||||||
mv $$mantype $(HTMLDIR)/$$mannew; \
|
mv $$mantype $(MANHTMLDIR)/$$mannew; \
|
||||||
done
|
done
|
||||||
|
|
||||||
# Reference depends on conf/type/*/man.text - HOWTO with posix make?
|
# Reference depends on conf/type/*/man.text - HOWTO with posix make?
|
||||||
|
@ -107,7 +116,7 @@ $(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh
|
||||||
clean:
|
clean:
|
||||||
rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9]
|
rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9]
|
||||||
rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text
|
rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text
|
||||||
rm -rf $(HTMLDIR)
|
rm -rf $(MANHTMLDIR)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Developer targets
|
# Developer targets
|
||||||
|
@ -124,7 +133,7 @@ test:
|
||||||
web: manmove
|
web: manmove
|
||||||
cp README $(WEBDIR)/$(WEBPAGE)
|
cp README $(WEBDIR)/$(WEBPAGE)
|
||||||
rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man
|
rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man
|
||||||
cp -r $(HTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man
|
cp -r $(MANHTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man
|
||||||
cd $(WEBDIR) && git add $(WEBBASE)/man
|
cd $(WEBDIR) && git add $(WEBBASE)/man
|
||||||
cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE)
|
cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE)
|
||||||
cd $(WEBDIR) && make pub
|
cd $(WEBDIR) && make pub
|
||||||
|
|
Loading…
Reference in a new issue