direct-io.hg

view extras/mini-os/Makefile @ 12477:7f7aeaa0cba6

[HVMLOADEr] Reserve MMIO 0xa0000 to 0xc0000 in ACPI dsdt.

Avoids possible vga driver loading problem in HVM Windows guest.
Also fixes a Makefile bug in hvmloader directory.

Signed-off-by: Qing He <qing.he@intel.com>
author kfraser@localhost.localdomain
date Fri Nov 17 10:02:54 2006 +0000 (2006-11-17)
parents ba4c40353fff
children a3c6479c87ef
line source
1 debug ?= y
2 pae ?= n
4 XEN_ROOT = ../..
5 include $(XEN_ROOT)/Config.mk
7 # Set TARGET_ARCH
8 override TARGET_ARCH := $(XEN_TARGET_ARCH)
10 XEN_INTERFACE_VERSION := 0x00030203
12 # NB. '-Wcast-qual' is nasty, so I omitted it.
13 CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
14 CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
15 CFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
17 ASFLAGS = -D__ASSEMBLY__
19 LDLIBS = -L. -lminios
20 LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
22 # For possible special source directories.
23 EXTRA_SRC =
24 # For possible special header directories.
25 EXTRA_INC =
27 # Standard name for architecture specific subdirectories.
28 TARGET_ARCH_DIR = $(TARGET_ARCH)
29 # This is used for architecture specific links.
30 ARCH_LINKS =
32 ifeq ($(TARGET_ARCH),x86_32)
33 CFLAGS += -m32 -march=i686
34 LDFLAGS += -m elf_i386
35 TARGET_ARCH_DIR = x86
36 EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
37 EXTRA_SRC += arch/$(EXTRA_INC)
38 endif
40 ifeq ($(TARGET_ARCH)$(pae),x86_32y)
41 CFLAGS += -DCONFIG_X86_PAE=1
42 ASFLAGS += -DCONFIG_X86_PAE=1
43 TARGET_ARCH_DIR = x86
44 EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
45 EXTRA_SRC += arch/$(EXTRA_INC)
46 endif
48 ifeq ($(TARGET_ARCH),x86_64)
49 CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
50 CFLAGS += -fno-asynchronous-unwind-tables
51 LDFLAGS += -m elf_x86_64
52 TARGET_ARCH_DIR = x86
53 EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
54 EXTRA_SRC += arch/$(EXTRA_INC)
55 endif
57 ifeq ($(TARGET_ARCH),ia64)
58 CFLAGS += -mfixed-range=f12-f15,f32-f127
59 ASFLAGS += -x assembler-with-cpp -ansi -Wall
60 ASFLAGS += -mfixed-range=f12-f15,f32-f127
61 ARCH_LINKS = IA64_LINKS # Special link on ia64 needed
62 define arch_links
63 [ -e include/ia64/asm-xsi-offsets.h ] || ln -sf ../../../../xen/include/asm-ia64/asm-xsi-offsets.h include/ia64/asm-xsi-offsets.h
64 endef
65 endif
67 ifeq ($(debug),y)
68 CFLAGS += -g
69 else
70 CFLAGS += -O3
71 endif
73 # Add the special header directories to the include paths.
74 extra_incl := $(foreach dir,$(EXTRA_INC),-Iinclude/$(dir))
75 override CPPFLAGS := -Iinclude $(CPPFLAGS) -Iinclude/$(TARGET_ARCH_DIR) $(extra_incl)
77 TARGET := mini-os
79 HEAD := $(TARGET_ARCH).o
80 OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
81 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
82 OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
83 OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
84 OBJS += $(patsubst %.S,%.o,$(wildcard arch/$(TARGET_ARCH_DIR)/*.S))
85 OBJS += $(patsubst %.c,%.o,$(wildcard arch/$(TARGET_ARCH_DIR)/*.c))
86 # For special wanted source directories.
87 extra_objs := $(foreach dir,$(EXTRA_SRC),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
88 OBJS += $(extra_objs)
89 extra_objs := $(foreach dir,$(EXTRA_SRC),$(patsubst %.S,%.o,$(wildcard $(dir)/*.S)))
90 OBJS += $(extra_objs)
92 HDRS := $(wildcard include/*.h)
93 HDRS += $(wildcard include/xen/*.h)
94 HDRS += $(wildcard include/$(TARGET_ARCH_DIR)/*.h)
95 # For special wanted header directories.
96 extra_heads := $(foreach dir,$(EXTRA_INC),$(wildcard $(dir)/*.h))
97 HDRS += $(extra_heads)
99 .PHONY: default
100 default: $(TARGET)
102 # Create special architecture specific links.
103 ifneq ($(ARCH_LINKS),)
104 $(ARCH_LINKS):
105 $(arch_links)
106 endif
108 .PHONY: links
109 links: $(ARCH_LINKS)
110 [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
112 libminios.a: links $(OBJS) $(HEAD)
113 $(AR) r libminios.a $(HEAD) $(OBJS)
115 $(TARGET): libminios.a $(HEAD)
116 $(LD) $(LDFLAGS) $(HEAD) $(LDLIBS) -o $@.elf
117 gzip -f -9 -c $@.elf >$@.gz
119 .PHONY: clean
120 clean:
121 find . -type f -name '*.o' | xargs rm -f
122 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
123 rm -f libminios.a
124 find . -type l | xargs rm -f
125 rm -f tags TAGS
127 %.o: %.c $(HDRS) Makefile
128 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
130 %.o: %.S $(HDRS) Makefile
131 $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
133 define all_sources
134 ( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
135 endef
137 .PHONY: cscope
138 cscope:
139 $(all_sources) > cscope.files
140 cscope -k -b -q
142 .PHONY: tags
143 tags:
144 $(all_sources) | xargs ctags