ia64/xen-unstable

view xen/Rules.mk @ 18842:9be2fe3de567

shadow: fix the fix for promotion/resync race.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 28 12:02:43 2008 +0000 (2008-11-28)
parents e7da388ff95d
children 275abe1c5d24
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
10 frame_pointer ?= n
12 XEN_ROOT=$(BASEDIR)/..
13 include $(XEN_ROOT)/Config.mk
15 # Hardcoded configuration implications and dependencies.
16 # Do this is a neater way if it becomes unwieldy.
17 ifeq ($(debug),y)
18 verbose := y
19 frame_pointer := y
20 else
21 CFLAGS += -DNDEBUG
22 endif
23 ifeq ($(perfc_arrays),y)
24 perfc := y
25 endif
26 ifeq ($(frame_pointer),y)
27 CFLAGS := $(shell echo $(CFLAGS) | sed -e 's/-f[^ ]*omit-frame-pointer//g')
28 endif
30 # Set ARCH/SUBARCH appropriately.
31 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
32 override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
33 sed -e 's/x86.*/x86/')
35 TARGET := $(BASEDIR)/xen
37 HDRS := $(wildcard *.h)
38 HDRS += $(wildcard $(BASEDIR)/include/xen/*.h)
39 HDRS += $(wildcard $(BASEDIR)/include/xen/hvm/*.h)
40 HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
41 HDRS += $(wildcard $(BASEDIR)/include/public/*/*.h)
42 HDRS += $(wildcard $(BASEDIR)/include/compat/*.h)
43 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
44 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
46 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
48 # Do not depend on auto-generated header files.
49 AHDRS := $(filter-out %/include/xen/compile.h,$(HDRS))
50 HDRS := $(filter-out %/asm-offsets.h,$(AHDRS))
52 # Note that link order matters!
53 ALL_OBJS-y += $(BASEDIR)/common/built_in.o
54 ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o
55 ALL_OBJS-y += $(BASEDIR)/xsm/built_in.o
56 ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
58 CFLAGS-y += -g -D__XEN__
59 CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
60 CFLAGS-$(FLASK_ENABLE) += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
61 CFLAGS-$(FLASK_ENABLE) += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
62 CFLAGS-$(ACM_SECURITY) += -DACM_SECURITY -DXSM_MAGIC=0xbcde0100
63 CFLAGS-$(verbose) += -DVERBOSE
64 CFLAGS-$(crash_debug) += -DCRASH_DEBUG
65 CFLAGS-$(perfc) += -DPERF_COUNTERS
66 CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
67 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
69 ifneq ($(max_phys_cpus),)
70 CFLAGS-y += -DMAX_PHYS_CPUS=$(max_phys_cpus)
71 endif
72 ifneq ($(max_phys_irqs),)
73 CFLAGS-y += -DMAX_PHYS_IRQS=$(max_phys_irqs)
74 endif
76 AFLAGS-y += -D__ASSEMBLY__
78 ALL_OBJS := $(ALL_OBJS-y)
80 CFLAGS := $(strip $(CFLAGS) $(CFLAGS-y))
82 # Most CFLAGS are safe for assembly files:
83 # -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
84 AFLAGS := $(strip $(AFLAGS) $(AFLAGS-y))
85 AFLAGS += $(patsubst -std=gnu%,,$(CFLAGS))
87 # LDFLAGS are only passed directly to $(LD)
88 LDFLAGS := $(strip $(LDFLAGS) $(LDFLAGS_DIRECT))
90 include Makefile
92 # Ensure each subdirectory has exactly one trailing slash.
93 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
94 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
96 # Add explicitly declared subdirectories to the object list.
97 obj-y += $(patsubst %/,%/built_in.o,$(subdir-y))
99 # Add implicitly declared subdirectories (in the object list) to the
100 # subdirectory list, and rewrite the object-list entry.
101 subdir-y += $(filter %/,$(obj-y))
102 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
104 subdir-all := $(subdir-y) $(subdir-n)
106 built_in.o: $(obj-y)
107 $(LD) $(LDFLAGS) -r -o $@ $^
109 # Force execution of pattern rules (for which PHONY cannot be directly used).
110 .PHONY: FORCE
111 FORCE:
113 %/built_in.o: FORCE
114 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
116 .PHONY: clean
117 clean:: $(addprefix _clean_, $(subdir-all))
118 rm -f *.o *~ core
119 _clean_%/: FORCE
120 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
122 %.o: %.c $(HDRS) Makefile
123 $(CC) $(CFLAGS) -c $< -o $@
125 %.o: %.S $(AHDRS) Makefile
126 $(CC) $(AFLAGS) -c $< -o $@
128 %.i: %.c $(HDRS) Makefile
129 $(CPP) $(CFLAGS) $< -o $@
131 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
132 %.s: %.S $(AHDRS) Makefile
133 $(CPP) $(AFLAGS) $< -o $@