Richard W.M. Jones
2016-Aug-25 14:53 UTC
[Libguestfs] [PATCH] build: Add common CLEANFILES and DISTCLEANFILES to common-rules.mk.
By adding common CLEANFILES and DISTCLEANFILES variables to common-rules.mk, we can remove these from most other Makefiles, and also clean files more consistently. Note that bin_PROGRAMS are already cleaned by 'make clean', so I removed cases where these were unnecessarily added to CLEANFILES. --- .gitignore | 1 + Makefile.am | 6 +---- align/Makefile.am | 4 ---- appliance/Makefile.am | 8 +------ bash/Makefile.am | 2 +- builder/Makefile.am | 20 +---------------- builder/website/Makefile.am | 2 -- cat/Makefile.am | 10 --------- common-rules.mk | 42 +++++++++++++++++++++++++++++++++++ customize/Makefile.am | 7 ------ daemon/Makefile.am | 4 ---- df/Makefile.am | 4 ---- dib/Makefile.am | 8 ------- diff/Makefile.am | 4 ---- docs/Makefile.am | 22 ++---------------- edit/Makefile.am | 4 ---- erlang/Makefile.am | 6 ++--- erlang/examples/Makefile.am | 4 ---- examples/Makefile.am | 4 ---- fish/Makefile.am | 14 ------------ format/Makefile.am | 4 ---- fuse/Makefile.am | 6 ----- generator/Makefile.am | 4 ++-- get-kernel/Makefile.am | 8 ------- gobject/Makefile.am | 4 ++-- golang/Makefile.am | 2 +- golang/examples/Makefile.am | 4 ---- haskell/Makefile.am | 2 +- inspector/Makefile.am | 4 ---- java/Makefile.am | 3 +-- java/examples/Makefile.am | 6 ++--- lua/Makefile.am | 4 +--- lua/examples/Makefile.am | 4 ---- make-fs/Makefile.am | 4 ---- mllib/Makefile.am | 6 ----- ocaml/Makefile.am | 4 +--- ocaml/examples/Makefile.am | 7 ++---- p2v/Makefile.am | 12 ++-------- perl/Makefile.am | 6 ++--- perl/examples/Makefile.am | 4 ---- po-docs/Makefile.am | 2 +- po-docs/language.mk | 2 -- podwrapper.pl.in | 2 -- python/Makefile.am | 5 ++--- python/examples/Makefile.am | 6 ++--- rescue/Makefile.am | 4 ---- resize/Makefile.am | 8 ------- ruby/Makefile.am | 2 +- ruby/examples/Makefile.am | 4 ---- sparsify/Makefile.am | 8 ------- src/Makefile.am | 10 ++++++--- src/libguestfs.3 | 1 - sysprep/Makefile.am | 8 ------- test-data/Makefile.am | 2 +- test-data/blank-disks/Makefile.am | 2 +- test-data/fake-virtio-win/Makefile.am | 2 +- test-data/files/Makefile.am | 2 +- test-data/phony-guests/Makefile.am | 4 ++-- test-tool/Makefile.am | 2 -- tests/c-api/Makefile.am | 2 +- tests/syslinux/Makefile.am | 2 +- tests/xml/Makefile.am | 2 -- tools/Makefile.am | 6 ----- v2v/Makefile.am | 12 ---------- v2v/test-harness/Makefile.am | 17 -------------- 65 files changed, 89 insertions(+), 302 deletions(-) delete mode 100644 src/libguestfs.3 diff --git a/.gitignore b/.gitignore index 711782c..a97fe11 100644 --- a/.gitignore +++ b/.gitignore @@ -485,6 +485,7 @@ Makefile.in /src/guestfs_protocol.h /src/guestfs_protocol.x /src/guestfs-structs.pod +/src/libguestfs.3 /src/libguestfs.pc /src/libguestfs.syms /src/.libs/libguestfs.so diff --git a/Makefile.am b/Makefile.am index acc6bd4..b7a4fd7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -366,10 +366,8 @@ podwrapper.1: podwrapper.pl # Make clean. -CLEANFILES = \ - *~ \ +CLEANFILES += \ pod2htm?.tmp \ - podwrapper.1 \ qemu-wrapper.sh \ tmp/disk* \ tmp/run-* \ @@ -384,8 +382,6 @@ clean-local: -rm -rf tmp/null.* -find tmp -type s -delete -find . -name '*~' -delete - -find . -name '*.bak' -delete - -find . -name '*.orig' -delete # If you don't want to run all of the tests ('make check') then this # will just run libguestfs-test-tool for a quick check. Note this diff --git a/align/Makefile.am b/align/Makefile.am index 2b4dee4..1eccf28 100644 --- a/align/Makefile.am +++ b/align/Makefile.am @@ -23,10 +23,6 @@ EXTRA_DIST = \ test-virt-alignment-scan-guests.sh \ virt-alignment-scan.pod -CLEANFILES = \ - stamp-virt-alignment-scan.pod \ - virt-alignment-scan.1 - bin_PROGRAMS = virt-alignment-scan SHARED_SOURCE_FILES = \ diff --git a/appliance/Makefile.am b/appliance/Makefile.am index e23778e..08a7f4c 100644 --- a/appliance/Makefile.am +++ b/appliance/Makefile.am @@ -155,13 +155,7 @@ stamp-libguestfs-make-fixed-appliance.pod: libguestfs-make-fixed-appliance.pod # Make clean. -CLEANFILES = \ - *~ \ - libguestfs-make-fixed-appliance.1 \ - stamp-libguestfs-make-fixed-appliance.pod - -DISTCLEANFILES = \ +DISTCLEANFILES += \ make.sh \ packagelist \ - stamp-supermin \ supermin.d/* diff --git a/bash/Makefile.am b/bash/Makefile.am index e07c865..4968679 100644 --- a/bash/Makefile.am +++ b/bash/Makefile.am @@ -56,7 +56,7 @@ EXTRA_DIST = \ README \ $(scripts) -CLEANFILES = \ +CLEANFILES += \ $(symlinks) # Any tool that has --short-options and --long-options is handled by diff --git a/builder/Makefile.am b/builder/Makefile.am index 328775c..7983223 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -40,18 +40,6 @@ EXTRA_DIST = \ virt-index-validate.pod \ yajl_tests.ml -CLEANFILES = \ - *~ \ - *.annot \ - *.cache \ - *.cmi \ - *.cmo \ - *.cmx \ - *.cmxa \ - *.log \ - *.o \ - virt-builder - SOURCES_MLI = \ cache.mli \ cmdline.mli \ @@ -194,8 +182,6 @@ stamp-virt-builder.pod: virt-builder.pod $(top_srcdir)/customize/customize-synop $< touch $@ -CLEANFILES += stamp-virt-builder.pod virt-builder.1 - # Tests. TESTS_ENVIRONMENT = $(top_builddir)/run --test @@ -290,8 +276,6 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs # virt-builder's default repository @@ -343,9 +327,7 @@ stamp-virt-index-validate.pod: virt-index-validate.pod CLEANFILES += \ index-parse.c \ index-parse.h \ - index-scan.c \ - stamp-virt-index-validate.pod \ - virt-index-validate.1 + index-scan.c if HAVE_OCAML # Automake-generated makefile has a rule ".y.c" but lacks a rule ".y.h". diff --git a/builder/website/Makefile.am b/builder/website/Makefile.am index 7650ce5..df2f194 100644 --- a/builder/website/Makefile.am +++ b/builder/website/Makefile.am @@ -44,8 +44,6 @@ EXTRA_DIST = \ ubuntu.sh \ ubuntu-ppc64le.sh -CLEANFILES = *~ - # Validates the index file. TESTS_ENVIRONMENT = $(top_builddir)/run --test TESTS = validate.sh diff --git a/cat/Makefile.am b/cat/Makefile.am index 266e1c5..38faa94 100644 --- a/cat/Makefile.am +++ b/cat/Makefile.am @@ -28,16 +28,6 @@ EXTRA_DIST = \ test-virt-ls.sh \ virt-ls.pod -CLEANFILES = \ - stamp-virt-cat.pod \ - stamp-virt-filesystems.pod \ - stamp-virt-log.pod \ - stamp-virt-ls.pod \ - virt-cat.1 \ - virt-filesystems.1 \ - virt-log.1 \ - virt-ls.1 - bin_PROGRAMS = virt-cat virt-filesystems virt-log virt-ls SHARED_SOURCE_FILES = \ diff --git a/common-rules.mk b/common-rules.mk index e6b40d1..fd136ed 100644 --- a/common-rules.mk +++ b/common-rules.mk @@ -19,3 +19,45 @@ # cf. 'subdir-rules.mk' -include $(top_builddir)/localenv + +# Files that should universally be removed by 'make clean'. Note if +# there is any case in any subdirectory where a file should not be +# removed by 'make clean', it should not be listed here! + +# Emacs backup files +CLEANFILES = *~ + +# Other backup files. +CLEANFILES += *.bak + +# Patch original and reject files. +CLEANFILES += *.orig *.rej + +# C intermediate and generated files. +# NB don't remove *.so files! +CLEANFILES += *.o *.a + +# Libtool cruft. +CLEANFILES += *.lo *.la + +# OCaml intermediate and generated files. +CLEANFILES += *.cmi *.cmo *.cma *.cmx *.cmxa dll*.so + +# OCaml -annot files (used for displaying types in some IDEs). +CLEANFILES += *.annot + +# OCaml oUnit generated files. +CLEANFILES += oUnit-*.cache oUnit-*.log + +# Manual pages - these are all generated from *.pod, so the +# pages themselves should all be removed by 'make clean'. +CLEANFILES += *.1 *.3 *.5 *.8 + +# Stamp files used when generating man pages. +CLEANFILES += stamp-*.pod + +# Bindtests temporary files used in many language bindings. +CLEANFILES += bindtests.tmp + +# Files that should be universally removed by 'make distclean'. +DISTCLEANFILES = .depend stamp-* diff --git a/customize/Makefile.am b/customize/Makefile.am index a4d537f..a76b6c5 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -25,11 +25,6 @@ EXTRA_DIST = \ test-virt-customize-docs.sh \ virt-customize.pod -CLEANFILES = \ - *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o dll*.so \ - stamp-virt-customize.pod \ - virt-customize virt-customize.1 - generator_built = \ customize_cmdline.mli \ customize_cmdline.ml \ @@ -219,6 +214,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 7d82371..df93d7e 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -17,10 +17,6 @@ include $(top_srcdir)/subdir-rules.mk -CLEANFILES = \ - stamp-guestfsd.pod \ - guestfsd.8 - generator_built = \ actions.h \ stubs.c \ diff --git a/df/Makefile.am b/df/Makefile.am index cbfb160..ce1686a 100644 --- a/df/Makefile.am +++ b/df/Makefile.am @@ -24,10 +24,6 @@ EXTRA_DIST = \ test-virt-df-guests.sh \ virt-df.pod -CLEANFILES = \ - stamp-virt-df.pod \ - virt-df.1 - bin_PROGRAMS = virt-df SHARED_SOURCE_FILES = \ diff --git a/dib/Makefile.am b/dib/Makefile.am index 7d39d89..2ac362f 100644 --- a/dib/Makefile.am +++ b/dib/Makefile.am @@ -22,8 +22,6 @@ EXTRA_DIST = \ test-virt-dib-docs.sh \ virt-dib.pod -CLEANFILES = *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o virt-dib - SOURCES_MLI = \ cmdline.mli @@ -120,10 +118,6 @@ stamp-virt-dib.pod: virt-dib.pod $< touch $@ -CLEANFILES += \ - stamp-virt-dib.pod \ - virt-dib.1 - # Dependencies. depend: .depend @@ -140,6 +134,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs diff --git a/diff/Makefile.am b/diff/Makefile.am index 87d18c5..cdbe05c 100644 --- a/diff/Makefile.am +++ b/diff/Makefile.am @@ -22,10 +22,6 @@ EXTRA_DIST = \ test-virt-diff-docs.sh \ virt-diff.pod -CLEANFILES = \ - stamp-virt-diff.pod \ - virt-diff.1 - bin_PROGRAMS = virt-diff SHARED_SOURCE_FILES = \ diff --git a/docs/Makefile.am b/docs/Makefile.am index 40c6993..b67735b 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -31,26 +31,8 @@ EXTRA_DIST = \ make-internal-documentation.pl \ README -CLEANFILES = \ - guestfs-building.1 \ - guestfs-faq.1 \ - guestfs-hacking.1 \ - guestfs-internals.1 \ - guestfs-performance.1 \ - guestfs-recipes.1 \ - guestfs-release-notes.1 \ - guestfs-security.1 \ - guestfs-testing.1 \ - internal-documentation.pod \ - stamp-guestfs-building.pod \ - stamp-guestfs-faq.pod \ - stamp-guestfs-hacking.pod \ - stamp-guestfs-internals.pod \ - stamp-guestfs-performance.pod \ - stamp-guestfs-recipes.pod \ - stamp-guestfs-release-notes.pod \ - stamp-guestfs-security.pod \ - stamp-guestfs-testing.pod +CLEANFILES += \ + internal-documentation.pod man_MANS = \ guestfs-building.1 \ diff --git a/edit/Makefile.am b/edit/Makefile.am index 709bfca..4ac4f08 100644 --- a/edit/Makefile.am +++ b/edit/Makefile.am @@ -22,10 +22,6 @@ EXTRA_DIST = \ test-virt-edit-docs.sh \ virt-edit.pod -CLEANFILES = \ - stamp-virt-edit.pod \ - virt-edit.1 - bin_PROGRAMS = virt-edit SHARED_SOURCE_FILES = \ diff --git a/erlang/Makefile.am b/erlang/Makefile.am index 7dc0906..fb1a3dc 100644 --- a/erlang/Makefile.am +++ b/erlang/Makefile.am @@ -28,10 +28,8 @@ EXTRA_DIST = \ tests/*.erl \ README -CLEANFILES = \ - $(erlang_bin_DATA) \ - $(bin_PROGRAMS) \ - bindtests.tmp +CLEANFILES += \ + $(erlang_bin_DATA) # Erlang makes a new libguestfs-<VERSION>/ebin subdirectory each time # we build, so we have to remove that and any previous copies. diff --git a/erlang/examples/Makefile.am b/erlang/examples/Makefile.am index 0d2a3c9..da7fc43 100644 --- a/erlang/examples/Makefile.am +++ b/erlang/examples/Makefile.am @@ -23,10 +23,6 @@ EXTRA_DIST = \ inspect_vm.erl \ guestfs-erlang.pod -CLEANFILES = \ - guestfs-erlang.3 \ - stamp-guestfs-erlang.pod - man_MANS = guestfs-erlang.3 noinst_DATA = $(top_builddir)/website/guestfs-erlang.3.html diff --git a/examples/Makefile.am b/examples/Makefile.am index 26ed938..0abc039 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -29,10 +29,6 @@ EXTRA_DIST = \ mount-local.c \ virt-dhcp-address.c -CLEANFILES = \ - guestfs-examples.3 \ - stamp-guestfs-examples.pod - noinst_PROGRAMS = create-disk debug-logging display-icon inspect-vm if HAVE_LIBVIRT noinst_PROGRAMS += copy-over libvirt-auth diff --git a/fish/Makefile.am b/fish/Makefile.am index 1e3c1d9..a6de568 100644 --- a/fish/Makefile.am +++ b/fish/Makefile.am @@ -17,20 +17,6 @@ include $(top_srcdir)/subdir-rules.mk -CLEANFILES = \ - guestfish.1 \ - libguestfs-tools.conf.5 \ - stamp-guestfish.pod \ - stamp-libguestfs-tools.conf.pod \ - stamp-virt-copy-in.pod \ - stamp-virt-copy-out.pod \ - stamp-virt-tar-in.pod \ - stamp-virt-tar-out.pod \ - virt-copy-in.1 \ - virt-copy-out.1 \ - virt-tar-in.1 \ - virt-tar-out.1 - bin_PROGRAMS = guestfish generator_built = \ diff --git a/format/Makefile.am b/format/Makefile.am index d955e35..d196910 100644 --- a/format/Makefile.am +++ b/format/Makefile.am @@ -22,10 +22,6 @@ EXTRA_DIST = \ test-virt-format.sh \ virt-format.pod -CLEANFILES = \ - stamp-virt-format.pod \ - virt-format.1 - bin_PROGRAMS = virt-format SHARED_SOURCE_FILES = \ diff --git a/fuse/Makefile.am b/fuse/Makefile.am index b22c785..d766479 100644 --- a/fuse/Makefile.am +++ b/fuse/Makefile.am @@ -24,12 +24,6 @@ EXTRA_DIST = \ test-fuse-umount-race.sh \ test-guestunmount-not-mounted.sh -CLEANFILES = \ - guestmount.1 \ - guestunmount.1 \ - stamp-guestmount.pod \ - stamp-guestunmount.pod - if HAVE_FUSE bin_PROGRAMS = \ diff --git a/generator/Makefile.am b/generator/Makefile.am index a5ff516..31c33fa 100644 --- a/generator/Makefile.am +++ b/generator/Makefile.am @@ -174,8 +174,8 @@ stamp-generator: generator cd $(top_srcdir) && $(abs_builddir)/generator touch $@ -CLEANFILES = $(noinst_DATA) $(noinst_PROGRAM) *.cmi *.cmo *~ +CLEANFILES += $(noinst_DATA) $(noinst_PROGRAM) -DISTCLEANFILES = .depend .pod2text.data.version.2 +DISTCLEANFILES += .pod2text.data.version.2 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly diff --git a/get-kernel/Makefile.am b/get-kernel/Makefile.am index d0077f1..55b3577 100644 --- a/get-kernel/Makefile.am +++ b/get-kernel/Makefile.am @@ -22,8 +22,6 @@ EXTRA_DIST = \ test-virt-get-kernel-docs.sh \ virt-get-kernel.pod -CLEANFILES = *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o virt-get-kernel - SOURCES_ML = \ get_kernel.ml @@ -116,10 +114,6 @@ stamp-virt-get-kernel.pod: virt-get-kernel.pod $< touch $@ -CLEANFILES += \ - stamp-virt-get-kernel.pod \ - virt-get-kernel.1 - # Dependencies. depend: .depend @@ -136,6 +130,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend diff --git a/gobject/Makefile.am b/gobject/Makefile.am index c46b6e2..c47d65a 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -41,8 +41,8 @@ EXTRA_DIST = \ # Remove the old generated files which were directly in the gobject/ # directory. These have now moved into gobject/src/ -CLEANFILES = \ - guestfs-gobject*.c *.o *.lo +CLEANFILES += \ + guestfs-gobject*.c libname = libguestfs-gobject-1.0.la diff --git a/golang/Makefile.am b/golang/Makefile.am index 58cafc6..6afa97c 100644 --- a/golang/Makefile.am +++ b/golang/Makefile.am @@ -59,7 +59,7 @@ TESTS = run-bindtests run-tests endif -CLEANFILES = *~ src/$(pkg)/*~ +CLEANFILES += src/$(pkg)/*~ clean-local: rm -rf pkg diff --git a/golang/examples/Makefile.am b/golang/examples/Makefile.am index 0b8286d..88bab10 100644 --- a/golang/examples/Makefile.am +++ b/golang/examples/Makefile.am @@ -23,10 +23,6 @@ EXTRA_DIST = \ inspect-vm.go \ guestfs-golang.pod -CLEANFILES = \ - guestfs-golang.3 \ - stamp-guestfs-golang.pod - man_MANS = guestfs-golang.3 noinst_DATA = $(top_builddir)/website/guestfs-golang.3.html diff --git a/haskell/Makefile.am b/haskell/Makefile.am index 64f54bf..b09b06b 100644 --- a/haskell/Makefile.am +++ b/haskell/Makefile.am @@ -87,7 +87,7 @@ built_tests = Bindtests Guestfs010Load Guestfs030Config Guestfs050LVCreate $(built_tests): %: %.hs Guestfs.hs $(GHC) $(GHCFLAGS) --make -main-is $@ -odir .$@ -o $@ $< $(srcdir)/Guestfs.hs -lguestfs -CLEANFILES = $(all_targets) *~ *.hi *.o test-lv-create.img +CLEANFILES += $(all_targets) *.hi test-lv-create.img clean-local: -rm -rf $(built_tests:%=.%) diff --git a/inspector/Makefile.am b/inspector/Makefile.am index af596bf..00ca5d5 100644 --- a/inspector/Makefile.am +++ b/inspector/Makefile.am @@ -45,10 +45,6 @@ EXTRA_DIST = \ test-xmllint.sh.in \ virt-inspector.pod -CLEANFILES = \ - stamp-virt-inspector.pod \ - virt-inspector.1 - docdir = @docdir@ dist_doc_DATA = \ virt-inspector.rng \ diff --git a/java/Makefile.am b/java/Makefile.am index c7db29d..83c4a30 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -56,8 +56,7 @@ EXTRA_DIST = \ run-java-tests \ Makefile.inc -CLEANFILES = \ - bindtests.tmp \ +CLEANFILES += \ com/redhat/et/libguestfs/*.class \ com_redhat_et_libguestfs_GuestFS.h \ doc-stamp \ diff --git a/java/examples/Makefile.am b/java/examples/Makefile.am index 9766d9b..c6767e6 100644 --- a/java/examples/Makefile.am +++ b/java/examples/Makefile.am @@ -23,10 +23,8 @@ EXTRA_DIST = \ InspectVM.java \ guestfs-java.pod -CLEANFILES = \ - *.class \ - guestfs-java.3 \ - stamp-guestfs-java.pod +CLEANFILES += \ + *.class man_MANS = guestfs-java.3 noinst_DATA = $(top_builddir)/website/guestfs-java.3.html diff --git a/lua/Makefile.am b/lua/Makefile.am index 264f170..5c2efca 100644 --- a/lua/Makefile.am +++ b/lua/Makefile.am @@ -27,9 +27,7 @@ EXTRA_DIST = \ $(generator_built) \ run-bindtests -CLEANFILES = \ - *~ \ - bindtests.tmp \ +CLEANFILES += \ guestfs.so if HAVE_LUA diff --git a/lua/examples/Makefile.am b/lua/examples/Makefile.am index dad5793..239f92c 100644 --- a/lua/examples/Makefile.am +++ b/lua/examples/Makefile.am @@ -23,10 +23,6 @@ EXTRA_DIST = \ inspect_vm.lua \ guestfs-lua.pod -CLEANFILES = \ - guestfs-lua.3 \ - stamp-guestfs-lua.pod - man_MANS = guestfs-lua.3 noinst_DATA = $(top_builddir)/website/guestfs-lua.3.html diff --git a/make-fs/Makefile.am b/make-fs/Makefile.am index ea723af..f4cf0f1 100644 --- a/make-fs/Makefile.am +++ b/make-fs/Makefile.am @@ -22,10 +22,6 @@ EXTRA_DIST = \ test-virt-make-fs-docs.sh \ virt-make-fs.pod -CLEANFILES = \ - stamp-virt-make-fs.pod \ - virt-make-fs.1 - bin_PROGRAMS = virt-make-fs SHARED_SOURCE_FILES = \ diff --git a/mllib/Makefile.am b/mllib/Makefile.am index 69df1bc..e93771e 100644 --- a/mllib/Makefile.am +++ b/mllib/Makefile.am @@ -26,8 +26,6 @@ EXTRA_DIST = \ JSON_tests.ml \ test-getopt.sh -CLEANFILES = *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o dll*.so - SOURCES_MLI = \ common_utils.mli \ curl.mli \ @@ -245,8 +243,6 @@ check_PROGRAMS += common_utils_tests JSON_tests TESTS += common_utils_tests JSON_tests endif -CLEANFILES += oUnit-* - check-valgrind: $(MAKE) VG="$(top_builddir)/run @VG@" check @@ -266,6 +262,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index 501ac69..100b046 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -33,7 +33,7 @@ EXTRA_DIST = \ run-bindtests \ t/*.ml -CLEANFILES = *.annot *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so +CLEANFILES += *.so CLEANFILES += t/*.annot t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so if HAVE_OCAML @@ -169,8 +169,6 @@ endif check-valgrind: $(MAKE) VG="@VG@" TESTS="$(test_progs_all)" check -CLEANFILES += bindtests.tmp - # Dependencies. %.cmi: %.mli $(guestfs_am_v_ocamlc)$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix -c $< -o $@ diff --git a/ocaml/examples/Makefile.am b/ocaml/examples/Makefile.am index 5f4177c..29c9466 100644 --- a/ocaml/examples/Makefile.am +++ b/ocaml/examples/Makefile.am @@ -24,11 +24,8 @@ EXTRA_DIST = \ inspect_vm.ml \ guestfs-ocaml.pod -CLEANFILES = \ - $(noinst_SCRIPTS) \ - *.cmi *.cmo *.cmx *.o \ - guestfs-ocaml.3 \ - stamp-guestfs-ocaml.pod +CLEANFILES += \ + $(noinst_SCRIPTS) man_MANS = guestfs-ocaml.3 noinst_DATA = $(top_builddir)/website/guestfs-ocaml.3.html diff --git a/p2v/Makefile.am b/p2v/Makefile.am index d1dcc34..5cac334 100644 --- a/p2v/Makefile.am +++ b/p2v/Makefile.am @@ -40,24 +40,16 @@ EXTRA_DIST = \ # Don't clean ssh_host_rsa_key{,.pub} or id_rsa{,.pub} since those # consume system entropy to regenerate. -CLEANFILES = \ +CLEANFILES += \ $(dependencies_files) \ stamp-test-virt-p2v-pxe-data-files \ stamp-test-virt-p2v-pxe-kernel \ - stamp-virt-p2v.pod \ - stamp-virt-p2v-make-disk.pod \ - stamp-virt-p2v-make-kickstart.pod \ - stamp-virt-p2v-make-kiwi.pod \ test-virt-p2v-pxe.authorized_keys \ test-virt-p2v-pxe.img \ test-virt-p2v-pxe.vmlinuz \ test-virt-p2v-pxe.initramfs \ test-virt-p2v-pxe.sshd_config \ - virt-p2v.1 \ - virt-p2v.img \ - virt-p2v-make-disk.1 \ - virt-p2v-make-kickstart.1 \ - virt-p2v-make-kiwi.1 + virt-p2v.img # Although virt-p2v is a regular binary, it is not usually installed # in /usr/bin since it only functions when contained in an ISO or PXE diff --git a/perl/Makefile.am b/perl/Makefile.am index ed35459..f76f3df 100644 --- a/perl/Makefile.am +++ b/perl/Makefile.am @@ -34,12 +34,10 @@ EXTRA_DIST = \ t/*.t \ typemap -DISTCLEANFILES = Build +DISTCLEANFILES += Build # Some files are not removed by './Build clean' below. -CLEANFILES = \ - *.o \ - bindtests.tmp \ +CLEANFILES += \ MYMETA.json \ MYMETA.yml \ pm_to_blib diff --git a/perl/examples/Makefile.am b/perl/examples/Makefile.am index c58ef16..7b4c29d 100644 --- a/perl/examples/Makefile.am +++ b/perl/examples/Makefile.am @@ -23,10 +23,6 @@ EXTRA_DIST = \ inspect_vm.pl \ guestfs-perl.pod -CLEANFILES = \ - guestfs-perl.3 \ - stamp-guestfs-perl.pod - man_MANS = guestfs-perl.3 noinst_DATA = $(top_builddir)/website/guestfs-perl.3.html diff --git a/po-docs/Makefile.am b/po-docs/Makefile.am index 639ed69..ac87615 100644 --- a/po-docs/Makefile.am +++ b/po-docs/Makefile.am @@ -35,7 +35,7 @@ EXTRA_DIST = \ $(linguas_not_translated:%=%.po) \ podfiles -CLEANFILES = po4a.conf +CLEANFILES += po4a.conf # Build the final man pages from the translated POD files. Each # language directory contains a Makefile.am that we need to keep up to diff --git a/po-docs/language.mk b/po-docs/language.mk index f7a44f3..3eeb058 100644 --- a/po-docs/language.mk +++ b/po-docs/language.mk @@ -21,8 +21,6 @@ include $(top_srcdir)/subdir-rules.mk LINGUA = $(shell basename -- `pwd`) -CLEANFILES = *.1 *.3 *.5 - # Before 1.23.23, the old Perl tools were called *.pl. CLEANFILES += *.pl diff --git a/podwrapper.pl.in b/podwrapper.pl.in index e9cafed..8f278de 100755 --- a/podwrapper.pl.in +++ b/podwrapper.pl.in @@ -50,8 +50,6 @@ podwrapper.pl - Generate libguestfs documentation from POD input files --warning general \ $< touch $@ - - CLEANFILES += stamp-virt-foo.pod =head1 DESCRIPTION diff --git a/python/Makefile.am b/python/Makefile.am index f77dd17..718a123 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -114,11 +114,10 @@ endif ENABLE_APPLIANCE endif HAVE_PYTHON # Extra clean. -CLEANFILES = \ - *~ *.pyc \ +CLEANFILES += \ + *.pyc \ examples/*~ examples/*.pyc \ t/*~ t/*.pyc \ - bindtests.tmp \ config.h \ guestfs-internal-all.h \ guestfs-internal-frontend-cleanups.h \ diff --git a/python/examples/Makefile.am b/python/examples/Makefile.am index fac8301..fc23b91 100644 --- a/python/examples/Makefile.am +++ b/python/examples/Makefile.am @@ -23,11 +23,9 @@ EXTRA_DIST = \ inspect_vm.py \ guestfs-python.pod -CLEANFILES = \ +CLEANFILES += \ *.pyc \ - *.pyo \ - guestfs-python.3 \ - stamp-guestfs-python.pod + *.pyo man_MANS = guestfs-python.3 noinst_DATA = $(top_builddir)/website/guestfs-python.3.html diff --git a/rescue/Makefile.am b/rescue/Makefile.am index 58564dc..c2545bd 100644 --- a/rescue/Makefile.am +++ b/rescue/Makefile.am @@ -23,10 +23,6 @@ EXTRA_DIST = \ test-virt-rescue-suggest.sh \ virt-rescue.pod -CLEANFILES = \ - stamp-virt-rescue.pod \ - virt-rescue.1 - bin_PROGRAMS = virt-rescue SHARED_SOURCE_FILES = \ diff --git a/resize/Makefile.am b/resize/Makefile.am index 9a725d3..678700b 100644 --- a/resize/Makefile.am +++ b/resize/Makefile.am @@ -23,8 +23,6 @@ EXTRA_DIST = \ test-virt-resize-docs.sh \ virt-resize.pod -CLEANFILES = *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o virt-resize - SOURCES_MLI SOURCES_ML = \ @@ -108,10 +106,6 @@ stamp-virt-resize.pod: virt-resize.pod $< touch $@ -CLEANFILES += \ - stamp-virt-resize.pod \ - virt-resize.1 - # Tests. TESTS_ENVIRONMENT = $(top_builddir)/run --test @@ -143,6 +137,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs diff --git a/ruby/Makefile.am b/ruby/Makefile.am index 65c0ff8..b78dbc2 100644 --- a/ruby/Makefile.am +++ b/ruby/Makefile.am @@ -34,7 +34,7 @@ EXTRA_DIST = \ t/tc_*.rb \ t/test_helper.rb -CLEANFILES = \ +CLEANFILES += \ lib/*~ \ t/*~ \ ext/guestfs/*~ \ diff --git a/ruby/examples/Makefile.am b/ruby/examples/Makefile.am index 6150b80..6ba2481 100644 --- a/ruby/examples/Makefile.am +++ b/ruby/examples/Makefile.am @@ -23,10 +23,6 @@ EXTRA_DIST = \ inspect_vm.rb \ guestfs-ruby.pod -CLEANFILES = \ - guestfs-ruby.3 \ - stamp-guestfs-ruby.pod - man_MANS = guestfs-ruby.3 noinst_DATA = $(top_builddir)/website/guestfs-ruby.3.html diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am index 5e42f0b..aadc881 100644 --- a/sparsify/Makefile.am +++ b/sparsify/Makefile.am @@ -25,8 +25,6 @@ EXTRA_DIST = \ test-virt-sparsify-in-place-fstrim-unsupported.sh \ virt-sparsify.pod -CLEANFILES = *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o virt-sparsify - SOURCES_MLI = \ cmdline.mli @@ -113,10 +111,6 @@ stamp-virt-sparsify.pod: virt-sparsify.pod $< touch $@ -CLEANFILES += \ - stamp-virt-sparsify.pod \ - virt-sparsify.1 - # Tests. TESTS_ENVIRONMENT = $(top_builddir)/run --test @@ -150,6 +144,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs diff --git a/src/Makefile.am b/src/Makefile.am index 29586f4..8150d99 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,8 +19,6 @@ include $(top_srcdir)/subdir-rules.mk noinst_PROGRAMS -CLEANFILES = stamp-guestfs.pod - generator_built = \ guestfs_protocol.x \ guestfs.h \ @@ -59,7 +57,6 @@ BUILT_SOURCES = \ EXTRA_DIST = \ $(BUILT_SOURCES) \ MAX_PROC_NR \ - libguestfs.3 \ libguestfs.pc.in \ guestfs.pod @@ -311,3 +308,10 @@ stamp-guestfs.pod: guestfs.pod \ --license LGPLv2+ \ $< touch $@ + +# The only reason we have to generate this from the Makefile is +# because the global CLEANFILES rule deletes it. +libguestfs.3: Makefile.am + rm -f $@ $@-t + echo '.so man3/guestfs.3' > $@-t + mv $@-t $@ diff --git a/src/libguestfs.3 b/src/libguestfs.3 deleted file mode 100644 index 548f8cd..0000000 --- a/src/libguestfs.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/guestfs.3 diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index a000735..64b9377 100644 --- a/sysprep/Makefile.am +++ b/sysprep/Makefile.am @@ -26,12 +26,6 @@ EXTRA_DIST = \ test-virt-sysprep-script.sh \ virt-sysprep.pod -CLEANFILES = \ - *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o \ - stamp-virt-sysprep.pod \ - virt-sysprep \ - virt-sysprep.1 - # Filenames sysprep_operation_<name>.ml in alphabetical order. operations = \ abrt_data \ @@ -217,6 +211,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs diff --git a/test-data/Makefile.am b/test-data/Makefile.am index 0c37c97..93d094a 100644 --- a/test-data/Makefile.am +++ b/test-data/Makefile.am @@ -89,7 +89,7 @@ image_files = \ noinst_DATA = test.iso -CLEANFILES = test.iso +CLEANFILES += test.iso test.iso: $(images_files) rm -rf d diff --git a/test-data/blank-disks/Makefile.am b/test-data/blank-disks/Makefile.am index 2464869..aa20358 100644 --- a/test-data/blank-disks/Makefile.am +++ b/test-data/blank-disks/Makefile.am @@ -28,7 +28,7 @@ files = \ noinst_DATA = $(files) -CLEANFILES = $(files) +CLEANFILES += $(files) # Blank disk images in various sizes and formats. blank-disk-1s.raw: diff --git a/test-data/fake-virtio-win/Makefile.am b/test-data/fake-virtio-win/Makefile.am index 87cc45e..33470fb 100644 --- a/test-data/fake-virtio-win/Makefile.am +++ b/test-data/fake-virtio-win/Makefile.am @@ -595,7 +595,7 @@ EXTRA_DIST = $(drivers) $(cd_files) check_DATA = fake-virtio-win.iso -CLEANFILES = fake-virtio-win.iso +CLEANFILES += fake-virtio-win.iso fake-virtio-win.iso: $(cd_files) $(GENISOIMAGE) -J -r -o $@ cd diff --git a/test-data/files/Makefile.am b/test-data/files/Makefile.am index bef21e6..b32eb0b 100644 --- a/test-data/files/Makefile.am +++ b/test-data/files/Makefile.am @@ -42,7 +42,7 @@ noinst_DATA = \ lib-i586.so.xz \ test-grep.txt.gz -CLEANFILES = $(noinst_DATA) +CLEANFILES += $(noinst_DATA) 100kallzeroes: rm -f $@ $@-t diff --git a/test-data/phony-guests/Makefile.am b/test-data/phony-guests/Makefile.am index 5a56960..1439b3e 100644 --- a/test-data/phony-guests/Makefile.am +++ b/test-data/phony-guests/Makefile.am @@ -60,7 +60,7 @@ disk_images = \ # time and we need the tools we have built in order to make it. check_DATA = $(disk_images) guests-all-good.xml -CLEANFILES = \ +CLEANFILES += \ $(check_DATA) \ guests-all-good.xml \ stamp-fedora-md.img @@ -150,7 +150,7 @@ windows-system: windows-system.reg hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $< mv $@-t $@ -DISTCLEANFILES = \ +DISTCLEANFILES += \ fedora-name.db \ fedora-packages.db \ windows-software \ diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am index 5177942..b1a0325 100644 --- a/test-tool/Makefile.am +++ b/test-tool/Makefile.am @@ -19,8 +19,6 @@ include $(top_srcdir)/subdir-rules.mk EXTRA_DIST = libguestfs-test-tool.pod -CLEANFILES = libguestfs-test-tool.1 stamp-libguestfs-test-tool.pod - bin_PROGRAMS = libguestfs-test-tool man_MANS = libguestfs-test-tool.1 diff --git a/tests/c-api/Makefile.am b/tests/c-api/Makefile.am index 40fe33e..708c6eb 100644 --- a/tests/c-api/Makefile.am +++ b/tests/c-api/Makefile.am @@ -23,7 +23,7 @@ BUILT_SOURCES = $(generator_built) EXTRA_DIST = $(BUILT_SOURCES) -CLEANFILES = \ +CLEANFILES += \ test.log \ testdownload.tmp diff --git a/tests/syslinux/Makefile.am b/tests/syslinux/Makefile.am index bb9a024..7dce671 100644 --- a/tests/syslinux/Makefile.am +++ b/tests/syslinux/Makefile.am @@ -27,4 +27,4 @@ EXTRA_DIST = \ $(TESTS) \ test-syslinux.pl -CLEANFILES = syslinux-guest.img extlinux-guest.img +CLEANFILES += syslinux-guest.img extlinux-guest.img diff --git a/tests/xml/Makefile.am b/tests/xml/Makefile.am index aa57619..d6d2e23 100644 --- a/tests/xml/Makefile.am +++ b/tests/xml/Makefile.am @@ -42,5 +42,3 @@ EXTRA_DIST = \ rhbz701814.pl \ rhbz701814-faked.xml \ rhbz701814-node.xml - -CLEANFILES = *~ diff --git a/tools/Makefile.am b/tools/Makefile.am index 8296b37..9dc7c26 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -23,12 +23,6 @@ tools = \ tar \ win-reg -CLEANFILES = \ - virt-list-filesystems.1 \ - virt-list-partitions.1 \ - virt-tar.1 \ - virt-win-reg.1 - EXTRA_DIST = \ $(tools:%=virt-%) \ test-virt-*.sh diff --git a/v2v/Makefile.am b/v2v/Makefile.am index d53e6e6..c0d635a 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -24,8 +24,6 @@ EXTRA_DIST = \ virt-v2v.pod \ virt-v2v-copy-to-local.pod -CLEANFILES = *~ *.annot *.cmi *.cmo *.cmx *.cmxa *.o virt-v2v - SOURCES_MLI = \ changeuid.mli \ cmdline.mli \ @@ -231,12 +229,6 @@ stamp-virt-v2v-copy-to-local.pod: virt-v2v-copy-to-local.pod $< touch $@ -CLEANFILES += \ - stamp-virt-v2v.pod \ - stamp-virt-v2v-copy-to-local.pod \ - virt-v2v.1 \ - virt-v2v-copy-to-local.1 - # Tests. # The virt-v2v tests here are not meant to be thorough tests of guest @@ -421,8 +413,6 @@ v2v_unit_tests_LINK = \ $(OCAMLLINKFLAGS) \ $(v2v_unit_tests_THEOBJECTS) -o $@ -CLEANFILES += oUnit-* - # Dependencies. depend: .depend @@ -439,6 +429,4 @@ depend: .depend endif -DISTCLEANFILES = .depend - .PHONY: depend docs diff --git a/v2v/test-harness/Makefile.am b/v2v/test-harness/Makefile.am index 55cd108..a665d3a 100644 --- a/v2v/test-harness/Makefile.am +++ b/v2v/test-harness/Makefile.am @@ -24,17 +24,6 @@ EXTRA_DIST = \ $(SOURCES_MLI) $(SOURCES_ML) \ virt-v2v-test-harness.pod -CLEANFILES = \ - *~ \ - *.a \ - *.annot \ - *.cmi \ - *.cmo \ - *.cmx \ - *.cmxa \ - *.o \ - *.so - SOURCES_MLI = \ v2v_test_harness.mli @@ -133,10 +122,6 @@ stamp-virt-v2v-test-harness.pod: virt-v2v-test-harness.pod $< touch $@ -CLEANFILES += \ - stamp-virt-v2v-test-harness.pod \ - virt-v2v-test-harness.1 - # Dependencies. depend: .depend @@ -154,6 +139,4 @@ depend: .depend endif endif -DISTCLEANFILES = .depend - .PHONY: depend docs -- 2.7.4
Pino Toscano
2016-Aug-25 15:29 UTC
Re: [Libguestfs] [PATCH] build: Add common CLEANFILES and DISTCLEANFILES to common-rules.mk.
On Thursday, 25 August 2016 15:53:32 CEST Richard W.M. Jones wrote:> By adding common CLEANFILES and DISTCLEANFILES variables to > common-rules.mk, we can remove these from most other Makefiles, and > also clean files more consistently. > > Note that bin_PROGRAMS are already cleaned by 'make clean', so I > removed cases where these were unnecessarily added to CLEANFILES. > ---Mostly LGTM, just a couple of small notes below.> +# Files that should universally be removed by 'make clean'. Note if > +# there is any case in any subdirectory where a file should not be > +# removed by 'make clean', it should not be listed here! > + > +# Emacs backup filesIt isn't only Emacs doing this kind of backup files :)> +# Libtool cruft. > +CLEANFILES += *.lo *.laIs this actually needed? Most probably automake already clean them, I think. Thanks, -- Pino Toscano
Richard W.M. Jones
2016-Aug-25 15:46 UTC
Re: [Libguestfs] [PATCH] build: Add common CLEANFILES and DISTCLEANFILES to common-rules.mk.
On Thu, Aug 25, 2016 at 05:29:49PM +0200, Pino Toscano wrote:> On Thursday, 25 August 2016 15:53:32 CEST Richard W.M. Jones wrote: > > By adding common CLEANFILES and DISTCLEANFILES variables to > > common-rules.mk, we can remove these from most other Makefiles, and > > also clean files more consistently. > > > > Note that bin_PROGRAMS are already cleaned by 'make clean', so I > > removed cases where these were unnecessarily added to CLEANFILES. > > --- > > Mostly LGTM, just a couple of small notes below. > > > +# Files that should universally be removed by 'make clean'. Note if > > +# there is any case in any subdirectory where a file should not be > > +# removed by 'make clean', it should not be listed here! > > + > > +# Emacs backup files > > It isn't only Emacs doing this kind of backup files :)OK, I changed it to the more neutral "Editor backup files".> > +# Libtool cruft. > > +CLEANFILES += *.lo *.la > > Is this actually needed? Most probably automake already clean them, > I think.Yes it does -- removed. It also removes *.o files, but doesn't appear to remove *.a files ... Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Maybe Matching Threads
- [PATCH] (Almost) new tool: virt-get-kernel
- [libnbd PATCH] maint: Use $(NULL) for all Makefile.am macro lists
- [nbdkit PATCH] maint: Adjust cleaning rules
- Re: [PATCH] build: Add common CLEANFILES and DISTCLEANFILES to common-rules.mk.
- [PATCH] Fix building on architectures where ocamlopt is not available