ia64/xen-unstable

view xen/Rules.mk @ 16722:04d3ca600f74

-DNDEBUG for hypervisor only
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 15 18:50:44 2008 +0000 (2008-01-15)
parents ba69fe2dce91
children d6c12530c69d
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 COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
32 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
33 override COMPILE_ARCH := $(shell echo $(XEN_COMPILE_ARCH) | \
34 sed -e 's/x86.*/x86/' \
35 -e 's/powerpc.*/powerpc/')
36 override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
37 sed -e 's/x86.*/x86/' \
38 -e 's/powerpc.*/powerpc/')
40 TARGET := $(BASEDIR)/xen
42 HDRS := $(wildcard *.h)
43 HDRS += $(wildcard $(BASEDIR)/include/xen/*.h)
44 HDRS += $(wildcard $(BASEDIR)/include/xen/hvm/*.h)
45 HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
46 HDRS += $(wildcard $(BASEDIR)/include/public/*/*.h)
47 HDRS += $(wildcard $(BASEDIR)/include/compat/*.h)
48 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
49 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
51 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
53 # Do not depend on auto-generated header files.
54 AHDRS := $(filter-out %/include/xen/compile.h,$(HDRS))
55 HDRS := $(filter-out %/asm-offsets.h,$(AHDRS))
57 # Note that link order matters!
58 ALL_OBJS-y += $(BASEDIR)/common/built_in.o
59 ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o
60 ALL_OBJS-y += $(BASEDIR)/xsm/built_in.o
61 ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
63 CFLAGS-y += -g -D__XEN__
64 CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
65 CFLAGS-$(FLASK_ENABLE) += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
66 CFLAGS-$(FLASK_ENABLE) += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
67 CFLAGS-$(ACM_SECURITY) += -DACM_SECURITY -DXSM_MAGIC=0xbcde0100
68 CFLAGS-$(verbose) += -DVERBOSE
69 CFLAGS-$(crash_debug) += -DCRASH_DEBUG
70 CFLAGS-$(perfc) += -DPERF_COUNTERS
71 CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
72 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
74 ifneq ($(max_phys_cpus),)
75 CFLAGS-y += -DMAX_PHYS_CPUS=$(max_phys_cpus)
76 endif
78 AFLAGS-y += -D__ASSEMBLY__
80 ALL_OBJS := $(ALL_OBJS-y)
82 CFLAGS := $(strip $(CFLAGS) $(CFLAGS-y))
84 # Most CFLAGS are safe for assembly files:
85 # -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
86 AFLAGS := $(strip $(AFLAGS) $(AFLAGS-y))
87 AFLAGS += $(patsubst -std=gnu%,,$(CFLAGS))
89 # LDFLAGS are only passed directly to $(LD)
90 LDFLAGS := $(strip $(LDFLAGS) $(LDFLAGS_DIRECT))
92 include Makefile
94 # Ensure each subdirectory has exactly one trailing slash.
95 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
96 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
98 # Add explicitly declared subdirectories to the object list.
99 obj-y += $(patsubst %/,%/built_in.o,$(subdir-y))
101 # Add implicitly declared subdirectories (in the object list) to the
102 # subdirectory list, and rewrite the object-list entry.
103 subdir-y += $(filter %/,$(obj-y))
104 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
106 subdir-all := $(subdir-y) $(subdir-n)
108 built_in.o: $(obj-y)
109 $(LD) $(LDFLAGS) -r -o $@ $^
111 # Force execution of pattern rules (for which PHONY cannot be directly used).
112 .PHONY: FORCE
113 FORCE:
115 %/built_in.o: FORCE
116 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
118 .PHONY: clean
119 clean:: $(addprefix _clean_, $(subdir-all))
120 rm -f *.o *~ core
121 _clean_%/: FORCE
122 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
124 %.o: %.c $(HDRS) Makefile
125 $(CC) $(CFLAGS) -c $< -o $@
127 %.o: %.S $(AHDRS) Makefile
128 $(CC) $(AFLAGS) -c $< -o $@
130 %.i: %.c $(HDRS) Makefile
131 $(CPP) $(CFLAGS) $< -o $@
133 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
134 %.s: %.S $(AHDRS) Makefile
135 $(CPP) $(AFLAGS) $< -o $@