This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.in
167 lines (130 loc) · 3.93 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# The default target...
all::
NAME = @PACKAGE_NAME@
TARNAME = @PACKAGE_TARNAME@
VERSION = @PACKAGE_VERSION@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
docdir = $(datadir)/doc/$(TARNAME)
export prefix exec_prefix bindir libexecdir libdir mandir datadir docdir
SHELL = /bin/sh
SHELL_PATH = /bin/sh
RM = rm -f
TAR = tar
INSTALL = @INSTALL@
INSTALL_DIR = $(INSTALL) -d -m 755
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
SED = @SED@
PERL = @PERL@
SSH = @SSH@
AUTOSSH = @AUTOSSH@
# ---- END OF CONFIGURATION ----
# These are all currently installed to $(bindir) but the hem-XXX scripts will
# probably move to a libexec directory, eventually.
SCRIPT_SH = hem-bounce.sh hem-down.sh \
hem-info.sh hem-init.sh hem-list.sh \
hem-manage.sh hem-push-keys.sh hem-sh-setup.sh \
hem-status.sh hem-up.sh
PROGRAM_SH = hem.sh
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
PROGRAMS = $(patsubst %.sh,%,$(PROGRAM_SH))
SRCS = $(SCRIPT_SH) $(PROGRAM_SH)
AUX = Makefile.in configure configure.ac work-sh test-sh install-sh
DOCFILES = README INSTALL COPYING
all:: $(SCRIPTS) $(PROGRAMS)
# Build all hem-XXX scripts by substituting build time variables and
#
$(SCRIPTS) $(PROGRAMS): % : %.sh
$(RM) $@ $@+ && \
$(SED) -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
-e 's|@@HEM_VERSION@@|$(VERSION)|g' \
-e 's|@@HEM_EXEC_DIR@@|$(libexecdir)|g' \
$@.sh >$@+ && \
chmod +x $@+ && \
chmod -w $@+ && \
mv $@+ $@ && \
$(SHELL_PATH) -n $@
# ---- INSTALL TARGETS ----
install: all
$(INSTALL_DIR) '$(DESTDIR)$(libexecdir)'
$(INSTALL_PROGRAM) $(SCRIPTS) '$(DESTDIR)$(libexecdir)'
$(INSTALL_DIR) '$(DESTDIR)$(bindir)'
$(INSTALL_PROGRAM) $(PROGRAMS) '$(DESTDIR)$(bindir)'
$(INSTALL_DIR) '$(DESTDIR)$(docdir)'
$(INSTALL_DATA) $(DOCFILES) '$(DESTDIR)$(docdir)'
$(MAKE) -C doc install-man
uninstall:
$(RM) $(foreach f,$(SCRIPTS),$(DESTDIR)$(libexecdir)/$(f)) \
$(foreach f,$(PROGRAMS),$(DESTDIR)$(bindir)/$(f)) \
$(foreach f,$(DOCFILES),$(DESTDIR)$(docdir)/$(f))
-rmdir $(DESTDIR)/$(docdir)
# ---- PACKAGING AND DIST TARGETS ----
DISTNAME = $(TARNAME)-$(VERSION)
MANSRC = doc/hem.1.txt \
doc/hem_config.5.txt \
doc/asciidoc.conf \
doc/Makefile.in
MANMAN = doc/hem.1 \
doc/hem_config.5
$(DISTNAME).tar.gz: $(SRCS) $(DOCFILES) $(AUX) manpages
-rm -rf $(DISTNAME)
-mkdir $(DISTNAME)
ln $(SRCS) $(DOCFILES) $(AUX) $(DISTNAME)
mkdir $(DISTNAME)/doc
ln $(MANSRC) $(MANMAN) $(DISTNAME)/doc
$(TAR) cf $(DISTNAME).tar $(DISTNAME)
gzip -n -9 -f $(DISTNAME).tar
rm -rf $(DISTNAME)
$(DISTNAME).cksums: $(DISTNAME).tar.gz
cksums $(DISTNAME).tar.gz > $@
dist: $(DISTNAME).tar.gz $(DISTNAME).cksums
release: $(DISTNAME).tar.gz $(DISTNAME).cksums
ssh tomayko.com "mkdir -p /dist/hem"
rsync -aP $(DISTNAME).tar.gz $(DISTNAME).cksums \
tomayko.com:/dist/hem/
# ---- TESTING ----
test.out: $(SCRIPTS) $(PROGRAMS) test-sh
sh test-sh
test: test.out
# ---- DOCS ----
doc:
$(MAKE) -C doc all
sitedoc:
$(MAKE) -C doc html
manpages:
$(MAKE) -C doc man
publish:
$(MAKE) -C doc publish
# ---- MISC TARGETS ----
# make all repeatedly (useful for development)
auto:
@while true ; do \
$(MAKE) -s test | grep -v 'Nothing to be done' ; \
sleep 1 ; \
done
clean:
$(RM) $(SCRIPTS)
$(RM) $(PROGRAMS)
$(RM) $(patsubst %.sh,%+,$(SCRIPT_SH))
$(RM) test.out test.stdout test.stderr
$(RM) -r test
$(MAKE) -C doc clean
test -f autossh/Makefile && $(MAKE) -C autossh clean || true
pristine: clean
$(MAKE) -C doc pristine
test -f autossh/Makefile && $(MAKE) -C autossh distclean || true
$(RM) $(TARNAME)-*.tar.gz $(TARNAME)-*.cksums
$(RM) Makefile doc/Makefile
$(RM) config.status config.log config.cache conf*.file
$(RM) -r autom4te.cache conf*.dir
.PHONY : all clean pristine dist install uninstall auto test doc
FORCE:
.SUFFIXES:
# vim: set ts=8