ganeti-[0-9]*.[0-9]*.[0-9]* \
doc/html/_*
-all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
-
# some helper vars
COVERAGE_DIR = doc/coverage
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
$(addsuffix /*.py[co],$(DIRS)) \
$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
$(addsuffix /*.o,$(HTOOLS_DIRS)) \
- $(all_dirfiles) \
$(PYTHON_BOOTSTRAP) \
epydoc.conf \
- autotools/replace_vars.sed \
+ $(REPLACE_VARS_SED) \
daemons/daemon-util \
daemons/ganeti-cleaner \
devel/upload \
$(man_MANS) \
$(manhtml) \
tools/kvm-ifup \
+ stamp-directories \
stamp-srclinks \
$(nodist_pkgpython_PYTHON) \
$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
.hpc/*.mix htools/*.tix \
doc/hs-lint.html
-# BUILT_SOURCES should only be used as a dependency on phony
-# targets. Otherwise it'll cause the target to rebuild every time.
-BUILT_SOURCES = \
- $(built_base_sources) \
+GENERATED_FILES = \
+ $(built_base_sources) \
$(BUILT_PYTHON_SOURCES) \
$(PYTHON_BOOTSTRAP)
built_base_sources = \
- ganeti \
- stamp-srclinks \
- $(all_dirfiles)
+ stamp-directories \
+ stamp-srclinks
built_python_base_sources = \
lib/_autoconf.py \
$(built_python_base_sources) \
lib/_generated_rpc.py
-# Generating the RPC wrappers depends on many things, so make sure it's built at
-# the end of the built sources
+# Generating the RPC wrappers depends on many things, so make sure
+# it's built at the end of the built sources
lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
# these are all built from the underlying %.in sources
doc/design-shared-storage.rst \
doc/design-node-state-cache.rst \
doc/design-virtual-clusters.rst \
+ doc/design-bulk-create.rst \
doc/design-query-splitting.rst \
doc/devnotes.rst \
doc/glossary.rst \
htools/Ganeti/Luxi.hs \
htools/Ganeti/Objects.hs \
htools/Ganeti/OpCodes.hs \
+ htools/Ganeti/Rpc.hs \
+ htools/Ganeti/Qlang.hs \
+ htools/Ganeti/Queryd.hs \
htools/Ganeti/Runtime.hs \
htools/Ganeti/Ssconf.hs \
htools/Ganeti/THH.hs
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
-$(RUN_IN_TEMPDIR): | $(all_dirfiles)
+$(RUN_IN_TEMPDIR): | stamp-directories
# Note: we use here an order-only prerequisite, as the contents of
# _autoconf.py are not actually influencing the html build output: it
@touch "$@"
# for the htools/test binary, we need to enable profiling/coverage
-htools/test: HEXTRA_INT=-fhpc -Wwarn -fno-warn-missing-signatures \
- -fno-warn-monomorphism-restriction -fno-warn-orphans \
- -fno-warn-missing-methods -fno-warn-unused-imports
+htools/test: HEXTRA_INT=-fhpc
# we compile the hpc-htools binary with the program coverage
htools/hpc-htools: HEXTRA_INT=-fhpc
# run before)
.PHONY: hs-prof hs-prof-quick
hs-prof:
- $(MAKE) clean
- $(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
+ $(MAKE) $(AM_MAKEFLAGS) clean
+ $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
rm -f $(HS_ALL_PROGS)
- $(MAKE) hs-prof-quick
+ $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
hs-prof-quick:
- $(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
+ $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
dist_sbin_SCRIPTS = \
tools/ganeti-listrunner
test/ganeti.hypervisor.hv_xen_unittest.py \
test/ganeti.impexpd_unittest.py \
test/ganeti.jqueue_unittest.py \
+ test/ganeti.jstore_unittest.py \
test/ganeti.locking_unittest.py \
test/ganeti.luxi_unittest.py \
test/ganeti.masterd.instance_unittest.py \
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod u+x $@
-daemons/%: daemons/%.in $(REPLACE_VARS_SED)
+daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod +x $@
-doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
- sed -f $(REPLACE_VARS_SED) < $< > $@
-
-doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
+doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
- lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
+ lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
+ $(GENERATED_FILES)
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
doc/%.png: doc/%.dot
$(PANDOC) -s -f rst -t html -A man/footer.html $< | \
sed -e 's/\\@/@/g' > $@
-man/%.1: man/%.1.in $(REPLACE_VARS_SED)
- sed -f $(REPLACE_VARS_SED) < $< > $@
-
-man/%.7: man/%.7.in $(REPLACE_VARS_SED)
+man/%: man/%.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
-man/%.8: man/%.8.in $(REPLACE_VARS_SED)
+epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
-man/%.html: man/%.html.in $(REPLACE_VARS_SED)
- sed -f $(REPLACE_VARS_SED) < $< > $@
-
-epydoc.conf: epydoc.conf.in Makefile
- sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
-
vcs-version:
if test -d .git; then \
git describe > $@; \
set -e; \
cd $(srcdir); \
if test -d .git; then \
- $(MAKE) clean-vcs-version; \
- $(MAKE) vcs-version; \
+ $(MAKE) $(AM_MAKEFLAGS) clean-vcs-version; \
+ $(MAKE) $(AM_MAKEFLAGS) vcs-version; \
fi
-htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
+htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in \
+ vcs-version $(built_base_sources)
set -e; \
VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
sed -e "s/%ver%/$$VCSVER/" < $< > $@
htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
lib/constants.py lib/_autoconf.py lib/luxi.py \
- $(CONVERT_CONSTANTS) \
+ $(CONVERT_CONSTANTS) $(built_base_sources) \
| lib/_vcsversion.py
set -e; \
{ cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
-lib/_autoconf.py: Makefile | lib/.dir
+lib/_autoconf.py: Makefile | stamp-directories
set -e; \
{ echo '# This file is automatically generated, do not edit!'; \
echo '#'; \
echo "XEN_CMD = '$(XEN_CMD)'"; \
} > $@
-lib/_vcsversion.py: Makefile vcs-version | lib/.dir
+lib/_vcsversion.py: Makefile vcs-version | stamp-directories
set -e; \
VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
{ echo '# This file is automatically generated, do not edit!'; \
lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
-$(REPLACE_VARS_SED): Makefile
+$(REPLACE_VARS_SED): Makefile stamp-directories
set -e; \
{ echo 's#@PREFIX@#$(prefix)#g'; \
echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
+ echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
} > $@
# Using deferred evaluation
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/%,%,$@)
-$(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
+$(PYTHON_BOOTSTRAP): Makefile | stamp-directories
test -n "$(MODULE)" || { echo Missing module; exit 1; }
set -e; \
{ echo '#!/usr/bin/python'; \
} > $@
chmod u+x $@
+stamp-directories: Makefile
+ $(MAKE) $(AM_MAKEFLAGS) ganeti
+ @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
+ touch $@
+
# We need to create symlinks because "make distcheck" will not install Python
# files when building.
-stamp-srclinks: Makefile | $(all_dirfiles)
+stamp-srclinks: Makefile | stamp-directories
set -e; \
for i in $(srclink_files); do \
if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
.PHONY: check-dirs
-check-dirs: $(BUILT_SOURCES)
+check-dirs: $(GENERATED_FILES)
@set -e; \
find . -type d \( \( -name . \) -o \( \
-name .git -o \
}
.PHONY: check-local
-check-local: check-dirs $(BUILT_SOURCES)
+check-local: check-dirs $(GENERATED_FILES)
$(CHECK_PYTHON_CODE) $(check_python_code)
PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
# (since our indent level is not 4)
# E127: continuation line over-indented for visual indent
# (since our indent level is not 4)
-# E122,E123,E126,E128,E262,E272,E502,E711,: added temporarily to not
-# modify stable code; do NOT merge these into master!
+# note: do NOT add E128 here; it's a valid style error in most cases!
+# I've seen real errors, but also some cases were we indent wrongly
+# due to line length; try to rework the cases where it is triggered,
+# instead of silencing it
# E261: at least two spaces before inline comment
# E501: line too long (80 characters)
-PEP8_IGNORE = E111,E121,E122,E123,E125,E126,E127,E128,E261,E262,E272,E501,E502,E711
+PEP8_IGNORE = E111,E121,E125,E127,E261,E501
# For excluding pep8 expects filenames only, not whole paths
PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
lint: $(LINT_TARGETS)
.PHONY: pylint
-pylint: $(BUILT_SOURCES)
+pylint: $(GENERATED_FILES)
@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
$(PYLINT) $(LINT_OPTS) $(lint_python_code)
.PHONY: pylint-qa
-pylint-qa: $(BUILT_SOURCES)
+pylint-qa: $(GENERATED_FILES)
@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
cd $(top_srcdir)/qa && \
PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
--rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
.PHONY: pep8
-pep8: $(BUILT_SOURCES)
+pep8: $(GENERATED_FILES)
@test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
$(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
--repeat $(pep8_python_code)
+# FIXME: remove ignore "Use void" when GHC 6.x is deprecated
.PHONY: hlint
hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
@test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
--ignore "Use comparing" \
--ignore "Use on" \
--ignore "Reduce duplication" \
+ --ignore "Use &&&" \
+ --ignore "Use void" \
--hint htools/lint-hints \
$(filter-out htools/Ganeti/THH.hs,$(HS_LIB_SRCS))
# a dist hook rule for updating the vcs-version file; this is
# hardcoded due to where it needs to build the file...
dist-hook:
- $(MAKE) regen-vcs-version
+ $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
rm -f $(top_distdir)/vcs-version
cp -p $(srcdir)/vcs-version $(top_distdir)
"$(DESTDIR)${localstatedir}/log/ganeti" \
"$(DESTDIR)${localstatedir}/run/ganeti"
-# To avoid conflicts between directory names and other targets, a file inside
-# the directory is used to ensure its existence.
-%.dir:
- @mkdir_p@ $* && touch $@
-
.PHONY: apidoc
if WANT_HTOOLSAPIDOC
apidoc: py-apidoc hs-apidoc
endif
.PHONY: py-apidoc
-py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
+py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
$(RUN_IN_TEMPDIR) epydoc -v \
--conf $(CURDIR)/epydoc.conf \
--output $(CURDIR)/$(APIDOC_PY_DIR)
$(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
.PHONY: TAGS
-TAGS: $(BUILT_SOURCES)
+TAGS: $(GENERATED_FILES)
rm -f TAGS
+ $(GHC) -e ":etags" -v0 $(HFLAGS) $(HS_LIB_SRCS)
find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
-path './daemons/ganeti-*' -o -path './tools/*' -o \
-path './qa/*.py' | \
- etags -l python -
+ etags -l python -a -
.PHONY: coverage
if WANT_HTOOLS
endif
.PHONY: py-coverage
-py-coverage: $(BUILT_SOURCES) $(python_tests)
+py-coverage: $(GENERATED_FILES) $(python_tests)
set -e; \
COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
.PHONY: hs-coverage
hs-coverage: $(haskell_tests) htools/hpc-htools
rm -f *.tix
- $(MAKE) hs-check
+ $(MAKE) $(AM_MAKEFLAGS) hs-check
@mkdir_p@ $(COVERAGE_HS_DIR)
- hpc combine $(HPCEXCL) test.tix hpc-htools.tix > coverage-htools.tix
+ hpc combine --union $(HPCEXCL) \
+ test.tix hpc-htools.tix > coverage-htools.tix
hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
hpc report coverage-htools.tix
$(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
exit 1; \
fi
+# we don't need the ancient implicit rules:
+%: %,v
+%: RCS/%,v
+%: RCS/%
+%: s.%
+%: SCCS/s.%
+
-include ./Makefile.local
# vim: set noet :