ia64/xen-unstable

view xen/Rules.mk @ 14671:4a873ab4e261

[LINUX] Make sure to initialiase the xen features bitmap before first use on x86_64.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Fri Mar 30 14:13:53 2007 +0100 (2007-03-30)
parents 4847e5b8adf1
children a7601de2f733
line source
2 #
3 # If you change any of these configuration options then you must
4 # 'make clean' before rebuilding.
5 #
6 verbose ?= n
7 perfc ?= n
8 perfc_arrays?= n
9 crash_debug ?= n
11 XEN_ROOT=$(BASEDIR)/..
12 include $(XEN_ROOT)/Config.mk
14 # Hardcoded configuration implications and dependencies.
15 # Do this is a neater way if it becomes unwieldy.
16 ifeq ($(debug),y)
17 verbose := y
18 endif
19 ifeq ($(perfc_arrays),y)
20 perfc := y
21 endif
23 # Set ARCH/SUBARCH appropriately.
24 override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
25 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
26 override COMPILE_ARCH := $(shell echo $(XEN_COMPILE_ARCH) | \
27 sed -e 's/x86.*/x86/' \
28 -e 's/powerpc.*/powerpc/')
29 override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
30 sed -e 's/x86.*/x86/' \
31 -e 's/powerpc.*/powerpc/')
33 TARGET := $(BASEDIR)/xen
35 HDRS := $(wildcard $(BASEDIR)/include/xen/*.h)
36 HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
37 HDRS += $(wildcard $(BASEDIR)/include/compat/*.h)
38 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
39 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
41 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
43 # Do not depend on auto-generated header files.
44 AHDRS := $(filter-out %/include/xen/compile.h,$(HDRS))
45 HDRS := $(filter-out %/asm-offsets.h,$(AHDRS))
47 # Note that link order matters!
48 ALL_OBJS-y += $(BASEDIR)/common/built_in.o
49 ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o
50 ALL_OBJS-$(ACM_SECURITY) += $(BASEDIR)/acm/built_in.o
51 ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
53 CFLAGS-y += -g -D__XEN__
54 CFLAGS-$(ACM_SECURITY) += -DACM_SECURITY
55 CFLAGS-$(verbose) += -DVERBOSE
56 CFLAGS-$(crash_debug) += -DCRASH_DEBUG
57 CFLAGS-$(perfc) += -DPERF_COUNTERS
58 CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
60 ifneq ($(max_phys_cpus),)
61 CFLAGS-y += -DMAX_PHYS_CPUS=$(max_phys_cpus)
62 endif
64 AFLAGS-y += -D__ASSEMBLY__
66 ALL_OBJS := $(ALL_OBJS-y)
68 CFLAGS := $(strip $(CFLAGS) $(CFLAGS-y))
70 # Most CFLAGS are safe for assembly files:
71 # -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
72 AFLAGS := $(strip $(AFLAGS) $(AFLAGS-y))
73 AFLAGS += $(patsubst -std=gnu%,,$(CFLAGS))
75 # LDFLAGS are only passed directly to $(LD)
76 LDFLAGS := $(strip $(LDFLAGS) $(LDFLAGS_DIRECT))
78 include Makefile
80 # Ensure each subdirectory has exactly one trailing slash.
81 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
82 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
84 # Add explicitly declared subdirectories to the object list.
85 obj-y += $(patsubst %/,%/built_in.o,$(subdir-y))
87 # Add implicitly declared subdirectories (in the object list) to the
88 # subdirectory list, and rewrite the object-list entry.
89 subdir-y += $(filter %/,$(obj-y))
90 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
92 subdir-all := $(subdir-y) $(subdir-n)
94 built_in.o: $(obj-y)
95 $(LD) $(LDFLAGS) -r -o $@ $^
97 # Force execution of pattern rules (for which PHONY cannot be directly used).
98 .PHONY: FORCE
99 FORCE:
101 %/built_in.o: FORCE
102 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
104 .PHONY: clean
105 clean:: $(addprefix _clean_, $(subdir-all))
106 rm -f *.o *~ core
107 _clean_%/: FORCE
108 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
110 %.o: %.c $(HDRS) Makefile
111 $(CC) $(CFLAGS) -c $< -o $@
113 %.o: %.S $(AHDRS) Makefile
114 $(CC) $(AFLAGS) -c $< -o $@
116 %.i: %.c $(HDRS) Makefile
117 $(CPP) $(CFLAGS) $< -o $@
119 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
120 %.s: %.S $(AHDRS) Makefile
121 $(CPP) $(AFLAGS) $< -o $@