ia64/xen-unstable

view xen/Makefile @ 16381:d1ac500f77c1

x86, hvm: Allow stdvga acceleration to work with 32-bit x86.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 16 14:40:22 2007 +0000 (2007-11-16)
parents 1a8f8f96e0cd
children 1f0c6e0d74a4
line source
1 # This is the correct place to edit the build version.
2 # All other places this is stored (eg. compile.h) should be autogenerated.
3 export XEN_VERSION = 3
4 export XEN_SUBVERSION = 2
5 export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
6 export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
7 -include xen-version
9 export BASEDIR := $(CURDIR)
11 .PHONY: default
12 default: build
14 .PHONY: dist
15 dist: install
17 .PHONY: build install clean distclean cscope TAGS tags MAP
18 build install debug clean distclean cscope TAGS tags MAP::
19 $(MAKE) -f Rules.mk _$@
21 .PHONY: _build
22 _build: $(TARGET).gz
24 .PHONY: _install
25 _install: $(TARGET).gz build-headers
26 [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
27 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
28 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
29 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
30 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
31 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
32 [ -d $(DESTDIR)/usr/include/xen/arch-x86 ] || \
33 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/arch-x86
34 [ -d $(DESTDIR)/usr/include/xen/hvm ] || \
35 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/hvm
36 [ -d $(DESTDIR)/usr/include/xen/io ] || \
37 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
38 [ -d $(DESTDIR)/usr/include/xen/xsm ] || \
39 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/xsm
40 [ -d $(DESTDIR)/usr/include/xen/foreign ] || \
41 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/foreign
42 $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
43 $(INSTALL_DATA) include/public/arch-x86/*.h $(DESTDIR)/usr/include/xen/arch-x86
44 $(INSTALL_DATA) include/public/hvm/*.h $(DESTDIR)/usr/include/xen/hvm
45 $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
46 $(INSTALL_DATA) include/public/xsm/*.h $(DESTDIR)/usr/include/xen/xsm
47 $(INSTALL_DATA) include/public/foreign/*.h $(DESTDIR)/usr/include/xen/foreign
48 $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
50 .PHONY: _debug
51 _debug:
52 objdump -D -S $(TARGET)-syms > $(TARGET).s
54 .PHONY: _clean
55 _clean: delete-unfresh-files
56 $(MAKE) -C tools clean
57 $(MAKE) -C include/public/foreign clean
58 $(MAKE) -f $(BASEDIR)/Rules.mk -C include clean
59 $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
60 $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
61 $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
62 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
63 rm -f include/asm *.o $(TARGET)* *~ core
64 rm -f include/asm-*/asm-offsets.h
66 .PHONY: _distclean
67 _distclean: clean
68 rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
70 $(TARGET).gz: $(TARGET)
71 gzip -f -9 < $< > $@.new
72 mv $@.new $@
74 $(TARGET): delete-unfresh-files build-headers
75 $(MAKE) -C tools
76 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
77 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
78 $(MAKE) -f $(BASEDIR)/Rules.mk -C include
79 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
80 $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
81 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
83 # drivers/char/console.o contains static banner/compile info. Blow it away.
84 # Don't refresh these files during e.g., 'sudo make install'
85 .PHONY: delete-unfresh-files
86 delete-unfresh-files:
87 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
88 rm -f include/xen/compile.h; \
89 fi
91 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
92 include/xen/compile.h: include/xen/compile.h.in
93 @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
94 -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
95 -e 's/@@whoami@@/$(USER)/g' \
96 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
97 -e 's/@@hostname@@/$(shell hostname)/g' \
98 -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i "gcc.*version")!g' \
99 -e 's/@@version@@/$(XEN_VERSION)/g' \
100 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
101 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
102 -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date} {rev}:{node|short}" >/dev/null && hg parents --template "{date|date} {rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
103 < include/xen/compile.h.in > $@.new
104 tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
105 @mv -f $@.new $@
107 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
108 @(set -e; \
109 echo "/*"; \
110 echo " * DO NOT MODIFY."; \
111 echo " *"; \
112 echo " * This file was auto-generated from $<"; \
113 echo " *"; \
114 echo " */"; \
115 echo ""; \
116 echo "#ifndef __ASM_OFFSETS_H__"; \
117 echo "#define __ASM_OFFSETS_H__"; \
118 echo ""; \
119 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
120 echo ""; \
121 echo "#endif") <$< >$@
123 # generate header files
124 .PHONY: build-headers
125 build-headers:
126 $(MAKE) -C include/public/foreign
128 SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers
129 define all_sources
130 ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
131 find include -name 'asm-*' -prune -o -name '*.h' -print; \
132 find $(SUBDIRS) -name '*.[chS]' -print )
133 endef
135 define set_exuberant_flags
136 exuberant_flags=`$1 --version 2>/dev/null | grep -iq exuberant && \
137 echo "-I __initdata,__exitdata,__acquires,__releases \
138 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
139 --extra=+f --c-kinds=+px"`
140 endef
142 .PHONY: _TAGS
143 _TAGS:
144 rm -f TAGS; \
145 $(call set_exuberant_flags,etags); \
146 $(all_sources) | xargs etags $$exuberant_flags -a
148 .PHONY: _tags
149 _tags:
150 rm -f tags; \
151 $(call set_exuberant_flags,ctags); \
152 $(all_sources) | xargs ctags $$exuberant_flags -a
154 .PHONY: _cscope
155 _cscope:
156 $(all_sources) > cscope.files
157 cscope -k -b -q
159 .PHONY: _MAP
160 _MAP:
161 $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
163 .PHONY: FORCE
164 FORCE:
166 %.o %.i: %.c FORCE
167 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
169 %.o %.s: %.S FORCE
170 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
172 %/: FORCE
173 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o