ia64/xen-unstable

view tools/misc/Makefile @ 19026:bd78714b8594

Use -MMD -MF in tools/* rather than -Wp,-M...

If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything. This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/. Specifically:
* Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
* Remove -Wp,-MD... from every other Makefile
* Remove setting of DEPS from every other Makefile
* Ensure that every Makefile says -include $(DEPS)
* Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP. The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jan 12 10:16:05 2009 +0000 (2009-01-12)
parents 8f5a67f466e2
children 3fecb8f43617
line source
1 XEN_ROOT=../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 CFLAGS += -Werror
6 INCLUDES += -I $(XEN_XC)
7 INCLUDES += -I $(XEN_LIBXC)
8 INCLUDES += -I $(XEN_INCLUDE)
9 CFLAGS += $(INCLUDES)
11 HDRS = $(wildcard *.h)
13 TARGETS-y := xenperf xenpm
14 TARGETS-$(CONFIG_X86) += xen-detect
15 TARGETS := $(TARGETS-y)
17 SUBDIRS-$(CONFIG_LOMOUNT) += lomount
18 SUBDIRS-$(CONFIG_MINITERM) += miniterm
19 SUBDIRS := $(SUBDIRS-y)
21 INSTALL_BIN-y := xencons
22 INSTALL_BIN-$(CONFIG_X86) += xen-detect
23 INSTALL_BIN := $(INSTALL_BIN-y)
25 INSTALL_SBIN-y := netfix xm xen-bugtool xen-python-path xend xenperf xsview xenpm
26 INSTALL_SBIN := $(INSTALL_SBIN-y)
28 DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path)
29 PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH)
30 INSTALL_PYTHON_PROG = $(XEN_ROOT)/tools/python/install-wrap \
31 "$(PYTHON_PATH)" $(INSTALL_PROG)
33 .PHONY: all
34 all: build
36 .PHONY: build
37 build: $(TARGETS)
38 set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
40 .PHONY: install
41 install: build
42 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
43 $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
44 $(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR)
45 $(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR)
46 set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
48 .PHONY: clean
49 clean:
50 $(RM) *.o $(TARGETS) *~ $(DEPS)
51 set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
53 %.o: %.c $(HDRS) Makefile
54 $(CC) -c $(CFLAGS) -o $@ $<
56 xenperf xenpm: %: %.o Makefile
57 $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDFLAGS_libxenctrl)
59 -include $(DEPS)