tools: fix "make distclean"
PATCH 1/1 tools: fix "make distclean"
The original rule to target "distclean" in tools/Rules.mk was in effect "make clean". It should be "make distclean".
However not all Makefiles in subdirectories have distclean target defined. So this patch also adds a bunch of distclean targets to various Makefiles. They only depend on clean target and don't have any actions in most cases.
With the patch applied, following command outputs 0 results:
find tools -name 'Makefile*' -exec grep -L 'distclean' {} \+ \
| grep -v ocaml | grep -v libfsimageOcaml and libfsimage are known to have distclean defined in a dedicated rules file.
--- tools/Rules.mk | 2 +- tools/blktap2/Makefile | 6 ++++-- tools/blktap2/control/Makefile | 4 +++- tools/blktap2/drivers/Makefile | 4 +++- tools/blktap2/include/Makefile | 3 +++ tools/blktap2/lvm/Makefile | 4 +++- tools/blktap2/vhd/Makefile | 4 +++- tools/blktap2/vhd/lib/Makefile | 4 +++- tools/console/Makefile | 3 +++ tools/console/testsuite/Makefile | 5 ++++- tools/debugger/gdbsx/Makefile | 4 ++++ tools/debugger/gdbsx/gx/Makefile | 2 ++ tools/debugger/gdbsx/xg/Makefile | 2 ++ tools/debugger/kdd/Makefile | 3 +++ tools/examples/Makefile | 3 +++ tools/firmware/hvmloader/Makefile | 3 +++ tools/firmware/hvmloader/acpi/Makefile | 2 ++ tools/firmware/rombios/32bit/Makefile | 3 +++ tools/firmware/rombios/32bit/tcgbios/Makefile | 3 +++ tools/firmware/rombios/Makefile | 3 +++ tools/firmware/vgabios/Makefile | 3 +++ tools/flask/Makefile | 4 ++-- tools/flask/policy/Makefile | 4 +++- tools/flask/utils/Makefile | 3 +++ tools/hotplug/FreeBSD/Makefile | 3 +++ tools/hotplug/Linux/Makefile | 3 +++ tools/hotplug/Linux/systemd/Makefile | 3 +++ tools/hotplug/Makefile | 4 ++-- tools/hotplug/NetBSD/Makefile | 3 +++ tools/hotplug/common/Makefile | 3 +++ tools/include/Makefile | 3 +++ tools/include/xen-foreign/Makefile | 4 +++- tools/libxc/Makefile | 3 +++ tools/memshr/Makefile | 5 ++++- tools/misc/Makefile | 3 +++ tools/ocaml/Makefile | 3 +++ tools/ocaml/Makefile.rules | 2 ++ tools/ocaml/libs/Makefile | 3 +++ tools/pygrub/Makefile | 3 +++ tools/python/Makefile | 3 +++ tools/tests/mce-test/Makefile | 5 ++++- tools/tests/mce-test/tools/Makefile | 3 +++ tools/tests/mem-sharing/Makefile | 3 +++ tools/tests/regression/Makefile | 4 ++-- tools/tests/vhpet/Makefile | 3 +++ tools/tests/x86_emulator/Makefile | 3 +++ tools/tests/xen-access/Makefile | 3 +++ tools/xcutils/Makefile | 3 +++ tools/xenbackendd/Makefile | 3 +++ tools/xenmon/Makefile | 3 +++ tools/xenpaging/Makefile | 4 +++- tools/xenpmd/Makefile | 3 +++ tools/xenstat/Makefile | 4 ++-- tools/xenstat/libxenstat/Makefile | 3 +++ tools/xenstat/xentop/Makefile | 3 +++ tools/xenstore/Makefile | 3 +++ tools/xentrace/Makefile | 3 +++ 57 files changed, 166 insertions(+), 22 deletions(-)
tools/Rules.mk +1 -1
@@ -121,7 +121,7 @@ subdir-all-% subdir-clean-% subdir-install-%: .phony $(MAKE) -C $* $(patsubst subdir-%-$*,%,$@) subdir-distclean-%: .phony - $(MAKE) -C $* clean + $(MAKE) -C $* distclean ifeq (,$(findstring clean,$(MAKECMDGOALS))) $(XEN_ROOT)/config/Tools.mk:
tools/blktap2/Makefile +4 -2
@@ -14,5 +14,7 @@ SUBDIRS-$(CONFIG_Linux) += control clean: rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) TAGS -.PHONY: all clean install -all clean install: %: subdirs-% +distclean: clean + +.PHONY: all clean install distclean +all clean install distclean: %: subdirs-%
tools/blktap2/control/Makefile +3 -1
@@ -73,6 +73,8 @@ clean: rm -f $(LIBNAME).so $(LIBSONAME) rm -f *~ -.PHONY: all build clean install +distclean: clean + +.PHONY: all build clean distclean install -include $(DEPS)
tools/blktap2/drivers/Makefile +3 -1
@@ -108,4 +108,6 @@ install: all clean: rm -rf .*.d *.o *~ xen TAGS $(IBIN) $(LIB) $(LOCK_UTIL) $(QCOW_UTIL) -.PHONY: clean install +distclean: clean + +.PHONY: clean install distclean
tools/blktap2/include/Makefile +3 -0
@@ -12,3 +12,6 @@ install: .PHONY: clean clean: @: + +.PHONY: distclean +distclean: clean
tools/blktap2/lvm/Makefile +3 -1
@@ -29,6 +29,8 @@ lvm-util: lvm-util.o clean: rm -rf *.o *.opic *~ $(DEPS) $(IBIN) -.PHONY: all build clean install lvm-util +distclean: clean + +.PHONY: all build clean distclean install lvm-util -include $(DEPS)
tools/blktap2/vhd/Makefile +3 -1
@@ -44,6 +44,8 @@ install: all clean: subdirs-clean rm -rf *.o *~ $(DEPS) $(IBIN) -.PHONY: all build clean install vhd-util vhd-update +distclean: clean + +.PHONY: all build clean distclean install vhd-util vhd-update -include $(DEPS)
tools/blktap2/vhd/lib/Makefile +3 -1
@@ -75,6 +75,8 @@ install: all clean: rm -rf *.a *.so* *.o *.opic *~ $(DEPS) $(LIBVHD) -.PHONY: all build clean install libvhd +distclean: clean + +.PHONY: all build clean distclean install libvhd -include $(DEPS)
tools/console/Makefile +3 -0
@@ -22,6 +22,9 @@ clean: $(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS) $(RM) client/*.o daemon/*.o +.PHONY: distclean +distclean: clean + xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c)) $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
tools/console/testsuite/Makefile +4 -1
@@ -11,4 +11,7 @@ console-domU: console-domU.o procpipe: procpipe.o .PHONY: clean -clean:; $(RM) *.o console-domU console-dom0 procpipe +clean: $(RM) *.o console-domU console-dom0 procpipe + +.PHONY: distclean +distclean: clean
tools/debugger/gdbsx/Makefile +4 -0
@@ -12,6 +12,10 @@ clean: rm -f xg_all.a gx_all.a gdbsx set -e; for d in xg gx; do $(MAKE) -C $$d clean; done +.PHONY: distclean +distclean: clean + set -e; for d in xg gx; do $(MAKE) -c $$d distclean; done + .PHONY: install install: all [ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
tools/debugger/gdbsx/gx/Makefile +2 -0
@@ -11,6 +11,8 @@ all: gx_all.a clean: rm -rf gx_all.a *.o .*.d +.PHONY: distclean +distclean: clean #%.o: %.c $(GX_HDRS) Makefile # $(CC) -c $(CFLAGS) -o $@ $<
tools/debugger/gdbsx/xg/Makefile +2 -0
@@ -33,3 +33,5 @@ xen-headers: clean: rm -rf xen xg_all.a $(XG_OBJS) .*.d +.PHONY: distclean +distclean: clean
tools/debugger/kdd/Makefile +3 -0
@@ -16,6 +16,9 @@ kdd: $(OBJS) clean: rm -f $(OBJS) $(DEPS) kdd +.PHONY: distclean +distclean: clean + .PHONY: install install: all [ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
tools/examples/Makefile +3 -0
@@ -43,3 +43,6 @@ install-configs: $(XEN_CONFIGS) .PHONY: clean clean: + +.PHONY: distclean +distclean: clean
tools/firmware/hvmloader/Makefile +3 -0
@@ -139,4 +139,7 @@ clean: subdirs-clean rm -f roms.inc roms.inc.new acpi.h rm -f hvmloader hvmloader.tmp *.o $(DEPS) +.PHONY: distclean +distclean: clean + -include $(DEPS)
tools/firmware/hvmloader/acpi/Makefile +2 -0
@@ -66,6 +66,8 @@ clean: rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS) rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*.asl +distclean: clean + install: all -include $(DEPS)
tools/firmware/rombios/32bit/Makefile +3 -0
@@ -15,6 +15,9 @@ all: subdirs-all clean: subdirs-clean rm -rf *.o $(TARGET) $(DEPS) +.PHONY: distclean +distclean: subdirs-distclean + $(TARGET): 32bitbios_all.o sh mkhex highbios_array 32bitbios_all.o > $@
tools/firmware/rombios/32bit/tcgbios/Makefile +3 -0
@@ -12,6 +12,9 @@ all: $(TARGET) clean: rm -rf *.o $(TARGET) $(DEPS) +.PHONY: distclean +distclean: clean + $(TARGET): tcgbios.o tpm_drivers.o $(LD) $(LDFLAGS_DIRECT) -r $^ -o $@
tools/firmware/rombios/Makefile +3 -0
@@ -15,6 +15,9 @@ clean: subdirs-clean rm -f BIOS-bochs-* rm -f $(DEPS) +.PHONY: distclean +distclean: clean + BIOS-bochs-latest: rombios.c biossums 32bitgateway.c tcgbios.c gcc -DBX_SMP_PROCESSORS=1 -E -P $< > _rombios_.c bcc -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c
tools/firmware/vgabios/Makefile +3 -0
@@ -25,6 +25,9 @@ clean: temp.awk.* vgabios*.orig _vgabios_* _vgabios-debug_* core vgabios*.bin vgabios*.txt $(RELEASE).bin *.bak rm -f VGABIOS-lgpl-latest*.bin +.PHONY: distclean +distclean: clean + .PHONY: release release: VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" make bios cirrus-bios
tools/flask/Makefile +2 -2
@@ -4,6 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := utils SUBDIRS-$(FLASK_POLICY) += policy -.PHONY: all clean install -all clean install: %: subdirs-% +.PHONY: all clean install distclean +all clean install distclean: %: subdirs-%
tools/flask/policy/Makefile +3 -1
@@ -115,4 +115,6 @@ policy.conf: $(POLICY_SECTIONS) clean: $(RM) tmp policy.conf $(POLICY_FILENAME) -.PHONY: all install clean +distclean: clean + +.PHONY: all install clean distclean
tools/flask/utils/Makefile +3 -0
@@ -39,6 +39,9 @@ clean: rm -f $(CLIENTS) $(RM) $(DEPS) +.PHONY: distclean +distclean: clean + .PHONY: print-dir print-dir: @echo -n tools/flask/utils:
tools/hotplug/FreeBSD/Makefile +3 -0
@@ -40,3 +40,6 @@ install-rcd: .PHONY: clean clean: + +.PHONY: distclean +distclean: clean
tools/hotplug/Linux/Makefile +3 -0
@@ -81,3 +81,6 @@ install-udev: .PHONY: clean clean: subdirs-clean + +.PHONY: distclean +distclean: clean
tools/hotplug/Linux/systemd/Makefile +3 -0
@@ -28,6 +28,9 @@ all: $(ALL_XEN_SYSTEMD) clean: rm -f $(XEN_SYSTEMD_MODULES) +.PHONY: distclean +distclean: clean + .PHONY: install install: $(ALL_XEN_SYSTEMD) [ -d $(DESTDIR)$(XEN_SYSTEMD_DIR) ] || \
tools/hotplug/Makefile +2 -2
@@ -6,5 +6,5 @@ SUBDIRS-$(CONFIG_NetBSD) += NetBSD SUBDIRS-$(CONFIG_Linux) += Linux SUBDIRS-$(CONFIG_FreeBSD) += FreeBSD -.PHONY: all clean install -all clean install: %: subdirs-% +.PHONY: all clean install distclean +all clean install distclean: %: subdirs-%
tools/hotplug/NetBSD/Makefile +3 -0
@@ -42,3 +42,6 @@ install-rcd: .PHONY: clean clean: + +.PHONY: distclean +distclean: clean
tools/hotplug/common/Makefile +3 -0
@@ -37,3 +37,6 @@ install-scripts: build .PHONY: clean clean: rm -f $(HOTPLUGPATH) + +.PHONY: distclean +distclean: clean
tools/include/Makefile +3 -0
@@ -50,3 +50,6 @@ clean: rm -rf xen $(MAKE) -C xen-foreign clean + +.PHONY: distclean +distclean: clean
tools/include/xen-foreign/Makefile +3 -1
@@ -6,7 +6,7 @@ ROOT = $(XEN_ROOT)/xen/include/public architectures := arm32 arm64 x86_32 x86_64 headers := $(patsubst %, %.h, $(architectures)) -.PHONY: all clean check-headers +.PHONY: all clean distclean check-headers all: $(headers) check-headers clean:
@@ -14,6 +14,8 @@ clean: rm -f checker checker.c rm -f *.pyc *.o *~ +distclean: clean + checker: checker.c $(headers) $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
tools/libxc/Makefile +3 -0
@@ -170,6 +170,9 @@ clean: $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \ $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS) +.PHONY: distclean +distclean: clean + .PHONY: rpm rpm: build rm -rf staging
tools/memshr/Makefile +4 -1
@@ -39,6 +39,9 @@ install: all clean: rm -rf *.a *.o *~ $(DEPS) -.PHONY: all build clean install +.PHONY: distclean +distclean: clean + +.PHONY: all build clean install distclean -include $(DEPS)
tools/misc/Makefile +3 -0
@@ -62,6 +62,9 @@ install: build clean: $(RM) *.o $(TARGETS_BUILD) *~ $(DEPS) +.PHONY: distclean +distclean: clean + xen-hvmctx: xen-hvmctx.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
tools/ocaml/Makefile +3 -0
@@ -20,3 +20,6 @@ install: subdirs-install .PHONY: clean clean: subdirs-clean + +.PHONY: distclean +distclean: subdirs-distclean
tools/ocaml/Makefile.rules +2 -0
@@ -47,6 +47,8 @@ ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS)) clean: $(CLEAN_HOOKS) $(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META +distclean: clean + quiet-command = $(if $(V),$1,@printf " %-8s %s\n" "$2" "$3" && $1) mk-caml-lib-native = $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $1 $2 $3,MLA,$1)
tools/ocaml/libs/Makefile +3 -0
@@ -15,3 +15,6 @@ install: subdirs-install .PHONY: clean clean: subdirs-clean + +.PHONY: distclean +distclean: subdirs-distclean
tools/pygrub/Makefile +3 -0
@@ -23,4 +23,7 @@ install: all clean: rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out $(DEPS) +.PHONY: distclean +distclean: clean + -include $(DEPS)
tools/python/Makefile +3 -0
@@ -28,4 +28,7 @@ clean: rm -rf build/ rm -f $(DEPS) +.PHONY: distclean +distclean: clean + -include $(DEPS)
tools/tests/mce-test/Makefile +4 -1
@@ -1,7 +1,10 @@ -.PHONY: all clean +.PHONY: all clean distclean all: $(MAKE) -C tools clean: $(MAKE) -C tools clean + +distclean: + $(MAKE) -C tools distclean
tools/tests/mce-test/tools/Makefile +3 -0
@@ -19,5 +19,8 @@ install: xen-mceinj clean: $(RM) *.o xen-mceinj +.PHONY: distclean +distclean: clean + xen-mceinj: xen-mceinj.o Makefile $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore)
tools/tests/mem-sharing/Makefile +3 -0
@@ -20,6 +20,9 @@ build: $(TARGETS) clean: $(RM) *.o $(TARGETS) *~ $(DEPS) +.PHONY: distclean +distclean: clean + memshrtool: memshrtool.o $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl)
tools/tests/regression/Makefile +2 -2
@@ -22,8 +22,8 @@ check-python-syntax: runtime-environment .PHONY: runtime-environment runtime-environment: $(PYTHON_VERSIONS) -.PHONY: dist-clean -dist-clean: +.PHONY: distclean +distclean: rm -fr $(REG_TEST_DIR)/installed $(REG_TEST_DIR)/downloads \ $(REG_TEST_DIR)/build
tools/tests/vhpet/Makefile +3 -0
@@ -26,6 +26,9 @@ $(TARGET): hpet.c main.c hpet.h emul.h Makefile clean: rm -rf $(TARGET) $(TARGET).out *.o *~ core* hpet.h hpet.c +.PHONY: distclean +distclean: clean + .PHONY: install install:
tools/tests/x86_emulator/Makefile +3 -0
@@ -34,6 +34,9 @@ $(TARGET): x86_emulate.o test_x86_emulator.o clean: rm -rf $(TARGET) *.o *~ core blowfish.h blowfish.bin x86_emulate +.PHONY: distclean +distclean: clean + .PHONY: install install:
tools/tests/xen-access/Makefile +3 -0
@@ -21,6 +21,9 @@ build: $(TARGETS) clean: $(RM) *.o $(TARGETS) *~ $(DEPS) +.PHONY: distclean +distclean: clean + xen-access: xen-access.o Makefile $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest)
tools/xcutils/Makefile +3 -0
@@ -42,4 +42,7 @@ clean: $(RM) *.o $(PROGRAMS) $(RM) $(DEPS) +.PHONY: distclean +distclean: clean + -include $(DEPS)
tools/xenbackendd/Makefile +3 -0
@@ -32,6 +32,9 @@ install: build clean: $(RM) *.a *.so *.o $(DEPS) xenbackendd +.PHONY: distclean +distclean: clean + xenbackendd: xenbackendd.o $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
tools/xenmon/Makefile +3 -0
@@ -40,6 +40,9 @@ clean: $(RM) -f xenbaked xenbaked.o $(RM) -f xentrace_setmask setmask.o +.PHONY: distclean +distclean: clean + xenbaked: xenbaked.o Makefile $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
tools/xenpaging/Makefile +3 -1
@@ -31,7 +31,9 @@ install: all clean: rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB) -.PHONY: clean install +distclean: clean + +.PHONY: clean install distclean .PHONY: TAGS TAGS:
tools/xenpmd/Makefile +3 -0
@@ -18,6 +18,9 @@ install: all clean: $(RM) -f xenpmd xenpmd.o $(DEPS) +.PHONY: distclean +distclean: clean + xenpmd: xenpmd.o Makefile $(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
tools/xenstat/Makefile +2 -2
@@ -11,6 +11,6 @@ SUBDIRS += xentop endif endif -.PHONY: all install clean +.PHONY: all install clean distclean -all install clean: %: subdirs-% +all install clean distclean: %: subdirs-%
tools/xenstat/libxenstat/Makefile +3 -0
@@ -137,4 +137,7 @@ clean: rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \ $(BINDINGS) $(BINDINGSRC) $(DEPS) +.PHONY: distclean +distclean: clean + -include $(DEPS)
tools/xenstat/xentop/Makefile +3 -0
@@ -42,4 +42,7 @@ endif clean: rm -f xentop xentop.o $(DEPS) +.PHONY: distclean +distclean: clean + -include $(DEPS)
tools/xenstore/Makefile +3 -0
@@ -115,6 +115,9 @@ clean: rm -f xenstore $(CLIENTS) $(RM) $(DEPS) +.PHONY: distclean +distclean: clean + .PHONY: TAGS TAGS: etags `find . -name '*.[ch]'`
tools/xentrace/Makefile +3 -0
@@ -34,6 +34,9 @@ install: build clean: $(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) $(DEPS) +.PHONY: distclean +distclean: clean + xentrace: xentrace.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
Signature · 1 line
1.7.10.4
Wei Liu writes ("[PATCH] tools: fix "make distclean""):
Quoted 8 lines
The original rule to target "distclean" in
tools/Rules.mkwas in effect "make clean". It should be "make distclean".However not all Makefiles in subdirectories have distclean target defined. So this patch also adds a bunch of distclean targets to various Makefiles. They only depend on clean target and don't have any actions in most cases.
Quoted 7 lines
With the patch applied, following command outputs 0 results:
find tools -name 'Makefile*' -exec grep -L 'distclean' {} \+ \ | grep -v ocaml | grep -v libfsimageOcaml and libfsimage are known to have distclean defined in a dedicated rules file.
Quoted 11 lines · Ian Jackson
Wei Liu writes ("[PATCH] tools: fix "make distclean""):
Quoted 10 lines
The original rule to target "distclean" in
tools/Rules.mkwas in effect "make clean". It should be "make distclean".However not all Makefiles in subdirectories have distclean target defined. So this patch also adds a bunch of distclean targets to various Makefiles. They only depend on clean target and don't have any actions in most cases.
With the patch applied, following command outputs 0 results:
Quoted 7 lines
Quoted 5 lines
find tools -name 'Makefile*' -exec grep -L 'distclean' {} \+ \ | grep -v ocaml | grep -v libfsimageOcaml and libfsimage are known to have distclean defined in a dedicated rules file.
Acked-by Ian Jackson <[email protected]>
Likewise + applied.