Mercurial > projects > relmon
comparison Makefile @ 4:f28486666a4f
Add manpages for relmon and relmon_watchlist
author | Guido Berhoerster <guido+relmon@berhoerster.name> |
---|---|
date | Fri, 24 Oct 2014 22:44:39 +0200 |
parents | 6d87242c537e |
children | 4ecf1408f04f |
comparison
equal
deleted
inserted
replaced
3:6d87242c537e | 4:f28486666a4f |
---|---|
29 INSTALL.exec := $(INSTALL) -D -m 0755 | 29 INSTALL.exec := $(INSTALL) -D -m 0755 |
30 INSTALL.data := $(INSTALL) -D -m 0644 | 30 INSTALL.data := $(INSTALL) -D -m 0644 |
31 PAX := pax | 31 PAX := pax |
32 GZIP := gzip | 32 GZIP := gzip |
33 SED := sed | 33 SED := sed |
34 XSLTPROC := xsltproc | |
35 DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl | |
34 TCLSH_PATH := /usr/bin/tclsh | 36 TCLSH_PATH := /usr/bin/tclsh |
37 | |
38 define generate-manpage-rule = | |
39 %.$(1): %.$(1).xml | |
40 $$(XSLTPROC) \ | |
41 --xinclude \ | |
42 --stringparam package $$(PACKAGE) \ | |
43 --stringparam version $$(VERSION)\ | |
44 docbook-update-source-data.xsl $$< | \ | |
45 $$(XSLTPROC) \ | |
46 --xinclude \ | |
47 $$(DOCBOOK5_MANPAGES_FLAGS) \ | |
48 --output $$@ \ | |
49 $$(DOCBOOK5_MANPAGES_STYLESHEET) \ | |
50 - | |
51 endef | |
35 | 52 |
36 DESTDIR ?= | 53 DESTDIR ?= |
37 prefix ?= /usr/local | 54 prefix ?= /usr/local |
38 bindir ?= $(prefix)/bin | 55 bindir ?= $(prefix)/bin |
56 datadir ?= $(prefix)/share | |
57 mandir ?= $(datadir)/man | |
39 | 58 |
40 SCRIPTS = $(PACKAGE).tcl | 59 SCRIPTS = $(PACKAGE).tcl |
60 MANPAGES = $(PACKAGE).1 $(PACKAGE)_watchlist.4 | |
61 DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \ | |
62 --stringparam man.copyright.section.enabled 0 | |
41 | 63 |
42 .DEFAULT_TARGET = all | 64 .DEFAULT_TARGET = all |
43 | 65 |
44 .PHONY: all clean clobber dist install | 66 .PHONY: all clean clobber dist install |
45 | 67 |
46 all: $(PACKAGE) | 68 all: $(PACKAGE) $(MANPAGES) |
47 | 69 |
48 $(PACKAGE): $(SCRIPTS) | 70 $(PACKAGE): $(SCRIPTS) |
49 cp $< $@ | 71 cp $< $@ |
72 | |
73 $(foreach section,1 2 3 4 5 6 7 8 9,$(eval $(call generate-manpage-rule,$(section)))) | |
50 | 74 |
51 %.tcl: %.tcl.in | 75 %.tcl: %.tcl.in |
52 $(SED) -e '1s,#!.*,#!$(TCLSH_PATH),' -e 's,@VERSION@,$(VERSION),' $< \ | 76 $(SED) -e '1s,#!.*,#!$(TCLSH_PATH),' -e 's,@VERSION@,$(VERSION),' $< \ |
53 > $@ | 77 > $@ |
54 | 78 |
55 install: | 79 install: |
56 $(INSTALL.exec) $(PACKAGE) "$(DESTDIR)$(bindir)/$(PACKAGE)" | 80 $(INSTALL.exec) $(PACKAGE) "$(DESTDIR)$(bindir)/$(PACKAGE)" |
81 for manpage in $(MANPAGES); do \ | |
82 $(INSTALL.data) $${manpage} \ | |
83 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \ | |
84 done | |
57 | 85 |
58 clean: | 86 clean: |
59 rm -f $(PACKAGE) $(SCRIPTS) | 87 rm -f $(PACKAGE) $(SCRIPTS) $(MANPAGES) |
60 | 88 |
61 clobber: clean | 89 clobber: clean |
62 | 90 |
63 dist: clobber | 91 dist: clobber |
64 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \ | 92 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \ |