direct-io.hg

view extras/mini-os/Makefile @ 15481:538c3d8aa4b1

Revert 15471:7ac7f147241405af83e7a9d748cf7b01279734fc

Block-device specifiers in ioemu can contain colons, so skipping
always past the first colon is not a good idea. Better solutions are
in the pipeline to solve the blktap issues.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Jul 06 15:01:20 2007 +0100 (2007-07-06)
parents afed0aeff629
children
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 XEN_ROOT = ../..
8 include $(XEN_ROOT)/Config.mk
10 XEN_INTERFACE_VERSION := 0x00030205
11 export XEN_INTERFACE_VERSION
13 # Set TARGET_ARCH
14 override TARGET_ARCH := $(XEN_TARGET_ARCH)
16 # Set mini-os root path, used in mini-os.mk.
17 MINI-OS_ROOT=$(PWD)
18 export MINI-OS_ROOT
20 # Try to find out the architecture family TARGET_ARCH_FAM.
21 # First check whether x86_... is contained (for x86_32, x86_32y, x86_64).
22 # If not x86 then use $(TARGET_ARCH) -> for ia64, ...
23 ifeq ($(findstring x86_,$(TARGET_ARCH)),x86_)
24 TARGET_ARCH_FAM = x86
25 else
26 TARGET_ARCH_FAM = $(TARGET_ARCH)
27 endif
29 # The architecture family directory below mini-os.
30 TARGET_ARCH_DIR := arch/$(TARGET_ARCH_FAM)
32 # Export these variables for possible use in architecture dependent makefiles.
33 export TARGET_ARCH
34 export TARGET_ARCH_DIR
35 export TARGET_ARCH_FAM
36 export XEN_TARGET_X86_PAE
38 # This is used for architecture specific links.
39 # This can be overwritten from arch specific rules.
40 ARCH_LINKS =
42 # For possible special header directories.
43 # This can be overwritten from arch specific rules.
44 EXTRA_INC =
46 # Include the architecture family's special makerules.
47 # This must be before include minios.mk!
48 include $(TARGET_ARCH_DIR)/arch.mk
50 # Include common mini-os makerules.
51 include minios.mk
53 # Define some default flags for linking.
54 LDLIBS :=
55 LDARCHLIB := -L$(TARGET_ARCH_DIR) -l$(ARCH_LIB_NAME)
56 LDFLAGS_FINAL := -N -T $(TARGET_ARCH_DIR)/minios-$(TARGET_ARCH).lds
58 # Prefix for global API names. All other symbols are localised before
59 # linking with EXTRA_OBJS.
60 GLOBAL_PREFIX := xenos_
61 EXTRA_OBJS =
63 TARGET := mini-os
65 # Subdirectories common to mini-os
66 SUBDIRS := lib xenbus console
68 # The common mini-os objects to build.
69 OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
70 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
71 OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
72 OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
75 .PHONY: default
76 default: $(TARGET)
78 # Create special architecture specific links. The function arch_links
79 # has to be defined in arch.mk (see include above).
80 ifneq ($(ARCH_LINKS),)
81 $(ARCH_LINKS):
82 $(arch_links)
83 endif
85 .PHONY: links
86 links: $(ARCH_LINKS)
87 [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
89 .PHONY: arch_lib
90 arch_lib:
91 $(MAKE) --directory=$(TARGET_ARCH_DIR) || exit 1;
93 $(TARGET): links $(OBJS) arch_lib
94 $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@.o
95 $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
96 $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
97 gzip -f -9 -c $@ >$@.gz
99 .PHONY: clean arch_clean
101 arch_clean:
102 $(MAKE) --directory=$(TARGET_ARCH_DIR) clean || exit 1;
104 clean: arch_clean
105 for dir in $(SUBDIRS); do \
106 rm -f $$dir/*.o; \
107 done
108 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
109 find . -type l | xargs rm -f
110 rm -f tags TAGS
113 define all_sources
114 ( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
115 endef
117 .PHONY: cscope
118 cscope:
119 $(all_sources) > cscope.files
120 cscope -k -b -q
122 .PHONY: tags
123 tags:
124 $(all_sources) | xargs ctags