-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile.am
248 lines (204 loc) · 5.73 KB
/
Makefile.am
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# QuickNX makefile
# - Indent with tabs only.
# - Keep files sorted; one line per file.
# - Directories in lib/ must have their own *dir variable.
# - All directories must be listed in DIRS.
# - Use autogen.sh to generate Makefile.in and configure script.
# Automake doesn't export these variables before version 1.10.
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ACLOCAL_AMFLAGS = -I autotools
REPLACE_VARS_SED = autotools/replace_vars.sed
GEN_LOG_WRAPPER = $(top_srcdir)/autotools/gen-log-wrapper
appdir = $(pkgpythondir)/app
docdir = $(datadir)/doc/$(PACKAGE)
AM_CFLAGS = -Wall -Werror -DPKGLIBDIR=\"$(pkglibdir)\"
DIRS = \
autotools \
doc \
extras \
lib \
lib/app \
src \
test \
test/python
CLEANFILES = \
stamp-directories \
extras/upload \
lib/*.py[co] \
lib/app/*.py[co] \
test/python/*.py[co] \
$(REPLACE_VARS_SED) \
$(nodist_pkgpython_PYTHON) \
$(PYTHON_BOOTSTRAP) \
$(LOG_WRAPPER)
DISTCLEANFILES = \
$(dochtml)
CLEANDIRS = \
doc/api
nodist_pkgpython_PYTHON = \
lib/_autoconf.py
pkgpython_PYTHON = \
lib/__init__.py \
lib/agent.py \
lib/auth.py \
lib/cli.py \
lib/config.py \
lib/constants.py \
lib/daemon.py \
lib/errors.py \
lib/node.py \
lib/protocol.py \
lib/serializer.py \
lib/session.py \
lib/utils.py
app_PYTHON = \
lib/app/__init__.py \
lib/app/nxdialog.py \
lib/app/nxnode.py \
lib/app/nxserver.py \
lib/app/nxserver_login.py
dist_pkglib_SCRIPTS = \
src/ttysetup
nodist_pkglib_SCRIPTS = \
$(LOG_WRAPPER) \
$(PYTHON_BOOTSTRAP)
pkglib_PROGRAMS = \
src/fdcopy
dist_pkgdata_DATA = \
extras/authorized_keys.nomachine
docrst = \
doc/design.rst
dochtml = $(patsubst %.rst,%.html,$(docrst))
doc_DATA = $(dochtml)
dist_doc_DATA = \
doc/quicknx.conf.example \
doc/processes.txt
PYTHON_BOOTSTRAP = \
src/nxdialog \
src/nxnode \
src/nxserver \
src/nxserver-login
LOG_WRAPPER = \
src/nxnode-wrapper \
src/nxserver-login-wrapper
EXTRA_DIST = \
pylintrc \
autotools/gen-log-wrapper \
doc/DEVNOTES \
extras/upload.in \
extras/rpm/quicknx.spec \
$(docrst) \
$(dist_TESTS) \
$(TEST_FILES)
TEST_FILES = \
test/python/mocks.py
dist_TESTS = \
test/python/quicknx.app.nxserver_login_test.py \
test/python/quicknx.app.nxserver_test.py \
test/python/quicknx.auth_test.py \
test/python/quicknx.daemon_test.py \
test/python/quicknx.protocol_test.py \
test/python/quicknx.session_test.py \
test/python/quicknx.utils_test.py
nodist_TESTS =
TESTS = $(dist_TESTS) $(nodist_TESTS)
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
all-local: stamp-directories lib/_autoconf.py extras/upload
clean-local:
-test -z "$(CLEANDIRS)" || rm -rf $(CLEANDIRS)
extras/upload: extras/upload.in stamp-directories $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod u+x $@
$(TESTS): quicknx srclinks lib/_autoconf.py src/fdcopy src/ttysetup
doc/%.html: doc/%.rst
@if test -z "$(RST2HTML)"; then \
echo "rst2html not found during configure, can't build docs"; \
exit 1; \
else \
$(RST2HTML) $< $@; \
fi
lib/_autoconf.py: Makefile stamp-directories
set -e; \
{ echo '# This file is automatically generated, do not edit!'; \
echo '#'; \
echo ''; \
echo '"""Build-time configuration.'; \
echo '';\
echo 'This file is autogenerated by the build process.'; \
echo 'For any changes you need to re-run ./configure and'; \
echo 'not edit by hand.'; \
echo ''; \
echo '"""'; \
echo ''; \
echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
echo "VERSION_FULL = '$(VERSION_FULL)'"; \
echo "LOCALSTATEDIR = '$(localstatedir)'"; \
echo "SYSCONFDIR = '$(sysconfdir)'"; \
echo "PKGLIBDIR = '$(pkglibdir)'"; \
} > $@
$(REPLACE_VARS_SED): Makefile stamp-directories
set -e; \
{ echo 's#@PREFIX@#$(prefix)#g'; \
echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
echo 's#@SBINDIR@#$(sbindir)#g'; \
echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
echo 's#@PKGPYTHONDIR@#$(pkgpythondir)#g'; \
} > $@
$(PYTHON_BOOTSTRAP): Makefile stamp-directories
set -e; \
module=`basename $@ | tr - _`; \
{ echo "#!$(PYTHON)"; \
echo '# This file is automatically generated, do not edit!'; \
echo "from quicknx.app import $$module"; \
echo "$$module.Main()"; \
} > $@ || rm -f $@
chmod u+x $@
$(LOG_WRAPPER): Makefile stamp-directories $(GEN_LOG_WRAPPER)
set -e; \
progname=`basename $@ | sed -e 's/-wrapper//'`; \
$(GEN_LOG_WRAPPER) "$(pkglibdir)/$$progname" "$(DESTDIR)$(pythondir)" > $@ || rm -f $@
chmod u+x $@
# We need to create symlinks because "make distcheck" will not install Python
# files when building.
srclinks: stamp-directories
set -e; \
for i in $(pkgpython_PYTHON) $(app_PYTHON) $(dist_pkglib_SCRIPTS); do \
if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
$(LN_S) $(abs_top_srcdir)/$$i $$i; \
fi; \
done
quicknx:
cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
# a dist hook rule for catching revision control directories
distcheck-hook:
if find $(top_distdir) | grep -F -e .svn -e .git; then \
echo "Found revision control files in final archive" 1>&2 ; \
exit 1; \
fi
install-exec-local:
@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/quicknx" \
"$(DESTDIR)${localstatedir}/lib/quicknx/sessions"
@chmod 1777 "$(DESTDIR)${localstatedir}/lib/quicknx/sessions"
stamp-directories: Makefile
@mkdir_p@ $(DIRS)
touch $@
.PHONY: apidoc
apidoc: all
mkdir -p doc/api
TMPDIR=`mktemp -d ` && { \
cp -r lib $$TMPDIR && \
( \
CDIR=`pwd` && \
cd $$TMPDIR && \
mv lib quicknx && \
epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
); \
rm -rf $$TMPDIR ; \
}
# vim: set noet :