debuggers.hg

view xen/Rules.mk @ 22906:700ac6445812

Now add KDB to the non-kdb tree
author Mukesh Rathor
date Thu Feb 03 15:42:41 2011 -0800 (2011-02-03)
parents 2846fd19945c
children
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 lock_profile ?= n
10 crash_debug ?= n
11 frame_pointer ?= n
12 kdb ?= n
14 XEN_ROOT=$(BASEDIR)/..
15 include $(XEN_ROOT)/Config.mk
17 # Hardcoded configuration implications and dependencies.
18 # Do this is a neater way if it becomes unwieldy.
19 ifeq ($(debug),y)
20 verbose := y
21 frame_pointer := y
22 else
23 CFLAGS += -DNDEBUG
24 endif
25 ifeq ($(perfc_arrays),y)
26 perfc := y
27 endif
29 # Set ARCH/SUBARCH appropriately.
30 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
31 override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
32 sed -e 's/x86.*/x86/')
34 TARGET := $(BASEDIR)/xen
36 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
38 # Note that link order matters!
39 ALL_OBJS-y += $(BASEDIR)/common/built_in.o
40 ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o
41 ALL_OBJS-y += $(BASEDIR)/xsm/built_in.o
42 ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
43 ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o
44 ALL_OBJS-$(kdb) += $(BASEDIR)/kdb/built_in.o
46 CFLAGS-y += -g -D__XEN__
47 CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
48 CFLAGS-$(FLASK_ENABLE) += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
49 CFLAGS-$(FLASK_ENABLE) += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
50 CFLAGS-$(ACM_SECURITY) += -DACM_SECURITY -DXSM_MAGIC=0xbcde0100
51 CFLAGS-$(verbose) += -DVERBOSE
52 CFLAGS-$(crash_debug) += -DCRASH_DEBUG
53 CFLAGS-$(perfc) += -DPERF_COUNTERS
54 CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
55 CFLAGS-$(lock_profile) += -DLOCK_PROFILE
56 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
57 CFLAGS-$(kdb) += -DXEN_KDB_CONFIG
59 ifneq ($(max_phys_cpus),)
60 CFLAGS-y += -DMAX_PHYS_CPUS=$(max_phys_cpus)
61 endif
62 ifneq ($(max_phys_irqs),)
63 CFLAGS-y += -DMAX_PHYS_IRQS=$(max_phys_irqs)
64 endif
66 AFLAGS-y += -D__ASSEMBLY__
68 ALL_OBJS := $(ALL_OBJS-y)
70 # Get gcc to generate the dependencies for us.
71 CFLAGS-y += -MMD -MF .$(@F).d
72 DEPS = .*.d
74 CFLAGS += $(CFLAGS-y)
76 # Most CFLAGS are safe for assembly files:
77 # -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
78 AFLAGS += $(AFLAGS-y) $(filter-out -std=gnu%,$(CFLAGS))
80 # LDFLAGS are only passed directly to $(LD)
81 LDFLAGS += $(LDFLAGS_DIRECT)
83 include Makefile
85 # Ensure each subdirectory has exactly one trailing slash.
86 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-)))
87 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
89 # Add explicitly declared subdirectories to the object list.
90 obj-y += $(patsubst %/,%/built_in.o,$(subdir-y))
92 # Add implicitly declared subdirectories (in the object list) to the
93 # subdirectory list, and rewrite the object-list entry.
94 subdir-y += $(filter %/,$(obj-y))
95 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
97 subdir-all := $(subdir-y) $(subdir-n)
99 built_in.o: $(obj-y)
100 $(LD) $(LDFLAGS) -r -o $@ $^
102 # Force execution of pattern rules (for which PHONY cannot be directly used).
103 .PHONY: FORCE
104 FORCE:
106 %/built_in.o: FORCE
107 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
109 .PHONY: clean
110 clean:: $(addprefix _clean_, $(subdir-all))
111 rm -f *.o *~ core $(DEPS)
112 _clean_%/: FORCE
113 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
115 %.o: %.c Makefile
116 $(CC) $(CFLAGS) -c $< -o $@
118 %.o: %.S Makefile
119 $(CC) $(AFLAGS) -c $< -o $@
121 %.i: %.c Makefile
122 $(CPP) $(CFLAGS) $< -o $@
124 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
125 %.s: %.S Makefile
126 $(CPP) $(AFLAGS) $< -o $@
128 -include $(DEPS)