diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-01-08 13:08:37 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-01-08 13:08:37 +0000 |
commit | 68b1230ae3933388add17859b370abeac28fb754 (patch) | |
tree | c1e72943194e6f51bda3a210ba4e2e5fbd8ac24c /xen/Rules.mk | |
parent | c6d8d541e9073453eb94d5450a4bac9826559b74 (diff) | |
download | xen-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/Rules.mk')
-rw-r--r-- | xen/Rules.mk | 35 |
1 files changed, 14 insertions, 21 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) |