ia64/xen-unstable

view stubdom/Makefile @ 17062:0769835cf50f

x86 shadow: Reduce scope of shadow lock.

emulate_map_dest doesn't require holding lock, since
only shadow related operation possibly involved is to
remove shadow which is less frequent and can acquire
lock inside. Rest are either guest table walk or
per-vcpu monitor table manipulation

Signed-off-by Kevin Tian <kevin.tian@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 14 10:33:12 2008 +0000 (2008-02-14)
parents e85399173769
children edfd0c343b13
line source
1 XEN_ROOT = ..
3 export XEN_OS=MiniOS
5 include $(XEN_ROOT)/Config.mk
6 export stubdom=y
7 export debug=y
9 IOEMU_OPTIONS=--disable-vnc-tls
10 BINUTILS_VERSION=2.18
11 GCC_VERSION=4.2.2
12 ZLIB_VERSION=1.2.3
13 LIBPCI_VERSION=2.2.9
14 NEWLIB_DATE=2008-01-01
15 LWIP_DATE=2008-02-08
17 WGET=wget -c
19 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
20 ifeq ($(XEN_TARGET_ARCH),x86_32)
21 GNU_TARGET_ARCH:=i686
22 endif
24 ifeq ($(GNU_TARGET_ARCH), i686)
25 TARGET_CFLAGS=
26 endif
27 ifeq ($(GNU_TARGET_ARCH), x86_64)
28 TARGET_CFLAGS=-mno-red-zone
29 endif
30 ifeq ($(GNU_TARGET_ARCH), ia64)
31 TARGET_CFLAGS=-mconstant-gp
32 endif
34 CROSS_ROOT=cross-root-$(GNU_TARGET_ARCH)
35 CROSS_PREFIX=$(CURDIR)/$(CROSS_ROOT)
36 export CROSS_COMPILE=$(GNU_TARGET_ARCH)-xen-elf-
37 export PATH:=$(CROSS_PREFIX)/bin:$(PATH)
39 .PHONY: all
40 all: qemu-stubdom
42 ################
43 # Cross-binutils
44 ################
46 binutils-$(BINUTILS_VERSION).tar.bz2:
47 $(WGET) http://ftp.gnu.org/gnu/binutils/$@
48 binutils-$(BINUTILS_VERSION): binutils-$(BINUTILS_VERSION).tar.bz2
49 tar xjf $@.tar.bz2
50 ( cd binutils-$(BINUTILS_VERSION) && patch -p1 < ../binutils.patch )
51 touch $@
53 BINUTILS_STAMPFILE=$(CROSS_ROOT)/bin/$(GNU_TARGET_ARCH)-xen-elf-ar
54 .PHONY: cross-binutils
55 cross-binutils: $(BINUTILS_STAMPFILE)
56 $(BINUTILS_STAMPFILE): binutils-$(BINUTILS_VERSION)
57 mkdir -p binutils-build
58 ( cd binutils-build && \
59 ../binutils-$(BINUTILS_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf && \
60 $(MAKE) && \
61 $(MAKE) check && \
62 $(MAKE) install )
64 ###########
65 # Cross-gcc
66 ###########
68 gcc-$(GCC_VERSION).tar.bz2:
69 $(WGET) http://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)/gcc-$(GCC_VERSION).tar.bz2
70 gcc-$(GCC_VERSION): gcc-$(GCC_VERSION).tar.bz2
71 tar xjf gcc-$(GCC_VERSION).tar.bz2
72 ( cd gcc-$(GCC_VERSION) && patch -p1 < ../gcc.patch )
73 touch $@
75 GCC_STAMPFILE=$(CROSS_ROOT)/bin/$(GNU_TARGET_ARCH)-xen-elf-gcc-$(GCC_VERSION)
76 .PHONY: cross-gcc
77 cross-gcc: $(GCC_STAMPFILE)
78 $(GCC_STAMPFILE): gcc-$(GCC_VERSION) $(BINUTILS_STAMPFILE)
79 mkdir -p gcc-build
80 ( cd gcc-build && \
81 ../gcc-$(GCC_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-languages=c --disable-libssp --with-gnu-as --with-gnu-ld && \
82 $(MAKE) GCC_FOR_TARGET='$$$$r/gcc/xgcc -B$$$$r/gcc/ '"$(TARGET_CFLAGS)"' $$(FLAGS_FOR_TARGET)' && \
83 $(MAKE) install )
85 ##############
86 # Cross-newlib
87 ##############
89 newlib-cvs:
90 cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src co -D $(NEWLIB_DATE) newlib
91 mv src newlib-cvs
92 ( cd newlib-cvs && patch -p0 < ../newlib.patch)
94 NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a
95 .PHONY: cross-newlib
96 cross-newlib: $(NEWLIB_STAMPFILE)
97 $(NEWLIB_STAMPFILE): newlib-cvs $(GCC_STAMPFILE)
98 mkdir -p newlib-build
99 ( cd newlib-build && \
100 CC_FOR_TARGET="$(GNU_TARGET_ARCH)-xen-elf-gcc $(TARGET_CFLAGS)" ../newlib-cvs/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long && \
101 $(MAKE) && \
102 $(MAKE) install )
104 ############
105 # Cross-zlib
106 ############
108 zlib-$(ZLIB_VERSION).tar.gz:
109 $(WGET) http://www.zlib.net/zlib-$(ZLIB_VERSION).tar.gz
111 ZLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libz.a
112 .PHONY: cross-zlib
113 cross-zlib: $(ZLIB_STAMPFILE)
114 $(ZLIB_STAMPFILE): zlib-$(ZLIB_VERSION).tar.gz $(NEWLIB_STAMPFILE)
115 tar xzf $<
116 ( cd zlib-$(ZLIB_VERSION) && \
117 CFLAGS="$(TARGET_CFLAGS)" CC=$(GNU_TARGET_ARCH)-xen-elf-gcc ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
118 $(MAKE) libz.a && \
119 $(MAKE) install )
121 ##############
122 # Cross-libpci
123 ##############
125 pciutils-$(LIBPCI_VERSION).tar.bz2:
126 $(WGET) http://www.kernel.org/pub/software/utils/pciutils/pciutils-$(LIBPCI_VERSION).tar.bz2
128 LIBPCI_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpci.a
129 .PHONY: cross-libpci
130 cross-libpci: $(LIBPCI_STAMPFILE)
131 $(LIBPCI_STAMPFILE): pciutils-$(LIBPCI_VERSION).tar.bz2 $(NEWLIB_STAMPFILE) $(ZLIB_STAMPFILE)
132 tar xjf $<
133 ( cd pciutils-$(LIBPCI_VERSION) && \
134 cp ../libpci.config.h lib/config.h && \
135 echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
136 cp ../libpci.config.mak lib/config.mk && \
137 $(MAKE) CC="$(GNU_TARGET_ARCH)-xen-elf-gcc $(TARGET_CFLAGS)" lib/libpci.a && \
138 $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ && \
139 $(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
140 $(INSTALL_DATA) lib/{config,header,pci,types}.h $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci/ \
141 )
143 ######
144 # lwIP
145 ######
147 lwip-cvs:
148 cvs -z 9 -d :pserver:anonymous@cvs.savannah.nongnu.org:/sources/lwip co -D $(LWIP_DATE) lwip
149 mv lwip lwip-cvs
151 #######
152 # Links
153 #######
155 .PHONY: $(CROSS_ROOT)
156 $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
158 .PHONY: mk-symlinks
159 mk-symlinks:
160 [ -h include ] || ln -sf ../tools/include .
161 mkdir -p libxc
162 [ -h libxc/Makefile ] || ( cd libxc && \
163 ln -sf ../../tools/libxc/*.h . && \
164 ln -sf ../../tools/libxc/*.c . && \
165 ln -sf ../../tools/libxc/Makefile . )
166 mkdir -p libxc/$(XEN_TARGET_ARCH)
167 [ -h libxc/$(XEN_TARGET_ARCH) ] || ( cd libxc/$(XEN_TARGET_ARCH) && \
168 ln -sf ../../tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \
169 ln -sf ../../tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \
170 ln -sf ../../tools/libxc/$(XEN_TARGET_ARCH)/Makefile . )
171 mkdir -p ioemu
172 [ -h ioemu/Makefile ] || ( cd ioemu && \
173 ln -sf ../../tools/ioemu/* . && \
174 ([ ! -h config-host.h ] || rm -f config-host.h) && \
175 ([ ! -h config-host.mak ] || rm -f config-host.mak) )
176 [ -h mini-os ] || ln -sf ../extras/mini-os .
178 #######
179 # libxc
180 #######
182 .PHONY: libxc
183 libxc: cross-zlib mk-symlinks
184 $(MAKE) -C $@
186 #######
187 # ioemu
188 #######
190 .PHONY: ioemu
191 ioemu: cross-zlib cross-libpci mk-symlinks libxc
192 [ -f ioemu/config-host.mak ] || \
193 ( cd ioemu ; XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) sh configure --prefix=/usr --enable-stubdom $(IOEMU_OPTIONS))
194 $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip-cvs
196 ######
197 # caml
198 ######
200 .PHONY: caml
201 caml:
202 $(MAKE) -C $@
204 ########
205 # minios
206 ########
208 .PHONY: qemu-stubdom
209 qemu-stubdom: mk-symlinks lwip-cvs libxc ioemu
210 $(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwip-cvs QEMUDIR=$(CURDIR)/ioemu
212 .PHONY: caml-stubdom
213 caml-stubdom: mk-symlinks lwip-cvs libxc cross-libpci caml
214 $(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwia-cvs CAMLDIR=$(CURDIR)/caml
216 #########
217 # install
218 #########
220 install: mini-os/mini-os.gz
221 $(INSTALL_PROG) stubdom-dm "$(DESTDIR)/usr/lib/xen/bin"
222 $(INSTALL_PROG) mini-os/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/stubdom.gz"
224 #######
225 # clean
226 #######
228 # Only clean the libxc/ioemu/mini-os part
229 .PHONY: clean
230 clean:
231 -$(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwip-cvs clean
232 $(MAKE) -C caml clean
233 rm -fr libxc ioemu mini-os include
235 # clean the cross-compilation result
236 .PHONY: crossclean
237 crossclean: clean
238 rm -fr $(CROSS_ROOT)
239 rm -fr binutils-build gcc-build newlib-build
240 rm -fr zlib-$(ZLIB_VERSION) pciutils-$(LIBPCI_VERSION)
242 # clean patched sources
243 .PHONY: patchclean
244 patchclean: crossclean
245 rm -fr binutils-$(BINUTILS_VERSION)
246 rm -fr gcc-$(GCC_VERSION)
247 rm -fr newlib-cvs
248 rm -fr lwip-cvs
250 # clean downloads
251 .PHONY: downloadclean
252 downloadclean: patchclean
253 rm -f binutils-$(BINUTILS_VERSION).tar.bz2
254 rm -f gcc-$(GCC_VERSION).tar.bz2
255 rm -f zlib-$(ZLIB_VERSION).tar.gz
256 rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
258 .PHONY: distclean
259 distclean: downloadclean