diff options
28 files changed, 56 insertions, 68 deletions
diff --git a/tools/Rules.mk b/tools/Rules.mk index a477c8253b..fbd69ea215 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -29,6 +29,10 @@ X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR) CFLAGS += -D__XEN_TOOLS__ +# Get gcc to generate the dependencies for us. +CFLAGS += -MMD -MF .$(@F).d +DEPS = .*.d + # Enable implicit LFS support *and* explicit LFS names. CFLAGS += $(shell getconf LFS_CFLAGS) CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE @@ -59,4 +63,3 @@ subdirs-all subdirs-clean subdirs-install: .phony subdir-all-% subdir-clean-% subdir-install-%: .phony $(MAKE) -C $* $(patsubst subdir-%-$*,%,$@) - diff --git a/tools/blktap/drivers/Makefile b/tools/blktap/drivers/Makefile index 7c3e088bf1..36af03fa2c 100644 --- a/tools/blktap/drivers/Makefile +++ b/tools/blktap/drivers/Makefile @@ -13,10 +13,6 @@ CFLAGS += $(CFLAGS_libxenstore) CFLAGS += -I $(LIBAIO_DIR) CFLAGS += -D_GNU_SOURCE -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d - ifeq ($(shell . ./check_gcrypt),"yes") CFLAGS += -DUSE_GCRYPT CRYPT_LIB := -lgcrypt diff --git a/tools/console/Makefile b/tools/console/Makefile index 10e909a0b6..7339e9e064 100644 --- a/tools/console/Makefile +++ b/tools/console/Makefile @@ -16,7 +16,7 @@ all: $(BIN) .PHONY: clean clean: - $(RM) *.a *.so *.o *.rpm $(BIN) + $(RM) *.a *.so *.o *.rpm $(BIN) $(DEPS) $(RM) client/*.o daemon/*.o xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c)) @@ -33,3 +33,5 @@ install: $(BIN) $(INSTALL_PROG) xenconsoled $(DESTDIR)/$(SBINDIR) $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR) $(INSTALL_PROG) xenconsole $(DESTDIR)$(PRIVATE_BINDIR) + +-include $(DEPS) diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile index 79f641d9a2..6d89269fe2 100644 --- a/tools/firmware/hvmloader/Makefile +++ b/tools/firmware/hvmloader/Makefile @@ -58,4 +58,6 @@ roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin \ .PHONY: clean clean: subdirs-clean rm -f roms.h acpi.h - rm -f hvmloader hvmloader.tmp *.o + rm -f hvmloader hvmloader.tmp *.o $(DEPS) + +-include $(DEPS) diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile index 49245aa089..e4dc4cb53f 100644 --- a/tools/firmware/hvmloader/acpi/Makefile +++ b/tools/firmware/hvmloader/acpi/Makefile @@ -63,6 +63,8 @@ acpi.a: $(OBJS) $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< clean: - rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz + rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS) install: all + +-include $(DEPS) diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile index cdad7561b9..ec8ff2c60c 100644 --- a/tools/firmware/rombios/32bit/Makefile +++ b/tools/firmware/rombios/32bit/Makefile @@ -16,7 +16,7 @@ all: subdirs-all .PHONY: clean clean: subdirs-clean - rm -rf *.o $(TARGET) + rm -rf *.o $(TARGET) $(DEPS) $(TARGET): 32bitbios.o $(MODULES) util.o $(LD) $(LDFLAGS_DIRECT) -s -r $^ -o 32bitbios_all.o @@ -27,3 +27,5 @@ $(TARGET): 32bitbios.o $(MODULES) util.o exit 11; \ } || : sh mkhex highbios_array 32bitbios_all.o > $@ + +-include $(DEPS) diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile index 1b3cf2b94a..68509c7f02 100644 --- a/tools/firmware/rombios/32bit/tcgbios/Makefile +++ b/tools/firmware/rombios/32bit/tcgbios/Makefile @@ -12,7 +12,10 @@ CFLAGS += $(CFLAGS_include) -I.. -I../.. -DGCC_PROTOS all: $(TARGET) clean: - rm -rf *.o $(TARGET) + rm -rf *.o $(TARGET) $(DEPS) $(TARGET): $(OBJECTS) $(LD) $(LDFLAGS_DIRECT) -r $^ -o $@ + +-include $(DEPS) + diff --git a/tools/firmware/rombios/Makefile b/tools/firmware/rombios/Makefile index 8ea8cb7560..8321eadd85 100644 --- a/tools/firmware/rombios/Makefile +++ b/tools/firmware/rombios/Makefile @@ -13,6 +13,7 @@ clean: subdirs-clean rm -f as86-sym.txt ld86-sym.txt rm -f rombios*.txt rombios*.sym usage biossums rm -f BIOS-bochs-* + rm -f $(DEPS) BIOS-bochs-latest: rombios.c biossums 32bitgateway.c tcgbios.c gcc -DBX_SMP_PROCESSORS=1 -E -P $< > _rombios_.c @@ -27,3 +28,4 @@ BIOS-bochs-latest: rombios.c biossums 32bitgateway.c tcgbios.c biossums: biossums.c gcc -o biossums biossums.c +-include $(DEPS) diff --git a/tools/flask/libflask/Makefile b/tools/flask/libflask/Makefile index 8c085b929b..c03fc8aca8 100644 --- a/tools/flask/libflask/Makefile +++ b/tools/flask/libflask/Makefile @@ -16,7 +16,6 @@ CFLAGS += $(INCLUDES) -I./include -I$(XEN_LIBXC) -I$(XEN_INCLUDE) # Get gcc to generate the dependencies for us. CFLAGS += -Wp,-MD,.$(@F).d LDFLAGS += -L. -DEPS = .*.d LIB_OBJS := $(patsubst %.c,%.o,$(SRCS)) PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS)) diff --git a/tools/flask/loadpolicy/Makefile b/tools/flask/loadpolicy/Makefile index 7c38525ba8..8b404214c2 100644 --- a/tools/flask/loadpolicy/Makefile +++ b/tools/flask/loadpolicy/Makefile @@ -7,9 +7,6 @@ LIBFLASK_ROOT = $(XEN_ROOT)/tools/flask/libflask PROFILE=#-pg BASECFLAGS=-Wall -g -Werror -# Make gcc generate dependencies. -BASECFLAGS += -Wp,-MD,.$(@F).d -PROG_DEP = .*.d BASECFLAGS+= $(PROFILE) #BASECFLAGS+= -I$(XEN_ROOT)/tools BASECFLAGS+= $(CFLAGS_libxenctrl) @@ -39,7 +36,7 @@ $(CLIENTS_OBJS): $(CLIENTS_SRCS) clean: rm -f *.o *.opic *.so rm -f $(CLIENTS) - $(RM) $(PROG_DEP) + $(RM) $(DEPS) .PHONY: print-dir print-dir: @@ -54,7 +51,7 @@ install: all $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(SBINDIR) --include $(PROG_DEP) +-include $(DEPS) # never delete any intermediate files. .SECONDARY: diff --git a/tools/fs-back/Makefile b/tools/fs-back/Makefile index dc5fc446ce..431a192067 100644 --- a/tools/fs-back/Makefile +++ b/tools/fs-back/Makefile @@ -13,10 +13,6 @@ CFLAGS += $(CFLAGS_libxenstore) CFLAGS += $(INCLUDES) -I. CFLAGS += -D_GNU_SOURCE -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d - LIBS := -L. -L.. -L../lib LIBS += $(LDFLAGS_libxenctrl) LIBS += $(LDFLAGS_libxenstore) diff --git a/tools/libfsimage/Rules.mk b/tools/libfsimage/Rules.mk index afc08bdaab..accbafef15 100644 --- a/tools/libfsimage/Rules.mk +++ b/tools/libfsimage/Rules.mk @@ -1,8 +1,6 @@ include $(XEN_ROOT)/tools/Rules.mk -DEPS = .*.d - -CFLAGS += -I$(XEN_ROOT)/tools/libfsimage/common/ -Werror -Wp,-MD,.$(@F).d +CFLAGS += -I$(XEN_ROOT)/tools/libfsimage/common/ -Werror LDFLAGS += -L../common/ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y)) diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile index 641bca53b3..48851acfa6 100644 --- a/tools/libfsimage/common/Makefile +++ b/tools/libfsimage/common/Makefile @@ -4,9 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1.0 MINOR = 0 -CFLAGS += -Werror -Wp,-MD,.$(@F).d -DEPS = .*.d - LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU LDFLAGS = $(LDFLAGS-y) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 4ec156c1d8..6f839463d7 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -62,10 +62,7 @@ CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE # libraries. #CFLAGS += -DVALGRIND -O0 -ggdb3 -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d LDFLAGS += -L. -DEPS = .*.d CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y)) CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y)) diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 40e7bbfca3..12c599cd75 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -47,7 +47,7 @@ install: build .PHONY: clean clean: - $(RM) *.o $(TARGETS) *~ + $(RM) *.o $(TARGETS) *~ $(DEPS) set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done %.o: %.c $(HDRS) Makefile @@ -55,3 +55,5 @@ clean: xenperf xenpm: %: %.o Makefile $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDFLAGS_libxenctrl) + +-include $(DEPS) diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile index 3629d89742..03c8ed9530 100644 --- a/tools/pygrub/Makefile +++ b/tools/pygrub/Makefile @@ -22,4 +22,6 @@ endif .PHONY: clean clean: - rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out + rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out $(DEPS) + +-include $(DEPS) diff --git a/tools/python/Makefile b/tools/python/Makefile index c2e5c9c318..4ae0a2d777 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -85,3 +85,6 @@ test: .PHONY: clean clean: rm -rf build *.pyc *.pyo *.o *.a *~ $(CATALOGS) xen/util/auxbin.pyc + rm -f $(DEPS) + +-include $(DEPS) diff --git a/tools/vnet/libxutil/Makefile b/tools/vnet/libxutil/Makefile index 0c8ef6bb73..889c55c32f 100644 --- a/tools/vnet/libxutil/Makefile +++ b/tools/vnet/libxutil/Makefile @@ -28,10 +28,6 @@ CFLAGS += -Werror -fno-strict-aliasing $(call cc-option,$(CC),-fgnu89-inline,) CFLAGS += -O3 #CFLAGS += -g -# Get gcc to generate the dependencies for us. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d - MAJOR := 3.0 MINOR := 0 LIB := libxutil.so diff --git a/tools/vtpm/Rules.mk b/tools/vtpm/Rules.mk index 8eb1a3c343..c6a7487fbf 100644 --- a/tools/vtpm/Rules.mk +++ b/tools/vtpm/Rules.mk @@ -11,11 +11,6 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin # General compiler flags CFLAGS = -Werror -g3 -I. -# For generating dependencies -CFLAGS += -Wp,-MD,.$(@F).d - -DEP_FILES = .*.d - # Generic project files HDRS = $(wildcard *.h) SRCS = $(wildcard *.c) @@ -26,7 +21,7 @@ $(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm/Rules.mk $(OBJS): $(SRCS) --include $(DEP_FILES) +-include $(DEPS) BUILD_EMULATOR = y diff --git a/tools/vtpm_manager/Rules.mk b/tools/vtpm_manager/Rules.mk index 3d48870288..461e13bf28 100644 --- a/tools/vtpm_manager/Rules.mk +++ b/tools/vtpm_manager/Rules.mk @@ -11,11 +11,6 @@ TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin # General compiler flags CFLAGS = -Werror -g3 -I. -# For generating dependencies -CFLAGS += -Wp,-MD,.$(@F).d - -DEP_FILES = .*.d - # Generic project files HDRS = $(wildcard *.h) SRCS = $(wildcard *.c) @@ -26,7 +21,7 @@ $(SRCS): Makefile $(XEN_ROOT)/tools/Rules.mk $(XEN_ROOT)/tools/vtpm_manager/Rule $(OBJS): $(SRCS) --include $(DEP_FILES) +-include $(FILES) # Make sure these are just rules .PHONY : all build install clean diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile index 15c0c9758e..a8029086b2 100644 --- a/tools/xcutils/Makefile +++ b/tools/xcutils/Makefile @@ -14,10 +14,6 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) -# Make gcc generate dependencies. -CFLAGS += -Wp,-MD,.$(@F).d -PROG_DEP = .*.d - PROGRAMS = xc_restore xc_save readnotes lsevtchn LDLIBS = $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenguest) $(LDFLAGS_libxenstore) @@ -40,6 +36,6 @@ install: build .PHONY: clean clean: $(RM) *.o $(PROGRAMS) - $(RM) $(PROG_DEP) + $(RM) $(DEPS) --include $(PROG_DEP) +-include $(DEPS) diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile index 8ad4266567..276a8e9886 100644 --- a/tools/xenmon/Makefile +++ b/tools/xenmon/Makefile @@ -38,10 +38,12 @@ install: build .PHONY: clean clean: - rm -f $(BIN) + rm -f $(BIN) $(DEPS) %: %.c Makefile $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ xentrace_%: %.c Makefile $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ + +-include $(DEPS) diff --git a/tools/xenpmd/Makefile b/tools/xenpmd/Makefile index 6fc31a46b4..7e9353bfb0 100644 --- a/tools/xenpmd/Makefile +++ b/tools/xenpmd/Makefile @@ -17,4 +17,6 @@ install: all .PHONY: clean clean: - $(RM) -f $(BIN) + $(RM) -f $(BIN) $(DEPS) + +-include $(DEPS) diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile index 1177b55ac0..b40992959f 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/xenstat/libxenstat/Makefile @@ -155,4 +155,6 @@ endif .PHONY: clean clean: rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \ - $(BINDINGS) $(BINDINGSRC) + $(BINDINGS) $(BINDINGSRC) $(DEPS) + +-include $(DEPS) diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile index 4b862a4ec5..15daa39c59 100644 --- a/tools/xenstat/xentop/Makefile +++ b/tools/xenstat/xentop/Makefile @@ -37,4 +37,6 @@ endif .PHONY: clean clean: - rm -f xentop xentop.o + rm -f xentop xentop.o $(DEPS) + +-include $(DEPS) diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 9b7e9e89c6..c84505cc3c 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -8,10 +8,6 @@ CFLAGS += -Werror CFLAGS += -I. CFLAGS += $(CFLAGS_libxenctrl) -# Make gcc generate dependencies. -CFLAGS += -Wp,-MD,.$(@F).d -DEP = .*.d - CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod CLIENTS += xenstore-write xenstore-ls @@ -82,7 +78,7 @@ clean: rm -f xenstored xs_random xs_stress xs_crashme rm -f xs_tdb_dump xenstore-control rm -f xenstore $(CLIENTS) - $(RM) $(DEP) + $(RM) $(DEPS) .PHONY: TAGS TAGS: @@ -113,7 +109,7 @@ install: all $(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR) $(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR) --include $(DEP) +-include $(DEPS) # never delete any intermediate files. .SECONDARY: diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile index 336ee007e7..f540b42053 100644 --- a/tools/xentrace/Makefile +++ b/tools/xentrace/Makefile @@ -46,9 +46,12 @@ install: build .PHONY: clean clean: - $(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) + $(RM) *.a *.so *.o *.rpm $(BIN) $(LIBBIN) $(DEPS) %: %.c $(HDRS) Makefile $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) xentrace_%: %.c $(HDRS) Makefile $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) + +-include $(DEPS) + diff --git a/xen/arch/ia64/tools/p2m_foreign/Makefile b/xen/arch/ia64/tools/p2m_foreign/Makefile index 2fa62322a5..716d6750ec 100644 --- a/xen/arch/ia64/tools/p2m_foreign/Makefile +++ b/xen/arch/ia64/tools/p2m_foreign/Makefile @@ -24,10 +24,6 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror -ggdb3 CFLAGS += -I$(XEN_LIBXC) -I$(XEN_XENSTORE) -# Make gcc generate dependencies. -CFLAGS += -Wp,-MD,.$(@F).d -DEPS = .*.d - PROGRAMS = p2m_foreign LDLIBS = -L$(XEN_LIBXC) -L$(XEN_XENSTORE) -lxenguest -lxenctrl |