ia64/xen-unstable

view extras/mini-os/minios.mk @ 17042:a905c582a406

Add stubdomain support. See stubdom/README for usage details.

- Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in
arch_limits.h so as to permit getting them from there without
pulling all the internal Mini-OS defines.
- Setup a xen-elf cross-compilation environment in stubdom/cross-root
- Add a POSIX layer on top of Mini-OS by linking against the newlib C
library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c
- Cross-compile zlib and libpci too.
- Add an xs.h-compatible layer on top of Mini-OS' xenbus.
- Cross-compile libxc with an additional xc_minios.c and a few things
disabled.
- Cross-compile ioemu with an additional block-vbd, but without sound,
tpm and other details. A few hacks are needed:
- Align ide and scsi buffers at least on sector size to permit
direct transmission to the block backend. While we are at it, just
page-align it to possibly save a segment. Also, limit the scsi
buffer size because of limitations of the block paravirtualization
protocol.
- Allocate big tables dynamically rather that letting them go to
bss: when Mini-OS gets installed in memory, bss is not lazily
allocated, and doing so during Mini-OS is unnecessarily trick while
we can simply use malloc.
- Had to change the Mini-OS compilation somehow, so as to export
Mini-OS compilation flags to the Makefiles of libxc and ioemu.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 12 14:35:39 2008 +0000 (2008-02-12)
parents 3c49ae5641b0
children d02490be30f5
line source
1 #
2 # The file contains the common make rules for building mini-os.
3 #
5 debug = y
7 # Define some default flags.
8 # NB. '-Wcast-qual' is nasty, so I omitted it.
9 DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
10 DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
11 DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
12 DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
14 DEF_ASFLAGS = -D__ASSEMBLY__
15 DEF_LDFLAGS =
17 ifeq ($(debug),y)
18 DEF_CFLAGS += -g
19 else
20 DEF_CFLAGS += -O3
21 endif
23 # Build the CFLAGS and ASFLAGS for compiling and assembling.
24 # DEF_... flags are the common mini-os flags,
25 # ARCH_... flags may be defined in arch/$(TARGET_ARCH_FAM/rules.mk
26 CFLAGS := $(DEF_CFLAGS) $(ARCH_CFLAGS)
27 CPPFLAGS := $(DEF_CPPFLAGS) $(ARCH_CPPFLAGS)
28 ASFLAGS := $(DEF_ASFLAGS) $(ARCH_ASFLAGS)
29 LDFLAGS := $(DEF_LDFLAGS) $(ARCH_LDFLAGS)
31 # Special build dependencies.
32 # Rebuild all after touching this/these file(s)
33 EXTRA_DEPS = $(MINI-OS_ROOT)/minios.mk \
34 $(MINI-OS_ROOT)/$(TARGET_ARCH_DIR)/arch.mk
36 # Find all header files for checking dependencies.
37 HDRS := $(wildcard $(MINI-OS_ROOT)/include/*.h)
38 HDRS += $(wildcard $(MINI-OS_ROOT)/include/xen/*.h)
39 HDRS += $(wildcard $(ARCH_INC)/*.h)
40 # For special wanted header directories.
41 extra_heads := $(foreach dir,$(EXTRA_INC),$(wildcard $(dir)/*.h))
42 HDRS += $(extra_heads)
44 # Add the special header directories to the include paths.
45 override CPPFLAGS := $(CPPFLAGS) $(extra_incl)
47 # The name of the architecture specific library.
48 # This is on x86_32: libx86_32.a
49 # $(ARCH_LIB) has to built in the architecture specific directory.
50 ARCH_LIB_NAME = $(XEN_TARGET_ARCH)
51 ARCH_LIB := lib$(ARCH_LIB_NAME).a
53 # This object contains the entrypoint for startup from Xen.
54 # $(HEAD_ARCH_OBJ) has to be built in the architecture specific directory.
55 HEAD_ARCH_OBJ := $(XEN_TARGET_ARCH).o
56 HEAD_OBJ := $(TARGET_ARCH_DIR)/$(HEAD_ARCH_OBJ)
59 %.o: %.c $(HDRS) Makefile $(EXTRA_DEPS)
60 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
62 %.o: %.S $(HDRS) Makefile $(EXTRA_DEPS)
63 $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@