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 = \
81 $(BUILDTIME_DIR_AUTOCREATE) \
86 ganeti-[0-9]*.[0-9]*.[0-9]* \
89 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
91 MAINTAINERCLEANFILES = \
94 doc/install-quick.rst \
99 maintainer-clean-local:
100 rm -rf $(BUILDTIME_DIRS)
103 $(addsuffix /*.py[co],$(DIRS)) \
104 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
105 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
107 $(PYTHON_BOOTSTRAP) \
109 autotools/replace_vars.sed \
110 daemons/daemon-util \
111 daemons/ensure-dirs \
112 daemons/ganeti-cleaner \
114 doc/examples/bash_completion \
115 doc/examples/ganeti.initd \
116 doc/examples/ganeti-kvm-poweroff.initd \
117 doc/examples/ganeti.cron \
118 doc/examples/gnt-config-backup \
119 doc/examples/hooks/ipsec \
124 $(nodist_pkgpython_PYTHON) \
125 $(HALLPROGS) $(HSRCS2)
127 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
128 # it'll cause the target to rebuild every time.
136 nodist_pkgpython_PYTHON = \
140 lib/build/__init__.py \
141 lib/build/sphinx_ext.py
145 lib/asyncnotifier.py \
177 lib/client/__init__.py \
178 lib/client/gnt_backup.py \
179 lib/client/gnt_cluster.py \
180 lib/client/gnt_debug.py \
181 lib/client/gnt_group.py \
182 lib/client/gnt_instance.py \
183 lib/client/gnt_job.py \
184 lib/client/gnt_node.py \
187 hypervisor_PYTHON = \
188 lib/hypervisor/__init__.py \
189 lib/hypervisor/hv_base.py \
190 lib/hypervisor/hv_chroot.py \
191 lib/hypervisor/hv_fake.py \
192 lib/hypervisor/hv_kvm.py \
193 lib/hypervisor/hv_lxc.py \
194 lib/hypervisor/hv_xen.py
197 lib/rapi/__init__.py \
198 lib/rapi/baserlib.py \
200 lib/rapi/client_utils.py \
201 lib/rapi/connector.py \
205 lib/http/__init__.py \
211 lib/confd/__init__.py \
212 lib/confd/client.py \
213 lib/confd/querylib.py \
217 lib/masterd/__init__.py \
218 lib/masterd/instance.py
221 lib/impexpd/__init__.py
224 lib/watcher/__init__.py
227 lib/server/__init__.py \
228 lib/server/confd.py \
229 lib/server/masterd.py \
230 lib/server/noded.py \
234 lib/utils/__init__.py \
236 lib/utils/filelock.py \
241 lib/utils/nodesetup.py \
242 lib/utils/process.py \
245 lib/utils/wrapper.py \
254 doc/design-htools-2.3.rst \
256 doc/design-draft.rst \
258 doc/design-query2.rst \
259 doc/cluster-merge.rst \
260 doc/design-shared-storage.rst \
266 doc/install-quick.rst \
269 doc/move-instance.rst \
282 HALLPROGS = $(HPROGS) htools/test
283 HSRCPROGS = $(patsubst %,%.hs,$(HALLPROGS))
284 # we don't add -Werror by default
285 HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
289 htools/Ganeti/HTools/CLI.hs \
290 htools/Ganeti/HTools/Cluster.hs \
291 htools/Ganeti/HTools/Container.hs \
292 htools/Ganeti/HTools/ExtLoader.hs \
293 htools/Ganeti/HTools/Group.hs \
294 htools/Ganeti/HTools/IAlloc.hs \
295 htools/Ganeti/HTools/Instance.hs \
296 htools/Ganeti/HTools/Loader.hs \
297 htools/Ganeti/HTools/Luxi.hs \
298 htools/Ganeti/HTools/Node.hs \
299 htools/Ganeti/HTools/PeerMap.hs \
300 htools/Ganeti/HTools/QC.hs \
301 htools/Ganeti/HTools/Rapi.hs \
302 htools/Ganeti/HTools/Simu.hs \
303 htools/Ganeti/HTools/Text.hs \
304 htools/Ganeti/HTools/Types.hs \
305 htools/Ganeti/HTools/Utils.hs \
306 htools/Ganeti/Jobs.hs \
307 htools/Ganeti/Luxi.hs \
308 htools/Ganeti/OpCodes.hs
310 HSRCS2 = htools/Ganeti/HTools/Version.hs
311 HSRCS2IN = $(patsubst %,%.in,$(HSRCS2))
313 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
315 # Note: we use here an order-only prerequisite, as the contents of
316 # _autoconf.py are not actually influencing the html build output: it
317 # has to exist in order for the sphinx module to be loaded
318 # successfully, but we certainly don't want the docs to be rebuilt if
320 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
321 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
323 @test -n "$(SPHINX)" || \
324 { echo 'sphinx-build' not found during configure; exit 1; }
326 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
328 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
329 -D release="$(PACKAGE_VERSION)" \
330 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
331 rm -f doc/html/.buildinfo doc/html/objects.inv
334 doc/html: doc/html/index.html
336 doc/install-quick.rst: INSTALL
338 doc/upgrade.rst: UPGRADE
340 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
342 { echo '.. This file is automatically updated at build time from $<.'; \
343 echo '.. Do not edit.'; \
350 doc/design-2.1-lock-acquire.dot \
351 doc/design-2.1-lock-release.dot
353 docpng = $(patsubst %.dot,%.png,$(docdot))
355 # Things to build but not to install (add it to EXTRA_DIST if it should be
360 doc/examples/bash_completion \
361 doc/examples/ganeti.cron \
362 doc/examples/ganeti.initd \
363 doc/examples/ganeti-kvm-poweroff.initd \
364 doc/examples/gnt-config-backup \
365 doc/examples/hooks/ipsec \
370 scripts/gnt-cluster \
373 scripts/gnt-instance \
379 daemons/ganeti-confd \
380 daemons/ganeti-masterd \
381 daemons/ganeti-noded \
382 daemons/ganeti-watcher \
383 daemons/ganeti-rapi \
385 scripts/gnt-cluster \
388 scripts/gnt-instance \
408 iallocators_SCRIPTS =
410 bin_SCRIPTS += $(filter-out htools/hail,$(HPROGS))
411 iallocators_SCRIPTS += $(filter htools/hail,$(HPROGS))
414 $(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) Makefile
415 BINARY=$(@:htools/%=%); \
417 $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
418 -osuf $$BINARY.o -hisuf $$BINARY.hi \
421 dist_sbin_SCRIPTS = \
422 tools/ganeti-listrunner
424 nodist_sbin_SCRIPTS = \
425 $(PYTHON_BOOTSTRAP) \
426 daemons/ganeti-cleaner
428 dist_tools_SCRIPTS = \
433 tools/cluster-merge \
435 tools/move-instance \
437 tools/sanitize-config
439 pkglib_python_scripts = \
440 daemons/import-export \
441 tools/check-cert-expired
444 daemons/daemon-util \
445 daemons/ensure-dirs \
447 $(pkglib_python_scripts)
454 autotools/build-bash-completion \
455 autotools/check-python-code \
456 autotools/check-man \
457 autotools/check-news \
458 autotools/check-tar \
459 autotools/check-version \
461 autotools/gen-coverage \
462 autotools/testrunner \
464 daemons/daemon-util.in \
465 daemons/ensure-dirs.in \
466 daemons/ganeti-cleaner.in \
467 $(pkglib_python_scripts) \
475 doc/examples/ganeti.initd.in \
476 doc/examples/ganeti-kvm-poweroff.initd.in \
477 doc/examples/ganeti.cron.in \
478 doc/examples/gnt-config-backup.in \
479 doc/examples/ganeti.default \
480 doc/examples/ganeti.default-debug \
481 doc/examples/hooks/ethers \
482 doc/examples/hooks/ipsec.in \
483 doc/examples/gnt-debug/README \
484 doc/examples/gnt-debug/delay0.json \
485 doc/examples/gnt-debug/delay50.json \
495 $(HSRCS) $(HSRCS2IN) \
500 man/ganeti-cleaner.8 \
502 man/ganeti-listrunner.8 \
503 man/ganeti-masterd.8 \
505 man/ganeti-os-interface.7 \
507 man/ganeti-watcher.8 \
521 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
522 manhtml = $(patsubst %.rst,%.html,$(manrst))
523 mangen = $(patsubst %.rst,%.gen,$(manrst))
525 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
526 $(patsubst %.html,%.html.in,$(manhtml)) \
527 man/footer.man man/footer.html $(mangen)
530 test/data/bdev-drbd-8.0.txt \
531 test/data/bdev-drbd-8.3.txt \
532 test/data/bdev-drbd-disk.txt \
533 test/data/bdev-drbd-net-ip4.txt \
534 test/data/bdev-drbd-net-ip6.txt \
535 test/data/cert1.pem \
536 test/data/proc_drbd8.txt \
537 test/data/proc_drbd80-emptyline.txt \
538 test/data/proc_drbd83.txt \
539 test/data/sys_drbd_usermode_helper.txt \
540 test/import-export_unittest-helper
543 test/ganeti.asyncnotifier_unittest.py \
544 test/ganeti.backend_unittest.py \
545 test/ganeti.bdev_unittest.py \
546 test/ganeti.cli_unittest.py \
547 test/ganeti.client.gnt_cluster_unittest.py \
548 test/ganeti.client.gnt_instance_unittest.py \
549 test/ganeti.daemon_unittest.py \
550 test/ganeti.cmdlib_unittest.py \
551 test/ganeti.compat_unittest.py \
552 test/ganeti.confd.client_unittest.py \
553 test/ganeti.config_unittest.py \
554 test/ganeti.constants_unittest.py \
555 test/ganeti.errors_unittest.py \
556 test/ganeti.hooks_unittest.py \
557 test/ganeti.ht_unittest.py \
558 test/ganeti.http_unittest.py \
559 test/ganeti.hypervisor_unittest.py \
560 test/ganeti.hypervisor.hv_chroot_unittest.py \
561 test/ganeti.hypervisor.hv_fake_unittest.py \
562 test/ganeti.hypervisor.hv_kvm_unittest.py \
563 test/ganeti.hypervisor.hv_lxc_unittest.py \
564 test/ganeti.hypervisor.hv_xen_unittest.py \
565 test/ganeti.impexpd_unittest.py \
566 test/ganeti.jqueue_unittest.py \
567 test/ganeti.locking_unittest.py \
568 test/ganeti.luxi_unittest.py \
569 test/ganeti.masterd.instance_unittest.py \
570 test/ganeti.mcpu_unittest.py \
571 test/ganeti.netutils_unittest.py \
572 test/ganeti.objects_unittest.py \
573 test/ganeti.opcodes_unittest.py \
574 test/ganeti.qlang_unittest.py \
575 test/ganeti.query_unittest.py \
576 test/ganeti.rapi.baserlib_unittest.py \
577 test/ganeti.rapi.client_unittest.py \
578 test/ganeti.rapi.resources_unittest.py \
579 test/ganeti.rapi.rlib2_unittest.py \
580 test/ganeti.rpc_unittest.py \
581 test/ganeti.runtime_unittest.py \
582 test/ganeti.serializer_unittest.py \
583 test/ganeti.ssh_unittest.py \
584 test/ganeti.uidpool_unittest.py \
585 test/ganeti.utils.algo_unittest.py \
586 test/ganeti.utils.filelock_unittest.py \
587 test/ganeti.utils.hash_unittest.py \
588 test/ganeti.utils.io_unittest.py \
589 test/ganeti.utils.log_unittest.py \
590 test/ganeti.utils.mlock_unittest.py \
591 test/ganeti.utils.nodesetup_unittest.py \
592 test/ganeti.utils.process_unittest.py \
593 test/ganeti.utils.retry_unittest.py \
594 test/ganeti.utils.text_unittest.py \
595 test/ganeti.utils.wrapper_unittest.py \
596 test/ganeti.utils.x509_unittest.py \
597 test/ganeti.utils_unittest.py \
598 test/ganeti.workerpool_unittest.py \
599 test/cfgupgrade_unittest.py \
600 test/docs_unittest.py \
601 test/tempfile_fork_unittest.py
604 test/check-cert-expired_unittest.bash \
605 test/daemon-util_unittest.bash \
606 test/ganeti-cleaner_unittest.bash \
607 test/import-export_unittest.bash \
612 TESTS = $(dist_TESTS) $(nodist_TESTS)
614 # Environment for all tests
615 PLAIN_TESTS_ENVIRONMENT = \
616 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
618 # Environment for tests run by automake
619 TESTS_ENVIRONMENT = \
620 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
623 $(dist_sbin_SCRIPTS) \
624 $(dist_tools_SCRIPTS) \
625 $(pkglib_python_scripts) \
627 $(pkgpython_PYTHON) \
629 $(hypervisor_PYTHON) \
643 test/check-cert-expired_unittest.bash \
644 test/daemon-util_unittest.bash \
645 test/ganeti-cleaner_unittest.bash \
646 test/import-export_unittest.bash \
648 $(HSRCS) $(HSRCPROGS)
650 check_python_code = \
651 $(BUILD_BASH_COMPLETION) \
657 ganeti/http/server.py \
658 $(dist_sbin_SCRIPTS) \
659 $(dist_tools_SCRIPTS) \
660 $(pkglib_python_scripts) \
661 $(BUILD_BASH_COMPLETION) \
665 test/daemon-util_unittest.bash: daemons/daemon-util
667 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
669 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
670 sed -f $(REPLACE_VARS_SED) < $< > $@
673 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
674 sed -f $(REPLACE_VARS_SED) < $< > $@
677 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
678 sed -f $(REPLACE_VARS_SED) < $< > $@
681 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
682 sed -f $(REPLACE_VARS_SED) < $< > $@
684 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
685 sed -f $(REPLACE_VARS_SED) < $< > $@
687 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
688 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
689 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
692 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
693 $(DOT) -Tpng -o $@ $<
695 man/footer.man: man/footer.rst
696 @test -n "$(PANDOC)" || \
697 { echo 'pandoc' not found during configure; exit 1; }
698 $(PANDOC) -f rst -t man -o $@ $<
700 man/footer.html: man/footer.rst
701 @test -n "$(PANDOC)" || \
702 { echo 'pandoc' not found during configure; exit 1; }
703 $(PANDOC) -f rst -t html -o $@ $<
705 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
706 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
708 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
709 @test -n "$(PANDOC)" || \
710 { echo 'pandoc' not found during configure; exit 1; }
712 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
713 sed -e 's/\\@/@/g' > $@
714 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
716 man/%.html.in: man/%.gen man/footer.html
717 @test -n "$(PANDOC)" || \
718 { echo 'pandoc' not found during configure; exit 1; }
720 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
721 sed -e 's/\\@/@/g' > $@
723 man/%.1: man/%.1.in $(REPLACE_VARS_SED)
724 sed -f $(REPLACE_VARS_SED) < $< > $@
726 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
727 sed -f $(REPLACE_VARS_SED) < $< > $@
729 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
730 sed -f $(REPLACE_VARS_SED) < $< > $@
732 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
733 sed -f $(REPLACE_VARS_SED) < $< > $@
735 epydoc.conf: epydoc.conf.in Makefile
736 sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
739 if test -d .git; then \
741 elif test ! -f $@ ; then \
742 echo "Cannot auto-generate $@ file"; exit 1; \
745 .PHONY: regen-vcs-version
749 if test -d .git; then \
751 $(MAKE) vcs-version; \
754 htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
756 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
757 sed -e "s/%ver%/$$VCSVER/" < $< > $@
759 lib/_autoconf.py: Makefile vcs-version | lib/.dir
761 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
762 { echo '# This file is automatically generated, do not edit!'; \
765 echo '"""Build-time configuration for Ganeti.'; \
767 echo 'This file is autogenerated by the build process.'; \
768 echo 'For any changes you need to re-run ./configure (and'; \
769 echo 'not edit by hand).'; \
773 echo '# pylint: disable-msg=C0301,C0324'; \
774 echo '# because this is autogenerated, we do not want'; \
775 echo '# style warnings' ; \
777 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
778 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
779 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
780 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
781 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
782 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
783 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
784 echo "SYSCONFDIR = '$(sysconfdir)'"; \
785 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
786 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
787 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
788 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
789 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
790 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
791 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
792 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
793 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
794 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
795 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
796 echo "KVM_PATH = '$(KVM_PATH)'"; \
797 echo "SOCAT_PATH = '$(SOCAT)'"; \
798 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
799 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
800 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
801 echo "TOOLSDIR = '$(toolsdir)'"; \
802 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
803 echo "PKGLIBDIR = '$(pkglibdir)'"; \
804 echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
805 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
806 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
807 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
808 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
809 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
810 echo "RAPI_USER = '$(RAPI_USER)'"; \
811 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
812 echo "CONFD_USER = '$(CONFD_USER)'"; \
813 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
814 echo "NODED_USER = '$(NODED_USER)'"; \
815 echo "VCS_VERSION = '$$VCSVER'"; \
816 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
819 $(REPLACE_VARS_SED): Makefile
821 { echo 's#@PREFIX@#$(prefix)#g'; \
822 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
823 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
824 echo 's#@BINDIR@#$(bindir)#g'; \
825 echo 's#@SBINDIR@#$(sbindir)#g'; \
826 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
827 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
828 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
829 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
830 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
831 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
832 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
833 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
834 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
835 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
836 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
837 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
838 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
839 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
840 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
841 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
842 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
843 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
846 # Using deferred evaluation
847 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
848 daemons/ganeti-watcher: MODULE = ganeti.watcher
849 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
851 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
852 test -n "$(MODULE)" || { echo Missing module; exit 1; }
854 { echo '#!/usr/bin/python'; \
855 echo '# This file is automatically generated, do not edit!'; \
856 echo "# Edit $(MODULE) instead."; \
858 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
860 echo '# pylint: disable-msg=C0103'; \
861 echo '# C0103: Invalid name'; \
864 echo 'import $(MODULE) as main'; \
866 echo '# Temporarily alias commands until bash completion'; \
867 echo '# generator is changed'; \
868 echo 'if hasattr(main, "commands"):'; \
869 echo ' commands = main.commands # pylint: disable-msg=E1101'; \
871 echo 'if __name__ == "__main__":'; \
872 echo ' sys.exit(main.Main())'; \
876 # We need to create symlinks because "make distcheck" will not install Python
877 # files when building.
878 stamp-srclinks: Makefile | $(all_dirfiles)
880 for i in $(srclink_files); do \
881 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
882 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
889 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
892 check-dirs: $(BUILT_SOURCES)
894 find . -type d \( \( -name . \) -o \( \
896 -name autom4te.cache \
897 \) -prune -o -print \) | { \
901 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
902 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
905 for dir in $(DIRS); do \
906 if ! test -d "$$dir"; then \
907 echo "Directory $$dir listed in DIRS does not exist" >&2; \
911 if test -n "$$error"; then exit 1; else exit 0; fi; \
914 check-local: check-dirs
915 $(CHECK_PYTHON_CODE) $(check_python_code)
916 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
917 $(CHECK_NEWS) < $(top_srcdir)/NEWS
920 lint: $(BUILT_SOURCES)
921 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
922 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
923 cd $(top_srcdir)/qa && \
924 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
925 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
927 # a dist hook rule for updating the vcs-version file; this is
928 # hardcoded due to where it needs to build the file...
930 $(MAKE) regen-vcs-version && \
931 rm -f $(top_distdir)/vcs-version && \
932 cp -p $(srcdir)/vcs-version $(top_distdir)
934 # a distcheck hook rule for catching revision control directories
936 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
937 echo "Found revision control files in final archive." 1>&2; \
940 if find $(top_distdir) -name '*.py[co]' | grep .; then \
941 echo "Found Python byte code in final archive." 1>&2; \
944 if find $(top_distdir) -name '*~' | grep .; then \
945 echo "Found backup files in final archive." 1>&2; \
948 # Empty files or directories should not be distributed. They can cause
949 # unnecessary warnings for packagers. Directories used by automake during
950 # distcheck must be excluded.
951 if find $(top_distdir) -empty -and -not \( \
952 -path $(top_distdir)/_build -or \
953 -path $(top_distdir)/_inst \) | grep .; then \
954 echo "Found empty files or directories in final archive." 1>&2; \
957 if test -n "$(BUILD_RELEASE)" && \
958 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
959 echo "Found unreleased version in NEWS." >&2; \
963 # When building a release, stricter checks should be used
964 distcheck-release dist-release: export BUILD_RELEASE = 1
965 distcheck-release: distcheck
969 for i in $(DIST_ARCHIVES); do \
970 echo -n "Checking $$i ... "; \
971 autotools/check-tar < $$i; \
976 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
977 "$(DESTDIR)${localstatedir}/log/ganeti" \
978 "$(DESTDIR)${localstatedir}/run/ganeti"
980 # To avoid conflicts between directory names and other targets, a file inside
981 # the directory is used to ensure its existence.
983 @mkdir_p@ $* && touch $@
986 apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
987 $(RUN_IN_TEMPDIR) epydoc -v \
988 --conf $(CURDIR)/epydoc.conf \
989 --output $(CURDIR)/doc/api
992 TAGS: $(BUILT_SOURCES)
994 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
995 -path './daemons/ganeti-*' -o -path './tools/*' -o \
996 -path './qa/*.py' | \
1000 coverage: $(BUILT_SOURCES) $(python_tests)
1002 COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
1003 TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
1004 HTML_COVERAGE=$(CURDIR)/doc/coverage \
1005 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1008 commit-check: distcheck lint apidoc
1010 -include ./Makefile.local