ia64/xen-unstable

view xen/Rules.mk @ 19238:b749d0aba17f

xenconsoled: make guest console visible on NetBSD dom0

After openpty(), slave_fd must be closed or guest console output goes
to the slave while select() in xen console client listens on the
master.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Feb 20 11:13:11 2009 +0000 (2009-02-20)
parents 0e448d0a41ff
children 7d55cc23493b
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
27 # Set ARCH/SUBARCH appropriately.
28 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
29 override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
30 sed -e 's/x86.*/x86/')
32 TARGET := $(BASEDIR)/xen
34 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
36 # Note that link order matters!
37 ALL_OBJS-y += $(BASEDIR)/common/built_in.o
38 ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o
39 ALL_OBJS-y += $(BASEDIR)/xsm/built_in.o
40 ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
42 CFLAGS-y += -g -D__XEN__
43 CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
44 CFLAGS-$(FLASK_ENABLE) += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
45 CFLAGS-$(FLASK_ENABLE) += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
46 CFLAGS-$(ACM_SECURITY) += -DACM_SECURITY -DXSM_MAGIC=0xbcde0100
47 CFLAGS-$(verbose) += -DVERBOSE
48 CFLAGS-$(crash_debug) += -DCRASH_DEBUG
49 CFLAGS-$(perfc) += -DPERF_COUNTERS
50 CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
51 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
53 ifneq ($(max_phys_cpus),)
54 CFLAGS-y += -DMAX_PHYS_CPUS=$(max_phys_cpus)
55 endif
56 ifneq ($(max_phys_irqs),)
57 CFLAGS-y += -DMAX_PHYS_IRQS=$(max_phys_irqs)
58 endif
60 AFLAGS-y += -D__ASSEMBLY__
62 ALL_OBJS := $(ALL_OBJS-y)
64 # Get gcc to generate the dependencies for us.
65 CFLAGS-y += -MMD -MF .$(@F).d
66 DEPS = .*.d
68 CFLAGS += $(CFLAGS-y)
70 # Most CFLAGS are safe for assembly files:
71 # -std=gnu{89,99} gets confused by #-prefixed end-of-line comments
72 AFLAGS += $(AFLAGS-y) $(filter-out -std=gnu%,$(CFLAGS))
74 # LDFLAGS are only passed directly to $(LD)
75 LDFLAGS += $(LDFLAGS_DIRECT)
77 include Makefile
79 # Ensure each subdirectory has exactly one trailing slash.
80 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
81 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
83 # Add explicitly declared subdirectories to the object list.
84 obj-y += $(patsubst %/,%/built_in.o,$(subdir-y))
86 # Add implicitly declared subdirectories (in the object list) to the
87 # subdirectory list, and rewrite the object-list entry.
88 subdir-y += $(filter %/,$(obj-y))
89 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
91 subdir-all := $(subdir-y) $(subdir-n)
93 built_in.o: $(obj-y)
94 $(LD) $(LDFLAGS) -r -o $@ $^
96 # Force execution of pattern rules (for which PHONY cannot be directly used).
97 .PHONY: FORCE
98 FORCE:
100 %/built_in.o: FORCE
101 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o
103 .PHONY: clean
104 clean:: $(addprefix _clean_, $(subdir-all))
105 rm -f *.o *~ core $(DEPS)
106 _clean_%/: FORCE
107 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean
109 %.o: %.c Makefile
110 $(CC) $(CFLAGS) -c $< -o $@
112 %.o: %.S Makefile
113 $(CC) $(AFLAGS) -c $< -o $@
115 %.i: %.c Makefile
116 $(CPP) $(CFLAGS) $< -o $@
118 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
119 %.s: %.S Makefile
120 $(CPP) $(AFLAGS) $< -o $@
122 -include $(DEPS)