debuggers.hg

view xen/Rules.mk @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 2846fd19945c
children 700ac6445812
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
13 XEN_ROOT=$(BASEDIR)/..
14 include $(XEN_ROOT)/Config.mk
16 # Hardcoded configuration implications and dependencies.
17 # Do this is a neater way if it becomes unwieldy.
18 ifeq ($(debug),y)
19 verbose := y
20 frame_pointer := y
21 else
22 CFLAGS += -DNDEBUG
23 endif
24 ifeq ($(perfc_arrays),y)
25 perfc := y
26 endif
28 # Set ARCH/SUBARCH appropriately.
29 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
30 override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
31 sed -e 's/x86.*/x86/')
33 TARGET := $(BASEDIR)/xen
35 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
37 # Note that link order matters!
38 ALL_OBJS-y += $(BASEDIR)/common/built_in.o
39 ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o
40 ALL_OBJS-y += $(BASEDIR)/xsm/built_in.o
41 ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
42 ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o
44 CFLAGS-y += -g -D__XEN__
45 CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
46 CFLAGS-$(FLASK_ENABLE) += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
47 CFLAGS-$(FLASK_ENABLE) += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
48 CFLAGS-$(ACM_SECURITY) += -DACM_SECURITY -DXSM_MAGIC=0xbcde0100
49 CFLAGS-$(verbose) += -DVERBOSE
50 CFLAGS-$(crash_debug) += -DCRASH_DEBUG
51 CFLAGS-$(perfc) += -DPERF_COUNTERS
52 CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
53 CFLAGS-$(lock_profile) += -DLOCK_PROFILE
54 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
56 ifneq ($(max_phys_cpus),)
57 CFLAGS-y += -DMAX_PHYS_CPUS=$(max_phys_cpus)
58 endif
59 ifneq ($(max_phys_irqs),)
60 CFLAGS-y += -DMAX_PHYS_IRQS=$(max_phys_irqs)
61 endif
63 AFLAGS-y += -D__ASSEMBLY__
65 ALL_OBJS := $(ALL_OBJS-y)
67 # Get gcc to generate the dependencies for us.
68 CFLAGS-y += -MMD -MF .$(@F).d
69 DEPS = .*.d
71 CFLAGS += $(CFLAGS-y)
73 # Most CFLAGS are safe for assembly files:
74 # -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
75 AFLAGS += $(AFLAGS-y) $(filter-out -std=gnu%,$(CFLAGS))
77 # LDFLAGS are only passed directly to $(LD)
78 LDFLAGS += $(LDFLAGS_DIRECT)
80 include Makefile
82 # Ensure each subdirectory has exactly one trailing slash.
83 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-)))
84 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
86 # Add explicitly declared subdirectories to the object list.
87 obj-y += $(patsubst %/,%/built_in.o,$(subdir-y))
89 # Add implicitly declared subdirectories (in the object list) to the
90 # subdirectory list, and rewrite the object-list entry.
91 subdir-y += $(filter %/,$(obj-y))
92 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
94 subdir-all := $(subdir-y) $(subdir-n)
96 built_in.o: $(obj-y)
97 $(LD) $(LDFLAGS) -r -o $@ $^
99 # Force execution of pattern rules (for which PHONY cannot be directly used).
100 .PHONY: FORCE
101 FORCE:
103 %/built_in.o: FORCE
104 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
106 .PHONY: clean
107 clean:: $(addprefix _clean_, $(subdir-all))
108 rm -f *.o *~ core $(DEPS)
109 _clean_%/: FORCE
110 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
112 %.o: %.c Makefile
113 $(CC) $(CFLAGS) -c $< -o $@
115 %.o: %.S Makefile
116 $(CC) $(AFLAGS) -c $< -o $@
118 %.i: %.c Makefile
119 $(CPP) $(CFLAGS) $< -o $@
121 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
122 %.s: %.S Makefile
123 $(CPP) $(AFLAGS) $< -o $@
125 -include $(DEPS)