ia64/xen-unstable

view xen/Rules.mk @ 10718:3cdb93867f81

Domain ID/index mapping in xenmon.

This patch addresses the problem of xenbaked/xenmon not dealing with
large domain ID's. Xen Domain ID's increase monotonically as domains
are created; The ID's are not (often) recycled. Xenbaked was using the
domain
ID's as indices to arrays of data, and this scheme blows up as soon as
a domain ID exceeds the array size. Code has been changed in xenbaked
and xenmon to isolate domain id's from array indices, so everything is
indirect. Users should not notice any difference in behavior.

From: Rob Gardner <rob.gardner@hp.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Jul 10 16:09:20 2006 +0100 (2006-07-10)
parents b454a09cddb1
children 35a29c8f0bab
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 # Hardcoded configuration implications and dependencies.
12 # Do this is a neater way if it becomes unwieldy.
13 ifeq ($(debug),y)
14 verbose := y
15 endif
16 ifeq ($(perfc_arrays),y)
17 perfc := y
18 endif
20 XEN_ROOT=$(BASEDIR)/..
21 include $(XEN_ROOT)/Config.mk
23 # Set ARCH/SUBARCH appropriately.
24 override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
25 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
26 override COMPILE_ARCH := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
27 override TARGET_ARCH := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
29 TARGET := $(BASEDIR)/xen
31 HDRS := $(wildcard $(BASEDIR)/include/xen/*.h)
32 HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
33 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
34 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
36 INSTALL := install
37 INSTALL_DATA := $(INSTALL) -m0644
38 INSTALL_DIR := $(INSTALL) -d -m0755
40 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
42 # Do not depend on auto-generated header files.
43 HDRS := $(subst $(BASEDIR)/include/asm-$(TARGET_ARCH)/asm-offsets.h,,$(HDRS))
44 HDRS := $(subst $(BASEDIR)/include/xen/banner.h,,$(HDRS))
45 HDRS := $(subst $(BASEDIR)/include/xen/compile.h,,$(HDRS))
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)
67 CFLAGS := $(strip $(CFLAGS) $(CFLAGS-y))
68 AFLAGS := $(strip $(AFLAGS) $(AFLAGS-y))
70 include Makefile
72 # Ensure each subdirectory has exactly one trailing slash.
73 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
74 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
76 # Add explicitly declared subdirectories to the object list.
77 obj-y += $(patsubst %/,%/built_in.o,$(subdir-y))
79 # Add implicitly declared subdirectories (in the object list) to the
80 # subdirectory list, and rewrite the object-list entry.
81 subdir-y += $(filter %/,$(obj-y))
82 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
84 subdir-all := $(subdir-y) $(subdir-n)
86 built_in.o: $(obj-y)
87 $(LD) $(LDFLAGS) -r -o $@ $^
89 # Force execution of pattern rules (for which PHONY cannot be directly used).
90 .PHONY: FORCE
91 FORCE:
93 %/built_in.o: FORCE
94 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
96 .PHONY: clean
97 clean:: $(addprefix _clean_, $(subdir-all))
98 rm -f *.o *~ core
99 _clean_%/: FORCE
100 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
102 %.o: %.c $(HDRS) Makefile
103 $(CC) $(CFLAGS) -c $< -o $@
105 %.o: %.S $(HDRS) Makefile
106 $(CC) $(CFLAGS) $(AFLAGS) -c $< -o $@