direct-io.hg

view extras/mini-os/Makefile @ 11406:765b7e23d979

[XEN] Improve Xen information in register dumps.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Sep 01 01:25:15 2006 +0100 (2006-09-01)
parents 1c3455182cee
children ba4c40353fff
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
126 %.o: %.c $(HDRS) Makefile
127 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
129 %.o: %.S $(HDRS) Makefile
130 $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
132 define all_sources
133 ( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
134 endef
136 .PHONY: cscope
137 cscope:
138 $(all_sources) > cscope.files
139 cscope -k -b -q