ia64/xen-unstable

view extras/mini-os/Makefile @ 14027:e4ddec3dffb0

[XEN] Fix skip-verify shadow heuristic
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Tue Feb 20 13:57:26 2007 +0000 (2007-02-20)
parents 236687fb42d7
children afed0aeff629
line source
1 # Common Makefile for mini-os.
2 #
3 # Every architecture directory below mini-os/arch has to have a
4 # Makefile and a arch.mk.
5 #
7 pae ?= n
9 XEN_ROOT = ../..
10 include $(XEN_ROOT)/Config.mk
12 XEN_INTERFACE_VERSION := 0x00030205
13 export XEN_INTERFACE_VERSION
15 # Set TARGET_ARCH
16 override TARGET_ARCH := $(XEN_TARGET_ARCH)
18 # Set mini-os root path, used in mini-os.mk.
19 MINI-OS_ROOT=$(PWD)
20 export MINI-OS_ROOT
22 # Try to find out the architecture family TARGET_ARCH_FAM.
23 # First check whether x86_... is contained (for x86_32, x86_32y, x86_64).
24 # If not x86 then use $(TARGET_ARCH) -> for ia64, ...
25 ifeq ($(findstring x86_,$(TARGET_ARCH)),x86_)
26 TARGET_ARCH_FAM = x86
27 else
28 TARGET_ARCH_FAM = $(TARGET_ARCH)
29 endif
31 # The architecture family directory below mini-os.
32 TARGET_ARCH_DIR := arch/$(TARGET_ARCH_FAM)
34 # Export these variables for possible use in architecture dependent makefiles.
35 export TARGET_ARCH
36 export TARGET_ARCH_DIR
37 export TARGET_ARCH_FAM
39 # This is used for architecture specific links.
40 # This can be overwritten from arch specific rules.
41 ARCH_LINKS =
43 # For possible special header directories.
44 # This can be overwritten from arch specific rules.
45 EXTRA_INC =
47 # Include the architecture family's special makerules.
48 # This must be before include minios.mk!
49 include $(TARGET_ARCH_DIR)/arch.mk
51 # Include common mini-os makerules.
52 include minios.mk
54 # Define some default flags for linking.
55 LDLIBS :=
56 LDARCHLIB := -L$(TARGET_ARCH_DIR) -l$(ARCH_LIB_NAME)
57 LDFLAGS_FINAL := -N -T $(TARGET_ARCH_DIR)/minios-$(TARGET_ARCH).lds
59 # Prefix for global API names. All other symbols are localised before
60 # linking with EXTRA_OBJS.
61 GLOBAL_PREFIX := xenos_
62 EXTRA_OBJS =
64 TARGET := mini-os
66 # Subdirectories common to mini-os
67 SUBDIRS := lib xenbus console
69 # The common mini-os objects to build.
70 OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
71 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
72 OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
73 OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
76 .PHONY: default
77 default: $(TARGET)
79 # Create special architecture specific links. The function arch_links
80 # has to be defined in arch.mk (see include above).
81 ifneq ($(ARCH_LINKS),)
82 $(ARCH_LINKS):
83 $(arch_links)
84 endif
86 .PHONY: links
87 links: $(ARCH_LINKS)
88 [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
90 .PHONY: arch_lib
91 arch_lib:
92 $(MAKE) --directory=$(TARGET_ARCH_DIR) || exit 1;
94 $(TARGET): links $(OBJS) arch_lib
95 $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@.o
96 $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
97 $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
98 gzip -f -9 -c $@ >$@.gz
100 .PHONY: clean arch_clean
102 arch_clean:
103 $(MAKE) --directory=$(TARGET_ARCH_DIR) clean || exit 1;
105 clean: arch_clean
106 for dir in $(SUBDIRS); do \
107 rm -f $$dir/*.o; \
108 done
109 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
110 find . -type l | xargs rm -f
111 rm -f tags TAGS
114 define all_sources
115 ( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
116 endef
118 .PHONY: cscope
119 cscope:
120 $(all_sources) > cscope.files
121 cscope -k -b -q
123 .PHONY: tags
124 tags:
125 $(all_sources) | xargs ctags