Newer
Older
# Ganeti makefile
# - Indent with tabs only.
# - Keep files sorted; one line per file.
# - Directories in lib/ must have their own *dir variable (see hypervisor).
# - All directories must be listed 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@
# Helper values for calling builtin functions
empty :=
space := $(empty) $(empty)
comma := ,
# Use bash in order to be able to use pipefail
SHELL=/bin/bash
ACLOCAL_AMFLAGS = -I autotools
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
CHECK_HEADER = $(top_srcdir)/autotools/check-header
CHECK_MAN = $(top_srcdir)/autotools/check-man
CHECK_VERSION = $(top_srcdir)/autotools/check-version
CHECK_NEWS = $(top_srcdir)/autotools/check-news
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
DOCPP = $(top_srcdir)/autotools/docpp
REPLACE_VARS_SED = autotools/replace_vars.sed
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
clientdir = $(pkgpythondir)/client
hypervisordir = $(pkgpythondir)/hypervisor
rapidir = $(pkgpythondir)/rapi
serverdir = $(pkgpythondir)/server
watcherdir = $(pkgpythondir)/watcher
impexpddir = $(pkgpythondir)/impexpd
toolsdir = $(pkglibdir)/tools
iallocatorsdir = $(pkglibdir)/iallocators
docdir = $(datadir)/doc/$(PACKAGE)
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:
HTOOLS_DIRS = \
htools \
htools/Ganeti \
htools/Ganeti/HTools \
htools/Ganeti/HTools/Program
DIRS = \
autotools \
daemons \
devel \
doc \
doc/examples \
lib/confd \
lib/impexpd \
man \
qa \
test \
test/data \
BUILDTIME_DIR_AUTOCREATE = \
$(APIDOC_DIR) \
$(APIDOC_PY_DIR) \
$(APIDOC_HS_DIR) \
$(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \
$(APIDOC_HS_DIR)/Ganeti/HTools/Program \
$(COVERAGE_DIR) \
$(COVERAGE_PY_DIR) \
$(COVERAGE_HS_DIR) \
BUILDTIME_DIRS = \
$(BUILDTIME_DIR_AUTOCREATE) \
doc/html
DIRCHECK_EXCLUDE = \
$(BUILDTIME_DIRS) \
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
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
APIDOC_DIR = doc/api
APIDOC_PY_DIR = $(APIDOC_DIR)/py
APIDOC_HS_DIR = $(APIDOC_DIR)/hs
doc/upgrade.rst \
$(addsuffix /*.py[co],$(DIRS)) \
$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
$(addsuffix /*.o,$(HTOOLS_DIRS)) \
$(PYTHON_BOOTSTRAP) \
autotools/replace_vars.sed \
daemons/daemon-util \
daemons/ganeti-cleaner \
doc/examples/bash_completion \
stamp-srclinks \
$(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.
stamp-srclinks \
$(PYTHON_BOOTSTRAP) \
$(BUILT_PYTHON_SOURCES)
lib/_vcsversion.py \
lib/_generated_rpc.py
# these are all built from the underlying %.in sources
BUILT_EXAMPLES = \
doc/examples/ganeti-kvm-poweroff.initd \
doc/examples/ganeti.cron \
doc/examples/ganeti.initd \
doc/examples/gnt-config-backup \
doc/examples/hooks/ipsec
nodist_pkgpython_PYTHON = \
$(BUILT_PYTHON_SOURCES)
lib/build/__init__.py \
lib/build/sphinx_ext.py
pkgpython_PYTHON = \
lib/__init__.py \
lib/backend.py \
lib/bdev.py \
lib/bootstrap.py \
lib/cli.py \
lib/cmdlib.py \
lib/compat.py \
lib/config.py \
lib/constants.py \
lib/locking.py \
lib/luxi.py \
lib/mcpu.py \
lib/objects.py \
lib/opcodes.py \
lib/rpc_defs.py \
lib/serializer.py \
lib/ssconf.py \
lib/ssh.py \
lib/storage.py \
lib/client/gnt_backup.py \
lib/client/gnt_cluster.py \
lib/client/gnt_instance.py \
hypervisor_PYTHON = \
lib/hypervisor/__init__.py \
lib/hypervisor/hv_base.py \
lib/hypervisor/hv_chroot.py \
lib/hypervisor/hv_fake.py \
lib/hypervisor/hv_xen.py
rapi_PYTHON = \
lib/rapi/__init__.py \
lib/rapi/client_utils.py \
lib/rapi/connector.py \
lib/rapi/rlib2.py
lib/http/__init__.py \
lib/http/auth.py \
lib/http/client.py \
lib/http/server.py
lib/confd/querylib.py \
lib/confd/server.py
lib/masterd/__init__.py \
lib/masterd/instance.py
impexpd_PYTHON = \
lib/impexpd/__init__.py
lib/watcher/__init__.py \
lib/watcher/nodemaint.py \
lib/watcher/state.py
lib/server/__init__.py \
lib/server/noded.py \
lib/server/rapi.py
pytools_PYTHON = \
lib/tools/__init__.py \
lib/tools/ensure_dirs.py
lib/utils/filelock.py \
lib/utils/hash.py \
lib/utils/log.py \
lib/utils/nodesetup.py \
lib/utils/process.py \
lib/utils/retry.py \
lib/utils/wrapper.py \
lib/utils/x509.py
doc/design-query2.rst \
doc/design-http-server.rst \
doc/design-impexp2.rst \
doc/design-lu-generated-jobs.rst \
doc/design-multi-reloc.rst \
doc/design-ovf-support.rst \
doc/design-resource-model.rst \
René Nussbaumer
committed
doc/cluster-merge.rst \
doc/design-shared-storage.rst \
doc/design-node-state-cache.rst \
doc/design-virtual-clusters.rst \
doc/move-instance.rst \
HS_PROGS = htools/htools
HS_BIN_ROLES = hbal hscan hspace
HS_ALL_PROGS = $(HS_PROGS) htools/test
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
# we don't add -Werror by default
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
# extra flags that can be overriden on the command line
# exclude options for coverage reports
--exclude Ganeti.Constants \
--exclude Ganeti.THH \
--exclude Ganeti.HTools.QC \
--exclude Ganeti.HTools.QCHelper \
--exclude Ganeti.HTools.Version
htools/Ganeti/HTools/CLI.hs \
htools/Ganeti/HTools/Cluster.hs \
htools/Ganeti/HTools/Container.hs \
htools/Ganeti/HTools/ExtLoader.hs \
htools/Ganeti/HTools/Group.hs \
htools/Ganeti/HTools/IAlloc.hs \
htools/Ganeti/HTools/Instance.hs \
htools/Ganeti/HTools/Loader.hs \
htools/Ganeti/HTools/Luxi.hs \
htools/Ganeti/HTools/Node.hs \
htools/Ganeti/HTools/PeerMap.hs \
htools/Ganeti/HTools/QC.hs \
htools/Ganeti/HTools/Rapi.hs \
htools/Ganeti/HTools/Simu.hs \
htools/Ganeti/HTools/Text.hs \
htools/Ganeti/HTools/Types.hs \
htools/Ganeti/HTools/Utils.hs \
htools/Ganeti/HTools/Program/Hail.hs \
htools/Ganeti/HTools/Program/Hbal.hs \
htools/Ganeti/HTools/Program/Hscan.hs \
htools/Ganeti/HTools/Program/Hspace.hs \
htools/Ganeti/Jobs.hs \
htools/Ganeti/Luxi.hs \
htools/Ganeti/OpCodes.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)
# Note: we use here an order-only prerequisite, as the contents of
# _autoconf.py are not actually influencing the html build output: it
# has to exist in order for the sphinx module to be loaded
# successfully, but we certainly don't want the docs to be rebuilt if
# it changes
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
@test -n "$(SPHINX)" || \
{ echo 'sphinx-build' not found during configure; exit 1; }
@mkdir_p@ $(dir $@)
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
-D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
-D release="$(PACKAGE_VERSION)" \
$(abs_top_srcdir)/doc $(CURDIR)/doc/html
rm -f doc/html/.buildinfo doc/html/objects.inv
touch $@
doc/html: doc/html/index.html
doc/upgrade.rst: UPGRADE
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
set -e; \
{ echo '.. This file is automatically updated at build time from $<.'; \
echo '.. Do not edit.'; \
echo; \
cat $<; \
} > $@
doc/arch-2.0.dot \
doc/design-2.1-lock-acquire.dot \
doc/design-2.1-lock-release.dot
docpng = $(patsubst %.dot,%.png,$(docdot))
# Things to build but not to install (add it to EXTRA_DIST if it should be
# distributed)
noinst_DATA = \
devel/upload \
doc/html \
doc/examples/bash_completion \
$(manhtml)
scripts/gnt-backup \
scripts/gnt-cluster \
scripts/gnt-debug \
scripts/gnt-instance \
scripts/gnt-job \
scripts/gnt-node \
scripts/gnt-os
daemons/ganeti-masterd \
PYTHON_BOOTSTRAP = \
$(PYTHON_BOOTSTRAP_SBIN) \
tools/ensure-dirs
qa_scripts = \
qa/ganeti-qa.py \
qa/qa_cluster.py \
qa/qa_config.py \
qa/qa_daemon.py \
qa/qa_env.py \
qa/qa_error.py \
qa/qa_instance.py \
qa/qa_node.py \
qa/qa_os.py \
qa/qa_rapi.py \
qa/qa_tags.py \
qa/qa_utils.py
bin_SCRIPTS =
if WANT_HTOOLS
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
install-exec-hook:
@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
# FIXME: this is a hardcoded logic, instead of auto-resolving
$(LN_S) -f ../../../bin/htools \
for role in $(HS_BIN_ROLES); do \
$(DESTDIR)$(bindir)/$$role ; \
done
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
@if [ -z "$(HTOOLS)" ]; then \
echo "Error: htools compilation disabled at configure time" 1>&2 ;\
exit 1; \
fi
@BINARY=$(@:htools/%=%); \
if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
exit 1; \
fi
BINARY=$(@:htools/%=%); $(GHC) --make \
-osuf $$BINARY.o -hisuf $$BINARY.hi \
$(HEXTRA) $@
# for the htools/test binary, we need to enable profiling/coverage
htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
-fno-warn-monomorphism-restriction -fno-warn-orphans \
-fno-warn-missing-methods -fno-warn-unused-imports
dist_sbin_SCRIPTS = \
tools/ganeti-listrunner
nodist_sbin_SCRIPTS = \
daemons/ganeti-cleaner
python_scripts = \
tools/burnin \
tools/cfgshell \
tools/cfgupgrade \
$(python_scripts) \
tools/kvm-console-wrapper \
tools/xm-console-wrapper \
tools/master-ip-setup
pkglib_python_scripts = \
daemons/import-export \
tools/check-cert-expired
nodist_pkglib_python_scripts = \
tools/ensure-dirs
pkglib_SCRIPTS = \
nodist_pkglib_SCRIPTS = \
$(nodist_pkglib_python_scripts)
autotools/build-bash-completion \
autotools/check-python-code \
autotools/check-imports \
autotools/convert-constants \
autotools/docpp \
autotools/gen-coverage \
daemons/daemon-util.in \
daemons/ganeti-cleaner.in \
$(pkglib_python_scripts) \
$(docpng) \
$(docrst) \
doc/conf.py \
doc/html \
doc/examples/ganeti.default \
doc/examples/ganeti.default-debug \
doc/examples/gnt-debug/README \
doc/examples/gnt-debug/delay0.json \
doc/examples/gnt-debug/delay50.json \
test/testutils.py \
test/mocks.py \
$(dist_TESTS) \
$(TEST_FILES) \
$(maninput) \
$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
$(HS_PROG_SRCS) \
htools/lint-hints.hs
man_MANS = \
man/ganeti.7 \
man/ganeti-noded.8 \
man/ganeti-os-interface.7 \
man/ganeti-watcher.8 \
man/gnt-backup.8 \
man/gnt-cluster.8 \
man/gnt-os.8 \
man/hail.1 \
man/hbal.1 \
man/hscan.1 \
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
manhtml = $(patsubst %.rst,%.html,$(manrst))
mangen = $(patsubst %.rst,%.gen,$(manrst))
$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
man/footer.man man/footer.html $(mangen)
test/data/bdev-drbd-8.0.txt \
test/data/bdev-drbd-8.3.txt \
test/data/bdev-drbd-disk.txt \
test/data/bdev-drbd-net-ip4.txt \
test/data/bdev-drbd-net-ip6.txt \
test/data/cert1.pem \
test/data/ip-addr-show-dummy0.txt \
test/data/ip-addr-show-lo-ipv4.txt \
test/data/ip-addr-show-lo-ipv6.txt \
test/data/ip-addr-show-lo-oneline-ipv4.txt \
test/data/ip-addr-show-lo-oneline-ipv6.txt \
test/data/ip-addr-show-lo-oneline.txt \
test/data/ip-addr-show-lo.txt \
test/data/proc_drbd80-emptyline.txt \
test/data/proc_drbd83.txt \
test/data/proc_drbd83_sync.txt \
test/data/proc_drbd83_sync_krnl2.6.39.txt \
test/data/sys_drbd_usermode_helper.txt \
test/data/ovfdata/empty.ovf \
test/data/ovfdata/ganeti.mf \
test/data/ovfdata/ganeti.ovf \
test/data/ovfdata/gzip_disk.ovf \
test/data/ovfdata/new_disk.vmdk \
test/data/ovfdata/no_ovf.ova \
test/data/ovfdata/ova.ova \
test/data/ovfdata/second_disk.vmdk \
test/data/ovfdata/rawdisk.raw \
test/data/ovfdata/unsafe_path.ini \
test/data/ovfdata/virtualbox.ovf \
test/data/ovfdata/wrong_extension.ovd \
test/data/ovfdata/wrong_manifest.mf \
test/data/ovfdata/wrong_manifest.ovf \
test/data/ovfdata/wrong_ova.ova \
test/data/ovfdata/wrong_xml.ovf \
test/import-export_unittest-helper
test/ganeti.backend_unittest.py \
test/ganeti.bdev_unittest.py \
test/ganeti.cli_unittest.py \
test/ganeti.client.gnt_cluster_unittest.py \
test/ganeti.client.gnt_instance_unittest.py \
test/ganeti.cmdlib_unittest.py \
test/ganeti.compat_unittest.py \
test/ganeti.confd.client_unittest.py \
test/ganeti.config_unittest.py \
test/ganeti.constants_unittest.py \
test/ganeti.hooks_unittest.py \
test/ganeti.http_unittest.py \
test/ganeti.hypervisor_unittest.py \
test/ganeti.hypervisor.hv_chroot_unittest.py \
test/ganeti.hypervisor.hv_fake_unittest.py \
test/ganeti.hypervisor.hv_kvm_unittest.py \
test/ganeti.hypervisor.hv_lxc_unittest.py \
test/ganeti.hypervisor.hv_xen_unittest.py \
test/ganeti.impexpd_unittest.py \
test/ganeti.jqueue_unittest.py \
test/ganeti.locking_unittest.py \
test/ganeti.luxi_unittest.py \
test/ganeti.masterd.instance_unittest.py \
test/ganeti.objects_unittest.py \
test/ganeti.query_unittest.py \
test/ganeti.rapi.baserlib_unittest.py \
test/ganeti.rapi.resources_unittest.py \
test/ganeti.rapi.rlib2_unittest.py \
test/ganeti.runtime_unittest.py \
test/ganeti.serializer_unittest.py \
test/ganeti.ssh_unittest.py \
test/ganeti.tools.ensure_dirs_unittest.py \
test/ganeti.utils.algo_unittest.py \
test/ganeti.utils.filelock_unittest.py \
test/ganeti.utils.hash_unittest.py \
test/ganeti.utils.io_unittest.py \
test/ganeti.utils.log_unittest.py \
test/ganeti.utils.mlock_unittest.py \
test/ganeti.utils.nodesetup_unittest.py \
test/ganeti.utils.process_unittest.py \
test/ganeti.utils.retry_unittest.py \
test/ganeti.utils.text_unittest.py \
test/ganeti.utils.wrapper_unittest.py \
test/ganeti.utils.x509_unittest.py \
test/ganeti.utils_unittest.py \
test/ganeti.workerpool_unittest.py \
test/docs_unittest.py \
test/pycurl_reset_unittest.py \
test/tempfile_fork_unittest.py
if HAS_FAKEROOT
python_tests += test/ganeti.utils.io_unittest-runasroot.py
endif
haskell_tests = htools/test
test/check-cert-expired_unittest.bash \
test/ganeti-cleaner_unittest.bash \
test/import-export_unittest.bash \
nodist_TESTS += $(haskell_tests)
endif
TESTS = $(dist_TESTS) $(nodist_TESTS)
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
# Environment for tests run by automake
$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
$(dist_sbin_SCRIPTS) \
$(python_scripts) \
$(pkglib_python_scripts) \
$(pkgpython_PYTHON) \
$(hypervisor_PYTHON) \
$(rapi_PYTHON) \
$(http_PYTHON) \
$(confd_PYTHON) \
$(impexpd_PYTHON) \
$(noinst_PYTHON) \
$(qa_scripts)
test/check-cert-expired_unittest.bash \
test/ganeti-cleaner_unittest.bash \
test/import-export_unittest.bash \
$(HS_LIB_SRCS) $(HS_PROG_SRCS)
check_python_code = \
$(BUILD_BASH_COMPLETION) \
$(all_python_code)
ganeti \
$(dist_sbin_SCRIPTS) \
$(python_scripts) \
$(pkglib_python_scripts) \
$(BUILD_BASH_COMPLETION) \
standalone_python_modules = \
lib/rapi/client.py \
tools/ganeti-listrunner
pep8_python_code = \
ganeti \
ganeti/http/server.py \
$(dist_sbin_SCRIPTS) \
$(python_scripts) \
$(pkglib_python_scripts) \
$(BUILD_BASH_COMPLETION) \
test/daemon-util_unittest.bash: daemons/daemon-util
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod +x $@
autotools/testrunner: autotools/testrunner.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod u+x $@
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod u+x $@
daemons/%: daemons/%.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
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/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
man/footer.man: man/footer.rst
@test -n "$(PANDOC)" || \
{ echo 'pandoc' not found during configure; exit 1; }
$(PANDOC) -f rst -t man -o $@ $<
man/footer.html: man/footer.rst
@test -n "$(PANDOC)" || \
{ echo 'pandoc' not found during configure; exit 1; }
$(PANDOC) -f rst -t html -o $@ $<
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
@test -n "$(PANDOC)" || \
{ echo 'pandoc' not found during configure; exit 1; }
$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
sed -e 's/\\@/@/g' > $@
if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
man/%.html.in: man/%.gen man/footer.html
@test -n "$(PANDOC)" || \
{ echo 'pandoc' not found during configure; exit 1; }
$(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/%.8: man/%.8.in $(REPLACE_VARS_SED)
man/%.html: man/%.html.in $(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 > $@; \
elif test ! -f $@ ; then \
echo "Cannot auto-generate $@ file"; exit 1; \
fi
.PHONY: regen-vcs-version
regen-vcs-version:
cd $(srcdir); \
if test -d .git; then \
rm -f vcs-version; \
$(MAKE) vcs-version; \
fi
htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
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 $(CONVERT_CONSTANTS) \
| lib/_vcsversion.py
{ cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
lib/_autoconf.py: Makefile | lib/.dir
{ echo '# This file is automatically generated, do not edit!'; \
echo '#'; \
echo ''; \
echo '"""Build-time configuration for Ganeti.'; \
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 '# pylint: disable=C0301,C0324'; \
echo '# because this is autogenerated, we do not want'; \
echo '# style warnings' ; \
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 "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
echo "XEN_INITRD = '$(XEN_INITRD)'"; \
echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
echo "IP_PATH = '$(IP_PATH)'"; \
echo "SOCAT_PATH = '$(SOCAT)'"; \
echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
echo "TOOLSDIR = '$(toolsdir)'"; \
echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
echo "PKGLIBDIR = '$(pkglibdir)'"; \
echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
echo "MASTERD_USER = '$(MASTERD_USER)'"; \
echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
echo "RAPI_USER = '$(RAPI_USER)'"; \
echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
echo "CONFD_USER = '$(CONFD_USER)'"; \
echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
echo "NODED_USER = '$(NODED_USER)'"; \