annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
1 #
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
2 # Copyright (C) 2014 Guido Berhoerster <guido+relmon@berhoerster.name>
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
3 #
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
4 # Permission is hereby granted, free of charge, to any person obtaining
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
5 # a copy of this software and associated documentation files (the
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
6 # "Software"), to deal in the Software without restriction, including
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
7 # without limitation the rights to use, copy, modify, merge, publish,
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
8 # distribute, sublicense, and/or sell copies of the Software, and to
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
9 # permit persons to whom the Software is furnished to do so, subject to
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
10 # the following conditions:
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
11 #
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
12 # The above copyright notice and this permission notice shall be included
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
13 # in all copies or substantial portions of the Software.
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
14 #
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
22 #
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
23
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
24 PACKAGE = relmon
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
25 VERSION = 1
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
26 DISTNAME := $(PACKAGE)-$(VERSION)
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
27
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
28 INSTALL := install
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
29 INSTALL.exec := $(INSTALL) -D -m 0755
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
30 INSTALL.data := $(INSTALL) -D -m 0644
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
31 PAX := pax
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
32 GZIP := gzip
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
33 SED := sed
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
34 XSLTPROC := xsltproc
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
35 DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
36 TCLSH_PATH := /usr/bin/tclsh
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
37
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
38 define generate-manpage-rule =
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
39 %.$(1): %.$(1).xml
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
40 $$(XSLTPROC) \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
41 --xinclude \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
42 --stringparam package $$(PACKAGE) \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
43 --stringparam version $$(VERSION)\
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
44 docbook-update-source-data.xsl $$< | \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
45 $$(XSLTPROC) \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
46 --xinclude \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
47 $$(DOCBOOK5_MANPAGES_FLAGS) \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
48 --output $$@ \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
49 $$(DOCBOOK5_MANPAGES_STYLESHEET) \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
50 -
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
51 endef
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
52
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
53 DESTDIR ?=
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
54 prefix ?= /usr/local
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
55 bindir ?= $(prefix)/bin
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
56 datadir ?= $(prefix)/share
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
57 mandir ?= $(datadir)/man
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
58
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
59 SCRIPTS = $(PACKAGE).tcl
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
60 MANPAGES = $(PACKAGE).1 $(PACKAGE)_watchlist.4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
61 DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
62 --stringparam man.copyright.section.enabled 0
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
63
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
64 .DEFAULT_TARGET = all
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
65
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
66 .PHONY: all clean clobber dist install
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
67
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
68 all: $(PACKAGE) $(MANPAGES)
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
69
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
70 $(PACKAGE): $(SCRIPTS)
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
71 cp $< $@
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
72
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
73 $(foreach section,1 2 3 4 5 6 7 8 9,$(eval $(call generate-manpage-rule,$(section))))
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
74
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
75 %.tcl: %.tcl.in
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
76 $(SED) -e '1s,#!.*,#!$(TCLSH_PATH),' -e 's,@VERSION@,$(VERSION),' $< \
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
77 > $@
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
78
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
79 install:
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
80 $(INSTALL.exec) $(PACKAGE) "$(DESTDIR)$(bindir)/$(PACKAGE)"
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
81 for manpage in $(MANPAGES); do \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
82 $(INSTALL.data) $${manpage} \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
83 "$(DESTDIR)$(mandir)/man$${manpage##*.}/$${manpage##*/}"; \
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
84 done
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
85
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
86 clean:
4
f28486666a4f Add manpages for relmon and relmon_watchlist
Guido Berhoerster <guido+relmon@berhoerster.name>
parents: 3
diff changeset
87 rm -f $(PACKAGE) $(SCRIPTS) $(MANPAGES)
3
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
88
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
89 clobber: clean
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
90
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
91 dist: clobber
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
92 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
6d87242c537e Add Makefile
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff changeset
93 -s ',\./,$(DISTNAME)/,' . | $(GZIP) > $(DISTNAME).tar.gz