mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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>
60 lines
1.5 KiB
Makefile
60 lines
1.5 KiB
Makefile
XEN_ROOT=../..
|
|
include $(XEN_ROOT)/tools/Rules.mk
|
|
|
|
CFLAGS += -Werror
|
|
|
|
INCLUDES += -I $(XEN_XC)
|
|
INCLUDES += -I $(XEN_LIBXC)
|
|
INCLUDES += -I $(XEN_INCLUDE)
|
|
CFLAGS += $(INCLUDES)
|
|
|
|
HDRS = $(wildcard *.h)
|
|
|
|
TARGETS-y := xenperf xenpm
|
|
TARGETS-$(CONFIG_X86) += xen-detect
|
|
TARGETS := $(TARGETS-y)
|
|
|
|
SUBDIRS-$(CONFIG_LOMOUNT) += lomount
|
|
SUBDIRS-$(CONFIG_MINITERM) += miniterm
|
|
SUBDIRS := $(SUBDIRS-y)
|
|
|
|
INSTALL_BIN-y := xencons
|
|
INSTALL_BIN-$(CONFIG_X86) += xen-detect
|
|
INSTALL_BIN := $(INSTALL_BIN-y)
|
|
|
|
INSTALL_SBIN-y := netfix xm xen-bugtool xen-python-path xend xenperf xsview xenpm
|
|
INSTALL_SBIN := $(INSTALL_SBIN-y)
|
|
|
|
DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path)
|
|
PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH)
|
|
INSTALL_PYTHON_PROG = $(XEN_ROOT)/tools/python/install-wrap \
|
|
"$(PYTHON_PATH)" $(INSTALL_PROG)
|
|
|
|
.PHONY: all
|
|
all: build
|
|
|
|
.PHONY: build
|
|
build: $(TARGETS)
|
|
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
|
|
|
|
.PHONY: install
|
|
install: build
|
|
$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
|
|
$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
|
|
$(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR)
|
|
$(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR)
|
|
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) *.o $(TARGETS) *~ $(DEPS)
|
|
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
|
|
|
|
%.o: %.c $(HDRS) Makefile
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
xenperf xenpm: %: %.o Makefile
|
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDFLAGS_libxenctrl)
|
|
|
|
-include $(DEPS)
|