PageRenderTime 43ms CodeModel.GetById 19ms app.highlight 18ms RepoModel.GetById 2ms app.codeStats 0ms

/neatx/Makefile.am

http://neatx.googlecode.com/
Makefile | 248 lines | 193 code | 44 blank | 11 comment | 15 complexity | 52dbedbe2cc45c0da6c6ec92ae4e784f MD5 | raw file
  1# Neatx makefile
  2# - Indent with tabs only.
  3# - Keep files sorted; one line per file.
  4# - Directories in lib/ must have their own *dir variable.
  5# - All directories must be listed in DIRS.
  6# - Use autogen.sh to generate Makefile.in and configure script.
  7
  8# Automake doesn't export these variables before version 1.10.
  9abs_top_builddir = @abs_top_builddir@
 10abs_top_srcdir = @abs_top_srcdir@
 11
 12ACLOCAL_AMFLAGS = -I autotools
 13REPLACE_VARS_SED = autotools/replace_vars.sed
 14GEN_LOG_WRAPPER = $(top_srcdir)/autotools/gen-log-wrapper
 15
 16appdir = $(pkgpythondir)/app
 17docdir = $(datadir)/doc/$(PACKAGE)
 18
 19AM_CFLAGS = -Wall -Werror -DPKGLIBDIR=\"$(pkglibdir)\"
 20
 21DIRS = \
 22	autotools \
 23	doc \
 24	extras \
 25	lib \
 26	lib/app \
 27	src \
 28	test \
 29	test/python
 30
 31CLEANFILES = \
 32	stamp-directories \
 33	extras/upload \
 34	lib/*.py[co] \
 35	lib/app/*.py[co] \
 36	test/python/*.py[co] \
 37	$(REPLACE_VARS_SED) \
 38	$(nodist_pkgpython_PYTHON) \
 39	$(PYTHON_BOOTSTRAP) \
 40	$(LOG_WRAPPER)
 41
 42DISTCLEANFILES = \
 43	$(dochtml)
 44
 45CLEANDIRS = \
 46	doc/api
 47
 48nodist_pkgpython_PYTHON = \
 49	lib/_autoconf.py
 50
 51pkgpython_PYTHON = \
 52	lib/__init__.py \
 53	lib/agent.py \
 54	lib/auth.py \
 55	lib/cli.py \
 56	lib/config.py \
 57	lib/constants.py \
 58	lib/daemon.py \
 59	lib/errors.py \
 60	lib/node.py \
 61	lib/protocol.py \
 62	lib/serializer.py \
 63	lib/session.py \
 64	lib/utils.py
 65
 66app_PYTHON = \
 67	lib/app/__init__.py \
 68	lib/app/nxdialog.py \
 69	lib/app/nxnode.py \
 70	lib/app/nxserver.py \
 71	lib/app/nxserver_login.py
 72
 73dist_pkglib_SCRIPTS = \
 74	src/ttysetup
 75
 76nodist_pkglib_SCRIPTS = \
 77	$(LOG_WRAPPER) \
 78	$(PYTHON_BOOTSTRAP)
 79
 80pkglib_PROGRAMS = \
 81	src/fdcopy
 82
 83dist_pkgdata_DATA = \
 84	extras/authorized_keys.nomachine
 85
 86docrst = \
 87	doc/design.rst
 88
 89dochtml = $(patsubst %.rst,%.html,$(docrst))
 90
 91doc_DATA = $(dochtml)
 92
 93dist_doc_DATA = \
 94	doc/neatx.conf.example \
 95	doc/processes.txt
 96
 97PYTHON_BOOTSTRAP = \
 98	src/nxdialog \
 99	src/nxnode \
100	src/nxserver \
101	src/nxserver-login
102
103LOG_WRAPPER = \
104	src/nxnode-wrapper \
105	src/nxserver-login-wrapper
106
107EXTRA_DIST = \
108	pylintrc \
109	autotools/gen-log-wrapper \
110	doc/DEVNOTES \
111	extras/upload.in \
112	extras/rpm/neatx.spec \
113	$(docrst) \
114	$(dist_TESTS) \
115	$(TEST_FILES)
116
117TEST_FILES = \
118	test/python/mocks.py
119
120dist_TESTS = \
121	test/python/neatx.app.nxserver_login_test.py \
122	test/python/neatx.app.nxserver_test.py \
123	test/python/neatx.auth_test.py \
124	test/python/neatx.daemon_test.py \
125	test/python/neatx.protocol_test.py \
126	test/python/neatx.session_test.py \
127	test/python/neatx.utils_test.py
128
129nodist_TESTS =
130
131TESTS = $(dist_TESTS) $(nodist_TESTS)
132
133TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
134
135
136all-local: stamp-directories lib/_autoconf.py extras/upload
137
138clean-local:
139	-test -z "$(CLEANDIRS)" || rm -rf $(CLEANDIRS)
140
141extras/upload: extras/upload.in stamp-directories $(REPLACE_VARS_SED)
142	sed -f $(REPLACE_VARS_SED) < $< > $@
143	chmod u+x $@
144
145$(TESTS): neatx srclinks lib/_autoconf.py src/fdcopy src/ttysetup
146
147doc/%.html: doc/%.rst
148	@if test -z "$(RST2HTML)"; then \
149		echo "rst2html not found during configure, can't build docs"; \
150		exit 1; \
151	else \
152		$(RST2HTML) $< $@; \
153	fi
154
155lib/_autoconf.py: Makefile stamp-directories
156	set -e; \
157	{ echo '# This file is automatically generated, do not edit!'; \
158	  echo '#'; \
159	  echo ''; \
160	  echo '"""Build-time configuration.'; \
161	  echo '';\
162	  echo 'This file is autogenerated by the build process.'; \
163	  echo 'For any changes you need to re-run ./configure and'; \
164	  echo 'not edit by hand.'; \
165	  echo ''; \
166	  echo '"""'; \
167	  echo ''; \
168	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
169	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
170	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
171	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
172	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
173	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
174	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
175	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
176	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
177	} > $@
178
179$(REPLACE_VARS_SED): Makefile stamp-directories
180	set -e; \
181	{ echo 's#@PREFIX@#$(prefix)#g'; \
182	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
183	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
184	  echo 's#@SBINDIR@#$(sbindir)#g'; \
185	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
186	  echo 's#@PKGPYTHONDIR@#$(pkgpythondir)#g'; \
187	} > $@
188
189$(PYTHON_BOOTSTRAP): Makefile stamp-directories
190	set -e; \
191	module=`basename $@ | tr - _`; \
192	{ echo "#!$(PYTHON)"; \
193	  echo '# This file is automatically generated, do not edit!'; \
194	  echo "from neatx.app import $$module"; \
195	  echo "$$module.Main()"; \
196	} > $@ || rm -f $@
197	chmod u+x $@
198
199$(LOG_WRAPPER): Makefile stamp-directories $(GEN_LOG_WRAPPER)
200	set -e; \
201	progname=`basename $@ | sed -e 's/-wrapper//'`; \
202	$(GEN_LOG_WRAPPER) "$(pkglibdir)/$$progname" "$(DESTDIR)$(pythondir)" > $@ || rm -f $@
203	chmod u+x $@
204
205# We need to create symlinks because "make distcheck" will not install Python
206# files when building.
207srclinks: stamp-directories
208	set -e; \
209	for i in $(pkgpython_PYTHON) $(app_PYTHON) $(dist_pkglib_SCRIPTS); do \
210		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
211			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
212		fi; \
213	done
214
215neatx:
216	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
217
218# a dist hook rule for catching revision control directories
219distcheck-hook:
220	if find $(top_distdir) | grep -F -e .svn -e .git; then \
221		echo "Found revision control files in final archive" 1>&2 ; \
222		exit 1; \
223	fi
224
225install-exec-local:
226	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/neatx" \
227	  "$(DESTDIR)${localstatedir}/lib/neatx/sessions"
228	@chmod 1777 "$(DESTDIR)${localstatedir}/lib/neatx/sessions"
229
230stamp-directories: Makefile
231	@mkdir_p@ $(DIRS)
232	touch $@
233
234.PHONY: apidoc
235apidoc: all
236	mkdir -p doc/api
237	TMPDIR=`mktemp -d ` && { \
238		cp -r lib $$TMPDIR && \
239		( \
240			CDIR=`pwd` && \
241			cd $$TMPDIR && \
242			mv lib neatx && \
243			epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
244		); \
245		rm -rf $$TMPDIR ; \
246	}
247
248# vim: set noet :