Mercurial > projects > relmon
annotate Makefile @ 8:a886a736c766
Improve README file
Add build instructions.
Add information on bug reporting.
Add contact information.
author | Guido Berhoerster <guido+relmon@berhoerster.name> |
---|---|
date | Fri, 23 Jan 2015 11:05:36 +0100 |
parents | f28486666a4f |
children | 4ecf1408f04f |
rev | line source |
---|---|
3 | 1 # |
2 # Copyright (C) 2014 Guido Berhoerster <guido+relmon@berhoerster.name> | |
3 # | |
4 # Permission is hereby granted, free of charge, to any person obtaining | |
5 # a copy of this software and associated documentation files (the | |
6 # "Software"), to deal in the Software without restriction, including | |
7 # without limitation the rights to use, copy, modify, merge, publish, | |
8 # distribute, sublicense, and/or sell copies of the Software, and to | |
9 # permit persons to whom the Software is furnished to do so, subject to | |
10 # the following conditions: | |
11 # | |
12 # The above copyright notice and this permission notice shall be included | |
13 # in all copies or substantial portions of the Software. | |
14 # | |
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | |
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
22 # | |
23 | |
24 PACKAGE = relmon | |
25 VERSION = 1 | |
26 DISTNAME := $(PACKAGE)-$(VERSION) | |
27 | |
28 INSTALL := install | |
29 INSTALL.exec := $(INSTALL) -D -m 0755 | |
30 INSTALL.data := $(INSTALL) -D -m 0644 | |
31 PAX := pax | |
32 GZIP := gzip | |
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 | 36 TCLSH_PATH := /usr/bin/tclsh |
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 | 53 DESTDIR ?= |
54 prefix ?= /usr/local | |
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 | 58 |
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 | 63 |
64 .DEFAULT_TARGET = all | |
65 | |
66 .PHONY: all clean clobber dist install | |
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 | 69 |
70 $(PACKAGE): $(SCRIPTS) | |
71 cp $< $@ | |
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 | 75 %.tcl: %.tcl.in |
76 $(SED) -e '1s,#!.*,#!$(TCLSH_PATH),' -e 's,@VERSION@,$(VERSION),' $< \ | |
77 > $@ | |
78 | |
79 install: | |
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 | 85 |
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 | 88 |
89 clobber: clean | |
90 | |
91 dist: clobber | |
92 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \ | |
93 -s ',\./,$(DISTNAME)/,' . | $(GZIP) > $(DISTNAME).tar.gz |