3
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
1 #
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
2 # Copyright (C) 2014 Guido Berhoerster <guido+relmon@berhoerster.name>
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
3 #
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
4 # Permission is hereby granted, free of charge, to any person obtaining
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
5 # a copy of this software and associated documentation files (the
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
6 # "Software"), to deal in the Software without restriction, including
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
7 # without limitation the rights to use, copy, modify, merge, publish,
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
8 # distribute, sublicense, and/or sell copies of the Software, and to
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
9 # permit persons to whom the Software is furnished to do so, subject to
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
10 # the following conditions:
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
11 #
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
12 # The above copyright notice and this permission notice shall be included
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
13 # in all copies or substantial portions of the Software.
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
14 #
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
22 #
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
23
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
24 PACKAGE = relmon
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
25 VERSION = 1
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
26 DISTNAME := $(PACKAGE)-$(VERSION)
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
27
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
28 INSTALL := install
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
29 INSTALL.exec := $(INSTALL) -D -m 0755
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
30 INSTALL.data := $(INSTALL) -D -m 0644
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
31 PAX := pax
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
32 GZIP := gzip
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
33 SED := sed
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
34 TCLSH_PATH := /usr/bin/tclsh
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
35
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
36 DESTDIR ?=
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
37 prefix ?= /usr/local
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
38 bindir ?= $(prefix)/bin
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
39
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
40 SCRIPTS = $(PACKAGE).tcl
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
41
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
42 .DEFAULT_TARGET = all
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
43
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
44 .PHONY: all clean clobber dist install
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
45
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
46 all: $(PACKAGE)
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
47
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
48 $(PACKAGE): $(SCRIPTS)
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
49 cp $< $@
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
50
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
51 %.tcl: %.tcl.in
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
52 $(SED) -e '1s,#!.*,#!$(TCLSH_PATH),' -e 's,@VERSION@,$(VERSION),' $< \
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
53 > $@
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
54
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
55 install:
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
56 $(INSTALL.exec) $(PACKAGE) "$(DESTDIR)$(bindir)/$(PACKAGE)"
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
57
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
58 clean:
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
59 rm -f $(PACKAGE) $(SCRIPTS)
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
60
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
61 clobber: clean
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
62
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
63 dist: clobber
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
64 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
|
Guido Berhoerster <guido+relmon@berhoerster.name>
parents:
diff
changeset
|
65 -s ',\./,$(DISTNAME)/,' . | $(GZIP) > $(DISTNAME).tar.gz
|