1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
# guestfs tools
# Copyright (C) 2009-2025 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
include $(top_srcdir)/common-rules.mk
ACLOCAL_AMFLAGS = -I m4
# Common code.
SUBDIRS = gnulib/lib
SUBDIRS += common/utils
SUBDIRS += common/structs
if HAVE_OCAML
SUBDIRS += common/mlstdutils
SUBDIRS += common/mlutils
SUBDIRS += common/mlpcre
endif
SUBDIRS += common/edit
SUBDIRS += common/options
SUBDIRS += common/parallel
SUBDIRS += common/progress
SUBDIRS += common/visit
SUBDIRS += common/windows
if HAVE_OCAML
SUBDIRS += common/mlgettext
SUBDIRS += common/mlprogress
SUBDIRS += common/mlvisit
SUBDIRS += common/mlxml
SUBDIRS += common/mltools
SUBDIRS += common/mldrivers
SUBDIRS += common/mlcustomize
endif
# Data used by the tests.
SUBDIRS += test-data
# Not used but needed.
SUBDIRS += tests
# virt-tools in C.
SUBDIRS += align cat diff df edit format inspector make-fs
if HAVE_OCAML
# OCaml tools. Note 'common/ml*' and 'customize' contain shared code
# used by other OCaml tools, so these must come first.
SUBDIRS += customize
SUBDIRS += builder builder/templates
SUBDIRS += drivers
SUBDIRS += get-kernel
SUBDIRS += resize
SUBDIRS += sparsify
SUBDIRS += sysprep
endif
# bash-completion
SUBDIRS += bash
if HAVE_TOOLS
# Perl tools.
SUBDIRS += win-reg
endif
# Miscellaneous documentation.
SUBDIRS += docs
# After all source files were used we can generate the translation strings
SUBDIRS += po
if HAVE_PO4A
SUBDIRS += po-docs
endif
EXTRA_DIST = \
HACKING \
README \
.gitignore \
.gitpublish \
bugs-in-changelog.sh \
check-mli.sh \
common/.gitignore \
common/README \
lib/guestfs-internal-all.h \
m4/.gitignore \
podcheck.pl \
tmp/.gitignore \
valgrind-suppressions
# When doing 'make dist' update a few files automatically.
#
# po/POTFILES - files with ordinary extensions, but not OCaml files
# po/POTFILES-pl - Perl files that don't end in *.pl, which need a
# special xgettext option [not generated here]
# po/POTFILES-ml - OCaml files, which need a special tool to translate
# po-docs/guestfs-tools-docs.pot
# - combined list of strings from documentation
dist-hook: po/POTFILES po/POTFILES-ml
rm -f po-docs/guestfs-tools-docs.pot
$(MAKE) -C po-docs guestfs-tools-docs.pot
# For more information about translations, see po/Makefile.am.
po/POTFILES: configure.ac
rm -f $@ $@-t
cd $(srcdir); \
find $(DIST_SUBDIRS) -name '*.c' | \
grep -v -E '^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data|bundled)/' | \
grep -v -E '/((guestfs|rc)_protocol\.c|dummy\.c)$$' | \
grep -v -E '^python/utils\.c$$' | \
grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \
grep -v -E '^common/errnostring' | \
grep -v -E '.*-(tests|gperf)\.c$$' | \
LC_ALL=C sort -u > $@-t
mv $@-t $@
po/POTFILES-ml: configure.ac
rm -f $@ $@-t
cd $(srcdir); \
find builder common/ml* customize drivers get-kernel resize sparsify sysprep -name '*.ml' | \
grep -v '^builder/templates/' | \
grep -v -E '.*_tests\.ml$$' | \
LC_ALL=C sort > $@-t
mv $@-t $@
# NB. podwrapper is an internal tool, so the man page mustn't be installed.
# It should be noinst_MANS but that doesn't work.
noinst_DATA = podwrapper.1
podwrapper.1: podwrapper.pl
$(PODWRAPPER) \
--section 1 \
--man $@-t \
--license GPLv2+ \
--warning safe \
$<
mv $@-t $@
# Make clean.
CLEANFILES += \
pod2htm?.tmp
clean-local:
-rm -rf tmp/libguestfs??????
-rm -rf tmp/guestfs.*
-rm -rf tmp/.guestfs-*
-rm -rf tmp/null.*
-find tmp -type s -delete
-find . -name '*~' -delete
# Tests.
TESTS = check-mli.sh
build-test-guests:
$(MAKE) -C test-data/phony-guests check
check-valgrind: build-test-guests
@errors=0; \
for f in `grep -l '^$@:' $(SUBDIRS:%=%/Makefile.am)`; do \
echo $(MAKE) -C `dirname $$f` $@; \
$(MAKE) -C `dirname $$f` $@ || (( errors++ )); \
done; \
exit $$(( $$errors ? 1 : 0 ))
check-slow: build-test-guests
@errors=0; \
for f in `grep -l '^$@:' $(SUBDIRS:%=%/Makefile.am)`; do \
echo $(MAKE) -C `dirname $$f` $@; \
$(MAKE) -C `dirname $$f` $@ || (( errors++ )); \
done; \
exit $$(( $$errors ? 1 : 0 ))
# Commit everything in current directory to HEAD, and set commit
# message to current version (only for maintainer).
maintainer-commit:
git commit -a -m "Version $(VERSION)."
# Tag HEAD with current version (only for maintainer).
maintainer-tag:
git tag -a "v$(VERSION)" -m "Version $(VERSION)" -f
# Maintainer only: check no files are missing from EXTRA_DIST rules,
# and that all generated files have been included in the tarball.
# (Note you must have done 'make dist')
maintainer-check-extra-dist:
zcat $(PACKAGE_NAME)-$(VERSION).tar.gz | tar tf - | sort | \
sed 's,^$(PACKAGE_NAME)-$(VERSION)/,,' > tmp/tarfiles
( git ls-files ; \
cd common; git ls-files | sed 's,^,common/,' ) | \
grep -v '^common$$' | \
grep -v '^common/errnostring/' | \
grep -v '^common/protocol/' | \
grep -v '^common/qemuopts/' | \
grep -v '^intltool-.*\.in' | \
grep -v '^\.gitmodules' | \
grep -v '^\.gnulib' | \
sort > tmp/gitfiles
comm -13 tmp/tarfiles tmp/gitfiles > tmp/comm-out
@echo Checking for differences between EXTRA_DIST and git ...
cat tmp/comm-out
[ ! -s tmp/comm-out ]
rm tmp/tarfiles tmp/gitfiles tmp/comm-out
@echo PASS: EXTRA_DIST tests
|