aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-01-08 13:08:37 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-01-08 13:08:37 +0000
commit68b1230ae3933388add17859b370abeac28fb754 (patch)
treec1e72943194e6f51bda3a210ba4e2e5fbd8ac24c /xen
parentc6d8d541e9073453eb94d5450a4bac9826559b74 (diff)
downloadxen-68b1230ae3933388add17859b370abeac28fb754.tar.gz
xen-68b1230ae3933388add17859b370abeac28fb754.tar.bz2
xen-68b1230ae3933388add17859b370abeac28fb754.zip
Auto-build dependency files in hypervisor build tree.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen')
-rw-r--r--xen/Rules.mk35
-rw-r--r--xen/arch/ia64/Makefile6
-rw-r--r--xen/arch/ia64/Rules.mk15
-rw-r--r--xen/arch/x86/Makefile6
-rw-r--r--xen/arch/x86/Rules.mk5
-rw-r--r--xen/arch/x86/boot/Makefile3
-rw-r--r--xen/arch/x86/mm/Makefile2
-rw-r--r--xen/arch/x86/mm/hap/Makefile2
-rw-r--r--xen/arch/x86/mm/shadow/Makefile2
-rw-r--r--xen/arch/x86/x86_64/Makefile13
-rw-r--r--xen/common/Makefile10
-rw-r--r--xen/common/compat/Makefile4
12 files changed, 23 insertions, 80 deletions
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 43a4f63249..edee660175 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -34,21 +34,8 @@ override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
TARGET := $(BASEDIR)/xen
-HDRS := $(wildcard *.h)
-HDRS += $(wildcard $(BASEDIR)/include/xen/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/xen/hvm/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/public/*/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/compat/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
-
include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
-# Do not depend on auto-generated header files.
-AHDRS := $(filter-out %/include/xen/compile.h,$(HDRS))
-HDRS := $(filter-out %/asm-offsets.h,$(AHDRS))
-
# Note that link order matters!
ALL_OBJS-y += $(BASEDIR)/common/built_in.o
ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o
@@ -77,12 +64,14 @@ AFLAGS-y += -D__ASSEMBLY__
ALL_OBJS := $(ALL_OBJS-y)
-CFLAGS := $(strip $(CFLAGS) $(CFLAGS-y))
+CFLAGS_tmp := $(strip $(CFLAGS) $(CFLAGS-y))
+CFLAGS = $(CFLAGS_tmp) -Wp,-MD,.$(@F).d
# Most CFLAGS are safe for assembly files:
# -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
-AFLAGS := $(strip $(AFLAGS) $(AFLAGS-y))
-AFLAGS += $(patsubst -std=gnu%,,$(CFLAGS))
+AFLAGS_tmp := $(strip $(AFLAGS) $(AFLAGS-y))
+AFLAGS_tmp += $(patsubst -std=gnu%,,$(CFLAGS_tmp))
+AFLAGS = $(AFLAGS_tmp) -Wp,-MD,.$(@F).d
# LDFLAGS are only passed directly to $(LD)
LDFLAGS := $(strip $(LDFLAGS) $(LDFLAGS_DIRECT))
@@ -103,6 +92,8 @@ obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
subdir-all := $(subdir-y) $(subdir-n)
+DEPS = .*.d
+
built_in.o: $(obj-y)
$(LD) $(LDFLAGS) -r -o $@ $^
@@ -115,19 +106,21 @@ FORCE:
.PHONY: clean
clean:: $(addprefix _clean_, $(subdir-all))
- rm -f *.o *~ core
+ rm -f *.o *~ core $(DEPS)
_clean_%/: FORCE
$(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
-%.o: %.c $(HDRS) Makefile
+%.o: %.c Makefile
$(CC) $(CFLAGS) -c $< -o $@
-%.o: %.S $(AHDRS) Makefile
+%.o: %.S Makefile
$(CC) $(AFLAGS) -c $< -o $@
-%.i: %.c $(HDRS) Makefile
+%.i: %.c Makefile
$(CPP) $(CFLAGS) $< -o $@
# -std=gnu{89,99} gets confused by # as an end-of-line comment marker
-%.s: %.S $(AHDRS) Makefile
+%.s: %.S Makefile
$(CPP) $(AFLAGS) $< -o $@
+
+-include $(DEPS)
diff --git a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile
index 664bdfacbe..a5e57ba8a2 100644
--- a/xen/arch/ia64/Makefile
+++ b/xen/arch/ia64/Makefile
@@ -29,11 +29,11 @@ $(TARGET): $(TARGET)-syms
# Headers do not depend on auto-generated header, but object files do.
$(ALL_OBJS): $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h
-asm-offsets.s: asm-offsets.c $(HDRS) \
+asm-offsets.s: asm-offsets.c \
$(BASEDIR)/include/asm-ia64/.offsets.h.stamp
$(CC) $(CFLAGS) -DGENERATE_ASM_OFFSETS -DIA64_TASK_SIZE=0 -S -o $@ $<
-asm-xsi-offsets.s: asm-xsi-offsets.c $(HDRS)
+asm-xsi-offsets.s: asm-xsi-offsets.c
$(CC) $(CFLAGS) -S -o $@ $<
$(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h: asm-xsi-offsets.s
@@ -61,7 +61,7 @@ $(BASEDIR)/include/asm-ia64/.offsets.h.stamp:
touch $@
# I'm sure a Makefile wizard would know a better way to do this
-xen.lds.s: xen/xen.lds.S $(HDRS)
+xen.lds.s: xen/xen.lds.S
$(CC) -E $(CPPFLAGS) -P -DXEN $(AFLAGS) \
-o xen.lds.s xen/xen.lds.S
diff --git a/xen/arch/ia64/Rules.mk b/xen/arch/ia64/Rules.mk
index 2c59eb4a18..c4854a79a7 100644
--- a/xen/arch/ia64/Rules.mk
+++ b/xen/arch/ia64/Rules.mk
@@ -73,18 +73,3 @@ CFLAGS += -DCONFIG_XEN_IA64_DISABLE_OPTVFAULT
endif
LDFLAGS := -g
-
-# Additionnal IA64 include dirs.
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux-null/asm/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux-null/asm/sn/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux-null/linux/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux-xen/asm/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux-xen/asm/sn/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux-xen/linux/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux/asm-generic/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux/asm/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/linux/byteorder/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-ia64/hvm/*.h)
-
-HDRS := $(filter-out %/include/asm-ia64/asm-xsi-offsets.h,$(HDRS))
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index b961585a33..ce98fd98fa 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -78,10 +78,10 @@ $(TARGET)-syms: $(ALL_OBJS) xen.lds
$(@D)/.$(@F).1.o -o $@
rm -f $(@D)/.$(@F).[0-9]*
-asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
+asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
$(CC) $(CFLAGS) -S -o $@ $<
-xen.lds: $(TARGET_SUBARCH)/xen.lds.S $(HDRS)
+xen.lds: $(TARGET_SUBARCH)/xen.lds.S
$(CC) -P -E -Ui386 $(AFLAGS) -o $@ $<
boot/mkelf32: boot/mkelf32.c
@@ -90,4 +90,4 @@ boot/mkelf32: boot/mkelf32.c
.PHONY: clean
clean::
rm -f asm-offsets.s xen.lds boot/*.o boot/*~ boot/core boot/mkelf32
- rm -f $(BASEDIR)/.xen-syms.[0-9]*
+ rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 9380ccd780..d16f4dc4bc 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -51,10 +51,5 @@ x86_32 := n
x86_64 := y
endif
-HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/svm/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/vmx/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/asm-x86/mach-*/*.h)
-
# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
$(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index ce5c9350af..3340058c08 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,4 +1 @@
obj-y += head.o
-
-head.o: head.S $(TARGET_SUBARCH).S trampoline.S mem.S video.S \
- cmdline.S edd.S wakeup.S
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index a399c8ed14..4efde856e1 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -7,5 +7,5 @@ obj-y += guest_walk_2.o
obj-y += guest_walk_3.o
obj-$(x86_64) += guest_walk_4.o
-guest_walk_%.o: guest_walk.c $(HDRS) Makefile
+guest_walk_%.o: guest_walk.c Makefile
$(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
diff --git a/xen/arch/x86/mm/hap/Makefile b/xen/arch/x86/mm/hap/Makefile
index 64cb72786e..4261d053f5 100644
--- a/xen/arch/x86/mm/hap/Makefile
+++ b/xen/arch/x86/mm/hap/Makefile
@@ -7,5 +7,5 @@ obj-y += p2m-ept.o
guest_levels = $(subst level,,$(filter %level,$(subst ., ,$(subst _, ,$(1)))))
guest_walk_defns = -DGUEST_PAGING_LEVELS=$(call guest_levels,$(1))
-guest_walk_%level.o: guest_walk.c $(HDRS) Makefile
+guest_walk_%level.o: guest_walk.c Makefile
$(CC) $(CFLAGS) $(call guest_walk_defns,$(@F)) -c $< -o $@
diff --git a/xen/arch/x86/mm/shadow/Makefile b/xen/arch/x86/mm/shadow/Makefile
index 76c879ee81..3333d43679 100644
--- a/xen/arch/x86/mm/shadow/Makefile
+++ b/xen/arch/x86/mm/shadow/Makefile
@@ -1,5 +1,5 @@
obj-$(x86_32) += common.o guest_2.o guest_3.o
obj-$(x86_64) += common.o guest_2.o guest_3.o guest_4.o
-guest_%.o: multi.c $(HDRS) Makefile
+guest_%.o: multi.c Makefile
$(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile
index 959eaef889..a1428273eb 100644
--- a/xen/arch/x86/x86_64/Makefile
+++ b/xen/arch/x86/x86_64/Makefile
@@ -14,16 +14,3 @@ obj-$(CONFIG_COMPAT) += physdev.o
obj-$(CONFIG_COMPAT) += platform_hypercall.o
obj-$(CONFIG_COMPAT) += cpu_idle.o
obj-$(CONFIG_COMPAT) += cpufreq.o
-
-ifeq ($(CONFIG_COMPAT),y)
-# extra dependencies
-compat.o: ../compat.c
-domctl.o: ../domctl.c
-mm.o: compat/mm.c
-physdev.o: ../physdev.c
-platform_hypercall.o: ../platform_hypercall.c
-sysctl.o: ../sysctl.c
-traps.o: compat/traps.c
-cpu_idle.o: ../acpi/cpu_idle.c
-cpufreq.o: ../../../drivers/cpufreq/cpufreq.c
-endif
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 1c7edffcfc..3054f2e271 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -42,13 +42,3 @@ subdir-$(x86_64) += hvm
subdir-$(ia64) += hvm
subdir-y += libelf
-
-# Object file contains changeset and compiler information.
-version.o: $(BASEDIR)/include/xen/compile.h
-
-ifeq ($(CONFIG_COMPAT),y)
-# extra dependencies
-grant_table.o: compat/grant_table.c
-schedule.o: compat/schedule.c
-xenoprof.o: compat/xenoprof.c
-endif
diff --git a/xen/common/compat/Makefile b/xen/common/compat/Makefile
index dfab7bc77c..9a36a3dcd3 100644
--- a/xen/common/compat/Makefile
+++ b/xen/common/compat/Makefile
@@ -3,7 +3,3 @@ obj-y += kernel.o
obj-y += memory.o
obj-y += multicall.o
obj-y += xlat.o
-
-# extra dependencies
-kernel.o: ../kernel.c
-multicall.o: ../multicall.c