ia64/xen-unstable

view extras/mini-os/Makefile @ 16513:b1da8762f853

blktap: remove unused headers.

Attached patch removes unused linux specific headers
and makes bswap.h ready for BSD support.

This is first step for BSD support in blktap. More to come.
No functional change.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Dec 04 10:48:28 2007 +0000 (2007-12-04)
parents bf85b467ee89
children 8101b65014e8
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
126 .PHONY: TAGS
127 TAGS:
128 $(all_sources) | xargs etags