Staging
v0.5.0
https://foss.heptapod.net/mercurial/hgview
Raw File
Tip revision: a1825f7e11a87e9df5ac4d59325e94a8c03cba66 authored by Philippe Pepiot on 15 May 2018, 10:05:41 UTC
[pkg] 1.10.2
Tip revision: a1825f7
Makefile
SOURCES=hgview.1.txt
#$(wildcard *.[0-9].txt)
MAN=$(SOURCES:%.txt=%)
HTML=$(SOURCES:%.txt=%.html)
PREFIX=/usr/local
MANDIR=$(PREFIX)/man
INSTALL=install -c

all: man html

man: $(MAN)

html: $(HTML)

%: %.xml
	xmlto man $*.xml

%.xml: %.txt
	asciidoc -d manpage -b docbook -o $@ $<

%.html: %.txt
	asciidoc -b html4 -o $@ $< || asciidoc -b html -o $@ $<

install: man
	for i in $(MAN) ; do \
	  subdir=`echo $$i | sed -n 's/..*\.\([0-9]\)$$/man\1/p'` ; \
	  $(INSTALL) -d $(DESTDIR)$(MANDIR)/$$subdir && \
	  $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \
	done

clean:
	$(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html)
back to top