# -*- makefile -*- if HAVE_PYTHON nodist_nbblib_PYTHON += src/nbblib/package.py CLEANFILES += src/nbblib/package.py nbblib_PYTHON += src/nbblib/__init__.py nbblib_PYTHON += src/nbblib/bs.py nbblib_PYTHON += src/nbblib/commands.py nbblib_PYTHON += src/nbblib/main.py nbblib_PYTHON += src/nbblib/nbbcommands.py nbblib_PYTHON += src/nbblib/plugins.py nbblib_PYTHON += src/nbblib/progutils.py nbblib_PYTHON += src/nbblib/vcs.py lint: lint-local lint-local: lint-local-pylint lint-local: lint-local-pychecker lint-local-pylint: cd src && pylint --zope=y --acquired-members=name,plugins nbb nbblib lint-local-pychecker: cd src && pychecker --limit=500 $$(for f in nbblib/*.py; do echo nbblib.$$(basename "$$f" .py); done) # Put all python source files, whether changed or verbatim, # into builddir, such that we can run tests in builddir. ALL_LOCAL += all-local-nbblib all-local-nbblib: @for f in $(nbblib_PYTHON); do \ if test -f "$(top_builddir)/$$f" && test "$(top_srcdir)/$$f" -ot "$(top_builddir)/$$f"; then :; else \ echo "INFO: Updating $$f in $(top_builddir) from $(top_srcdir)"; \ cp -f "$(top_srcdir)/$$f" "$(top_builddir)/$$f"; \ fi; \ done if HAVE_PYDOC #SUFFIXES = html py #.py.html: # cd src && $(PYDOC) -w "" # mkdir -p pydoc # mv src/$< ALL_LOCAL += all-local-nbblib-pydoc all-local-nbblib-pydoc: all-local-nbblib @mkdir -p pydoc && \ echo "Entering directory '$$PWD'"; \ for modfile in src/nbblib/*.py; do \ mod="nbblib.$$(basename "$$modfile" .py)"; \ test "$$mod" = "nbblib.__init__" && mod="nbblib"; \ htmlfile="pydoc/$${mod}.html"; \ : ls -l --full-time "$$htmlfile" "$$modfile"; \ : "Darn. Better let MAKE calculate the deps, perhaps?" ; \ rebuild="no"; \ if test -f "$$htmlfile"; then \ if test "$$modfile" -nt "$$htmlfile"; then \ rebuild="yes"; \ fi; \ else \ rebuild="yes"; \ fi; \ if test "$$rebuild" = "yes"; then \ echo $(PYDOC) -w "$${mod}"; \ ( cd src && $(PYDOC) -w "$${mod}" ); \ if test -f "$$htmlfile" && cmp "src/$${mod}.html" "$$htmlfile" > /dev/null; \ then rm -f "src/$${mod}.html"; \ else echo "INFO: Updating pydoc/$${mod}.html"; \ mv -f "src/$${mod}.html" "$$htmlfile"; fi; \ fi; \ done; \ echo "Leaving directory '$$PWD'" install-data-local: $(INSTALL) -d -m 0755 $(DESTDIR)$(htmldir) $(INSTALL) -m 0644 pydoc/*.html $(DESTDIR)$(htmldir)/ uninstall-local: rm -f $(DESTDIR)$(htmldir)/*.html endif bin_SCRIPTS += src/nbb CLEANFILES += src/nbb # We cannot create src/nbb from src/nbb.in in configure.ac/config.status. # pythondir is defined as ${something}foobar, and that needs expansion. EXTRA_DIST += src/nbb.in src/nbb: src/nbb.in $(nodist_nbblib_PYTHON) $(nbblib_PYTHON) Makefile $(SED) \ -e 's&[@]pkgpythondir@&$(pkgpythondir)&g' \ -e 's&[@]PYTHON@&$(PYTHON)&g' \ -e 's&[@]PACKAGE_VERSION@&$(PACKAGE_VERSION)&g' \ < $(srcdir)/src/nbb.in > src/nbb.new @if test "x$$($(GREP) '@[a-zA-Z0-9_]\{1,\}@' src/nbb.new)" = "x"; then :; \ else \ echo "FATAL: Unsubstituted markers remain in src/nbb.new."; \ $(GREP) '@[a-zA-Z0-9_]\{1,\}@' src/nbb.new; \ exit 1; \ fi @if test -f src/nbb && cmp src/nbb.new src/nbb > /dev/null; \ then rm -f src/nbb.new; \ else mv -f src/nbb.new src/nbb; echo "INFO: Updating src/nbb"; fi @chmod +x src/nbb endif clean-local: clean-local-nbblib clean-local-nbblib-pydoc clean-local-nbblib: rm -f src/nbblib/*.pyc @top_srcdir="$$(cd "$(top_srcdir)" > /dev/null 2>&1 && pwd)"; \ top_builddir="$$(cd "$(top_builddir)" > /dev/null 2>&1 && pwd)"; \ if test "x$${top_srcdir}" = "x$${top_builddir}"; then :; else \ for f in $(nbblib_PYTHON); do \ echo rm -f "$(top_builddir)/$$f"; \ rm -f "$(top_builddir)/$$f"; \ done; \ fi clean-local-nbblib-pydoc: rm -rf pydoc # End of Makefile-files.