2 # - Indent with tabs only.
3 # - Keep files sorted; one line per file.
4 # - Directories in lib/ must have their own *dir variable (see hypervisor).
5 # - All directories must be listed DIRS.
6 # - Use autogen.sh to generate Makefile.in and configure script.
8 # Automake doesn't export these variables before version 1.10.
9 abs_top_builddir = @abs_top_builddir@
10 abs_top_srcdir = @abs_top_srcdir@
12 # Use bash in order to be able to use pipefail
15 ACLOCAL_AMFLAGS = -I autotools
16 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
17 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
18 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
19 CHECK_MAN = $(top_srcdir)/autotools/check-man
20 CHECK_VERSION = $(top_srcdir)/autotools/check-version
21 CHECK_NEWS = $(top_srcdir)/autotools/check-news
22 DOCPP = $(top_srcdir)/autotools/docpp
23 REPLACE_VARS_SED = autotools/replace_vars.sed
25 # Note: the variable must be named after the directory + 'dir' suffix
26 clientdir = $(pkgpythondir)/client
27 hypervisordir = $(pkgpythondir)/hypervisor
28 httpdir = $(pkgpythondir)/http
29 masterddir = $(pkgpythondir)/masterd
30 confddir = $(pkgpythondir)/confd
31 rapidir = $(pkgpythondir)/rapi
32 serverdir = $(pkgpythondir)/server
33 watcherdir = $(pkgpythondir)/watcher
34 impexpddir = $(pkgpythondir)/impexpd
35 utilsdir = $(pkgpythondir)/utils
36 toolsdir = $(pkglibdir)/tools
37 iallocatorsdir = $(pkglibdir)/iallocators
38 docdir = $(datadir)/doc/$(PACKAGE)
40 # Delete output file if an error occurred while building it
55 doc/examples/gnt-debug \
75 BUILDTIME_DIR_AUTOCREATE = \
78 $(HS_APIDOC) $(HS_APIDOC)/Ganeti $(HS_APIDOC)/Ganeti/HTools \
84 $(BUILDTIME_DIR_AUTOCREATE) \
89 ganeti-[0-9]*.[0-9]*.[0-9]* \
92 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
94 MAINTAINERCLEANFILES = \
97 doc/install-quick.rst \
102 maintainer-clean-local:
103 rm -rf $(BUILDTIME_DIRS)
106 $(addsuffix /*.py[co],$(DIRS)) \
107 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
108 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
110 $(PYTHON_BOOTSTRAP) \
112 autotools/replace_vars.sed \
113 daemons/daemon-util \
114 daemons/ensure-dirs \
115 daemons/ganeti-cleaner \
117 doc/examples/bash_completion \
118 doc/examples/ganeti.initd \
119 doc/examples/ganeti-kvm-poweroff.initd \
120 doc/examples/ganeti.cron \
121 doc/examples/gnt-config-backup \
122 doc/examples/hooks/ipsec \
127 $(nodist_pkgpython_PYTHON) \
128 $(HALLPROGS) $(HSRCS2) \
129 .hpc/*.mix htools/*.tix
131 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
132 # it'll cause the target to rebuild every time.
140 nodist_pkgpython_PYTHON = \
144 lib/build/__init__.py \
145 lib/build/sphinx_ext.py
149 lib/asyncnotifier.py \
181 lib/client/__init__.py \
182 lib/client/gnt_backup.py \
183 lib/client/gnt_cluster.py \
184 lib/client/gnt_debug.py \
185 lib/client/gnt_group.py \
186 lib/client/gnt_instance.py \
187 lib/client/gnt_job.py \
188 lib/client/gnt_node.py \
191 hypervisor_PYTHON = \
192 lib/hypervisor/__init__.py \
193 lib/hypervisor/hv_base.py \
194 lib/hypervisor/hv_chroot.py \
195 lib/hypervisor/hv_fake.py \
196 lib/hypervisor/hv_kvm.py \
197 lib/hypervisor/hv_lxc.py \
198 lib/hypervisor/hv_xen.py
201 lib/rapi/__init__.py \
202 lib/rapi/baserlib.py \
204 lib/rapi/client_utils.py \
205 lib/rapi/connector.py \
209 lib/http/__init__.py \
215 lib/confd/__init__.py \
216 lib/confd/client.py \
217 lib/confd/querylib.py \
221 lib/masterd/__init__.py \
222 lib/masterd/instance.py
225 lib/impexpd/__init__.py
228 lib/watcher/__init__.py
231 lib/server/__init__.py \
232 lib/server/confd.py \
233 lib/server/masterd.py \
234 lib/server/noded.py \
238 lib/utils/__init__.py \
240 lib/utils/filelock.py \
245 lib/utils/nodesetup.py \
246 lib/utils/process.py \
249 lib/utils/wrapper.py \
258 doc/design-htools-2.3.rst \
260 doc/design-draft.rst \
262 doc/design-query2.rst \
263 doc/cluster-merge.rst \
264 doc/design-shared-storage.rst \
270 doc/install-quick.rst \
273 doc/move-instance.rst \
286 HALLPROGS = $(HPROGS) htools/test
287 HSRCPROGS = $(patsubst %,%.hs,$(HALLPROGS))
288 # we don't add -Werror by default
289 HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
290 # extra flags that can be overriden on the command line
292 # exclude options for coverage reports
293 HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
294 # directory for apidoc
295 HS_APIDOC = doc/hs-apidoc
298 htools/Ganeti/HTools/CLI.hs \
299 htools/Ganeti/HTools/Cluster.hs \
300 htools/Ganeti/HTools/Container.hs \
301 htools/Ganeti/HTools/ExtLoader.hs \
302 htools/Ganeti/HTools/Group.hs \
303 htools/Ganeti/HTools/IAlloc.hs \
304 htools/Ganeti/HTools/Instance.hs \
305 htools/Ganeti/HTools/Loader.hs \
306 htools/Ganeti/HTools/Luxi.hs \
307 htools/Ganeti/HTools/Node.hs \
308 htools/Ganeti/HTools/PeerMap.hs \
309 htools/Ganeti/HTools/QC.hs \
310 htools/Ganeti/HTools/Rapi.hs \
311 htools/Ganeti/HTools/Simu.hs \
312 htools/Ganeti/HTools/Text.hs \
313 htools/Ganeti/HTools/Types.hs \
314 htools/Ganeti/HTools/Utils.hs \
315 htools/Ganeti/Jobs.hs \
316 htools/Ganeti/Luxi.hs \
317 htools/Ganeti/OpCodes.hs
319 HSRCS2 = htools/Ganeti/HTools/Version.hs
320 HSRCS2IN = $(patsubst %,%.in,$(HSRCS2))
322 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
324 # Note: we use here an order-only prerequisite, as the contents of
325 # _autoconf.py are not actually influencing the html build output: it
326 # has to exist in order for the sphinx module to be loaded
327 # successfully, but we certainly don't want the docs to be rebuilt if
329 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
330 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
332 @test -n "$(SPHINX)" || \
333 { echo 'sphinx-build' not found during configure; exit 1; }
335 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
337 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
338 -D release="$(PACKAGE_VERSION)" \
339 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
340 rm -f doc/html/.buildinfo doc/html/objects.inv
343 doc/html: doc/html/index.html
345 doc/install-quick.rst: INSTALL
347 doc/upgrade.rst: UPGRADE
349 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
351 { echo '.. This file is automatically updated at build time from $<.'; \
352 echo '.. Do not edit.'; \
359 doc/design-2.1-lock-acquire.dot \
360 doc/design-2.1-lock-release.dot
362 docpng = $(patsubst %.dot,%.png,$(docdot))
364 # Things to build but not to install (add it to EXTRA_DIST if it should be
369 doc/examples/bash_completion \
370 doc/examples/ganeti.cron \
371 doc/examples/ganeti.initd \
372 doc/examples/ganeti-kvm-poweroff.initd \
373 doc/examples/gnt-config-backup \
374 doc/examples/hooks/ipsec \
379 scripts/gnt-cluster \
382 scripts/gnt-instance \
388 daemons/ganeti-confd \
389 daemons/ganeti-masterd \
390 daemons/ganeti-noded \
391 daemons/ganeti-watcher \
392 daemons/ganeti-rapi \
394 scripts/gnt-cluster \
397 scripts/gnt-instance \
417 iallocators_SCRIPTS =
419 bin_SCRIPTS += $(filter-out htools/hail,$(HPROGS))
420 iallocators_SCRIPTS += $(filter htools/hail,$(HPROGS))
423 $(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) Makefile
424 BINARY=$(@:htools/%=%); \
426 $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
427 -osuf $$BINARY.o -hisuf $$BINARY.hi \
430 # for the htools/test binary, we need to enable profiling/coverage
431 htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
432 -fno-warn-monomorphism-restriction -fno-warn-orphans \
433 -fno-warn-missing-methods -fno-warn-unused-imports
435 dist_sbin_SCRIPTS = \
436 tools/ganeti-listrunner
438 nodist_sbin_SCRIPTS = \
439 $(PYTHON_BOOTSTRAP) \
440 daemons/ganeti-cleaner
442 dist_tools_SCRIPTS = \
447 tools/cluster-merge \
449 tools/move-instance \
451 tools/sanitize-config
453 pkglib_python_scripts = \
454 daemons/import-export \
455 tools/check-cert-expired
458 daemons/daemon-util \
459 daemons/ensure-dirs \
461 $(pkglib_python_scripts)
468 autotools/build-bash-completion \
469 autotools/check-python-code \
470 autotools/check-man \
471 autotools/check-news \
472 autotools/check-tar \
473 autotools/check-version \
475 autotools/gen-coverage \
476 autotools/testrunner \
478 daemons/daemon-util.in \
479 daemons/ensure-dirs.in \
480 daemons/ganeti-cleaner.in \
481 $(pkglib_python_scripts) \
489 doc/examples/ganeti.initd.in \
490 doc/examples/ganeti-kvm-poweroff.initd.in \
491 doc/examples/ganeti.cron.in \
492 doc/examples/gnt-config-backup.in \
493 doc/examples/ganeti.default \
494 doc/examples/ganeti.default-debug \
495 doc/examples/hooks/ethers \
496 doc/examples/hooks/ipsec.in \
497 doc/examples/gnt-debug/README \
498 doc/examples/gnt-debug/delay0.json \
499 doc/examples/gnt-debug/delay50.json \
509 $(HSRCS) $(HSRCS2IN) \
514 man/ganeti-cleaner.8 \
516 man/ganeti-listrunner.8 \
517 man/ganeti-masterd.8 \
519 man/ganeti-os-interface.7 \
521 man/ganeti-watcher.8 \
535 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
536 manhtml = $(patsubst %.rst,%.html,$(manrst))
537 mangen = $(patsubst %.rst,%.gen,$(manrst))
539 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
540 $(patsubst %.html,%.html.in,$(manhtml)) \
541 man/footer.man man/footer.html $(mangen)
544 test/data/bdev-drbd-8.0.txt \
545 test/data/bdev-drbd-8.3.txt \
546 test/data/bdev-drbd-disk.txt \
547 test/data/bdev-drbd-net-ip4.txt \
548 test/data/bdev-drbd-net-ip6.txt \
549 test/data/cert1.pem \
550 test/data/proc_drbd8.txt \
551 test/data/proc_drbd80-emptyline.txt \
552 test/data/proc_drbd83.txt \
553 test/data/sys_drbd_usermode_helper.txt \
554 test/import-export_unittest-helper
557 test/ganeti.asyncnotifier_unittest.py \
558 test/ganeti.backend_unittest.py \
559 test/ganeti.bdev_unittest.py \
560 test/ganeti.cli_unittest.py \
561 test/ganeti.client.gnt_cluster_unittest.py \
562 test/ganeti.client.gnt_instance_unittest.py \
563 test/ganeti.daemon_unittest.py \
564 test/ganeti.cmdlib_unittest.py \
565 test/ganeti.compat_unittest.py \
566 test/ganeti.confd.client_unittest.py \
567 test/ganeti.config_unittest.py \
568 test/ganeti.constants_unittest.py \
569 test/ganeti.errors_unittest.py \
570 test/ganeti.hooks_unittest.py \
571 test/ganeti.ht_unittest.py \
572 test/ganeti.http_unittest.py \
573 test/ganeti.hypervisor_unittest.py \
574 test/ganeti.hypervisor.hv_chroot_unittest.py \
575 test/ganeti.hypervisor.hv_fake_unittest.py \
576 test/ganeti.hypervisor.hv_kvm_unittest.py \
577 test/ganeti.hypervisor.hv_lxc_unittest.py \
578 test/ganeti.hypervisor.hv_xen_unittest.py \
579 test/ganeti.impexpd_unittest.py \
580 test/ganeti.jqueue_unittest.py \
581 test/ganeti.locking_unittest.py \
582 test/ganeti.luxi_unittest.py \
583 test/ganeti.masterd.instance_unittest.py \
584 test/ganeti.mcpu_unittest.py \
585 test/ganeti.netutils_unittest.py \
586 test/ganeti.objects_unittest.py \
587 test/ganeti.opcodes_unittest.py \
588 test/ganeti.qlang_unittest.py \
589 test/ganeti.query_unittest.py \
590 test/ganeti.rapi.baserlib_unittest.py \
591 test/ganeti.rapi.client_unittest.py \
592 test/ganeti.rapi.resources_unittest.py \
593 test/ganeti.rapi.rlib2_unittest.py \
594 test/ganeti.rpc_unittest.py \
595 test/ganeti.runtime_unittest.py \
596 test/ganeti.serializer_unittest.py \
597 test/ganeti.ssh_unittest.py \
598 test/ganeti.uidpool_unittest.py \
599 test/ganeti.utils.algo_unittest.py \
600 test/ganeti.utils.filelock_unittest.py \
601 test/ganeti.utils.hash_unittest.py \
602 test/ganeti.utils.io_unittest.py \
603 test/ganeti.utils.log_unittest.py \
604 test/ganeti.utils.mlock_unittest.py \
605 test/ganeti.utils.nodesetup_unittest.py \
606 test/ganeti.utils.process_unittest.py \
607 test/ganeti.utils.retry_unittest.py \
608 test/ganeti.utils.text_unittest.py \
609 test/ganeti.utils.wrapper_unittest.py \
610 test/ganeti.utils.x509_unittest.py \
611 test/ganeti.utils_unittest.py \
612 test/ganeti.workerpool_unittest.py \
613 test/cfgupgrade_unittest.py \
614 test/docs_unittest.py \
615 test/tempfile_fork_unittest.py
617 haskell_tests = htools/test
620 test/check-cert-expired_unittest.bash \
621 test/daemon-util_unittest.bash \
622 test/ganeti-cleaner_unittest.bash \
623 test/import-export_unittest.bash \
628 nodist_TESTS += $(haskell_tests)
631 TESTS = $(dist_TESTS) $(nodist_TESTS)
633 # Environment for all tests
634 PLAIN_TESTS_ENVIRONMENT = \
635 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
637 # Environment for tests run by automake
638 TESTS_ENVIRONMENT = \
639 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
642 $(dist_sbin_SCRIPTS) \
643 $(dist_tools_SCRIPTS) \
644 $(pkglib_python_scripts) \
646 $(pkgpython_PYTHON) \
648 $(hypervisor_PYTHON) \
662 test/check-cert-expired_unittest.bash \
663 test/daemon-util_unittest.bash \
664 test/ganeti-cleaner_unittest.bash \
665 test/import-export_unittest.bash \
667 $(HSRCS) $(HSRCPROGS)
669 check_python_code = \
670 $(BUILD_BASH_COMPLETION) \
676 ganeti/http/server.py \
677 $(dist_sbin_SCRIPTS) \
678 $(dist_tools_SCRIPTS) \
679 $(pkglib_python_scripts) \
680 $(BUILD_BASH_COMPLETION) \
684 test/daemon-util_unittest.bash: daemons/daemon-util
686 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
688 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
689 sed -f $(REPLACE_VARS_SED) < $< > $@
692 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
693 sed -f $(REPLACE_VARS_SED) < $< > $@
696 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
697 sed -f $(REPLACE_VARS_SED) < $< > $@
700 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
701 sed -f $(REPLACE_VARS_SED) < $< > $@
703 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
704 sed -f $(REPLACE_VARS_SED) < $< > $@
706 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
707 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
708 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
711 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
712 $(DOT) -Tpng -o $@ $<
714 man/footer.man: man/footer.rst
715 @test -n "$(PANDOC)" || \
716 { echo 'pandoc' not found during configure; exit 1; }
717 $(PANDOC) -f rst -t man -o $@ $<
719 man/footer.html: man/footer.rst
720 @test -n "$(PANDOC)" || \
721 { echo 'pandoc' not found during configure; exit 1; }
722 $(PANDOC) -f rst -t html -o $@ $<
724 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
725 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
727 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
728 @test -n "$(PANDOC)" || \
729 { echo 'pandoc' not found during configure; exit 1; }
731 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
732 sed -e 's/\\@/@/g' > $@
733 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
735 man/%.html.in: man/%.gen man/footer.html
736 @test -n "$(PANDOC)" || \
737 { echo 'pandoc' not found during configure; exit 1; }
739 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
740 sed -e 's/\\@/@/g' > $@
742 man/%.1: man/%.1.in $(REPLACE_VARS_SED)
743 sed -f $(REPLACE_VARS_SED) < $< > $@
745 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
746 sed -f $(REPLACE_VARS_SED) < $< > $@
748 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
749 sed -f $(REPLACE_VARS_SED) < $< > $@
751 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
752 sed -f $(REPLACE_VARS_SED) < $< > $@
754 epydoc.conf: epydoc.conf.in Makefile
755 sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
758 if test -d .git; then \
760 elif test ! -f $@ ; then \
761 echo "Cannot auto-generate $@ file"; exit 1; \
764 .PHONY: regen-vcs-version
768 if test -d .git; then \
770 $(MAKE) vcs-version; \
773 htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
775 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
776 sed -e "s/%ver%/$$VCSVER/" < $< > $@
778 lib/_autoconf.py: Makefile vcs-version | lib/.dir
780 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
781 { echo '# This file is automatically generated, do not edit!'; \
784 echo '"""Build-time configuration for Ganeti.'; \
786 echo 'This file is autogenerated by the build process.'; \
787 echo 'For any changes you need to re-run ./configure (and'; \
788 echo 'not edit by hand).'; \
792 echo '# pylint: disable-msg=C0301,C0324'; \
793 echo '# because this is autogenerated, we do not want'; \
794 echo '# style warnings' ; \
796 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
797 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
798 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
799 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
800 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
801 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
802 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
803 echo "SYSCONFDIR = '$(sysconfdir)'"; \
804 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
805 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
806 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
807 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
808 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
809 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
810 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
811 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
812 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
813 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
814 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
815 echo "KVM_PATH = '$(KVM_PATH)'"; \
816 echo "SOCAT_PATH = '$(SOCAT)'"; \
817 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
818 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
819 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
820 echo "TOOLSDIR = '$(toolsdir)'"; \
821 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
822 echo "PKGLIBDIR = '$(pkglibdir)'"; \
823 echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
824 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
825 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
826 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
827 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
828 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
829 echo "RAPI_USER = '$(RAPI_USER)'"; \
830 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
831 echo "CONFD_USER = '$(CONFD_USER)'"; \
832 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
833 echo "NODED_USER = '$(NODED_USER)'"; \
834 echo "VCS_VERSION = '$$VCSVER'"; \
835 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
838 $(REPLACE_VARS_SED): Makefile
840 { echo 's#@PREFIX@#$(prefix)#g'; \
841 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
842 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
843 echo 's#@BINDIR@#$(bindir)#g'; \
844 echo 's#@SBINDIR@#$(sbindir)#g'; \
845 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
846 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
847 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
848 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
849 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
850 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
851 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
852 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
853 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
854 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
855 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
856 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
857 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
858 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
859 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
860 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
861 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
862 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
865 # Using deferred evaluation
866 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
867 daemons/ganeti-watcher: MODULE = ganeti.watcher
868 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
870 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
871 test -n "$(MODULE)" || { echo Missing module; exit 1; }
873 { echo '#!/usr/bin/python'; \
874 echo '# This file is automatically generated, do not edit!'; \
875 echo "# Edit $(MODULE) instead."; \
877 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
879 echo '# pylint: disable-msg=C0103'; \
880 echo '# C0103: Invalid name'; \
883 echo 'import $(MODULE) as main'; \
885 echo '# Temporarily alias commands until bash completion'; \
886 echo '# generator is changed'; \
887 echo 'if hasattr(main, "commands"):'; \
888 echo ' commands = main.commands # pylint: disable-msg=E1101'; \
890 echo 'if __name__ == "__main__":'; \
891 echo ' sys.exit(main.Main())'; \
895 # We need to create symlinks because "make distcheck" will not install Python
896 # files when building.
897 stamp-srclinks: Makefile | $(all_dirfiles)
899 for i in $(srclink_files); do \
900 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
901 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
908 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
911 check-dirs: $(BUILT_SOURCES)
913 find . -type d \( \( -name . \) -o \( \
915 -name autom4te.cache \
916 \) -prune -o -print \) | { \
920 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
921 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
924 for dir in $(DIRS); do \
925 if ! test -d "$$dir"; then \
926 echo "Directory $$dir listed in DIRS does not exist" >&2; \
930 if test -n "$$error"; then exit 1; else exit 0; fi; \
933 check-local: check-dirs
934 $(CHECK_PYTHON_CODE) $(check_python_code)
935 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
936 $(CHECK_NEWS) < $(top_srcdir)/NEWS
939 lint: $(BUILT_SOURCES)
940 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
941 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
942 cd $(top_srcdir)/qa && \
943 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
944 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
946 # a dist hook rule for updating the vcs-version file; this is
947 # hardcoded due to where it needs to build the file...
949 $(MAKE) regen-vcs-version && \
950 rm -f $(top_distdir)/vcs-version && \
951 cp -p $(srcdir)/vcs-version $(top_distdir)
953 # a distcheck hook rule for catching revision control directories
955 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
956 echo "Found revision control files in final archive." 1>&2; \
959 if find $(top_distdir) -name '*.py[co]' | grep .; then \
960 echo "Found Python byte code in final archive." 1>&2; \
963 if find $(top_distdir) -name '*~' | grep .; then \
964 echo "Found backup files in final archive." 1>&2; \
967 # Empty files or directories should not be distributed. They can cause
968 # unnecessary warnings for packagers. Directories used by automake during
969 # distcheck must be excluded.
970 if find $(top_distdir) -empty -and -not \( \
971 -path $(top_distdir)/_build -or \
972 -path $(top_distdir)/_inst \) | grep .; then \
973 echo "Found empty files or directories in final archive." 1>&2; \
976 if test -n "$(BUILD_RELEASE)" && \
977 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
978 echo "Found unreleased version in NEWS." >&2; \
982 # When building a release, stricter checks should be used
983 distcheck-release dist-release: export BUILD_RELEASE = 1
984 distcheck-release: distcheck
988 for i in $(DIST_ARCHIVES); do \
989 echo -n "Checking $$i ... "; \
990 autotools/check-tar < $$i; \
995 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
996 "$(DESTDIR)${localstatedir}/log/ganeti" \
997 "$(DESTDIR)${localstatedir}/run/ganeti"
999 # To avoid conflicts between directory names and other targets, a file inside
1000 # the directory is used to ensure its existence.
1002 @mkdir_p@ $* && touch $@
1005 if WANT_HTOOLSAPIDOC
1006 apidoc: py-apidoc hs-apidoc
1012 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1013 $(RUN_IN_TEMPDIR) epydoc -v \
1014 --conf $(CURDIR)/epydoc.conf \
1015 --output $(CURDIR)/doc/py-apidoc
1018 hs-apidoc: $(HSRCS2)
1019 @test -n "$(HSCOLOUR)" || \
1020 { echo 'HsColour' not found during configure; exit 1; }
1021 @test -n "$(HADDOCK)" || \
1022 { echo 'haddock' not found during configure; exit 1; }
1023 rm -rf $(HS_APIDOC)/*
1024 @mkdir_p@ $(HS_APIDOC)/Ganeti/HTools
1025 $(HSCOLOUR) -print-css > $(HS_APIDOC)/Ganeti/hscolour.css
1026 ln -s ../hscolour.css $(HS_APIDOC)/Ganeti/HTools/hscolour.css
1029 RELSRCS="$(HSRCS:htools/%=%)"; \
1030 for file in $$RELSRCS; do \
1031 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1032 $(HSCOLOUR) -css -anchor $$file > ../$(HS_APIDOC)/$$hfile ; \
1034 $(HADDOCK) --odir ../$(HS_APIDOC) --html --ignore-all-exports -w \
1035 -t ganeti-htools -p haddock-prologue \
1036 --source-module="%{MODULE/.//}.html" \
1037 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1038 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HSRCS:htools/%=%))
1041 TAGS: $(BUILT_SOURCES)
1043 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1044 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1045 -path './qa/*.py' | \
1050 coverage: py-coverage hs-coverage
1052 coverage: py-coverage
1056 py-coverage: $(BUILT_SOURCES) $(python_tests)
1058 COVERAGE_FILE=$(CURDIR)/doc/py-coverage/data \
1059 TEXT_COVERAGE=$(CURDIR)/doc/py-coverage/report.txt \
1060 HTML_COVERAGE=$(CURDIR)/doc/py-coverage \
1061 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1065 hs-coverage: $(haskell_tests)
1066 cd htools && rm -f *.tix *.mix && ./test
1067 mkdir -p doc/hs-coverage
1068 hpc markup --destdir=doc/hs-coverage htools/test $(HPCEXCL)
1069 hpc report htools/test $(HPCEXCL)
1072 commit-check: distcheck lint apidoc
1074 -include ./Makefile.local