ia64/xen-unstable

view xen/Makefile @ 15688:88bb0d305308

[ELF] Load elf symbols when BSD_SYMTAB=yes.

When a guest kernel specifies BSD_SYMTAB=yes, then Xen loads the ELF
symbols for it. This works with Xen 3.0.4, but not with Xen 3.1.
During the libelf work between Xen 3.0.4 and Xen 3.1 the loading got
broken in the way, that BSD_SYMTAB gets parsed but not handled.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author kfraser@localhost.localdomain
date Wed Aug 01 15:47:54 2007 +0100 (2007-08-01)
parents 049e4e61644d
children ceb0115627b9
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 = 0
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/foreign ] || \
39 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/foreign
40 $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
41 $(INSTALL_DATA) include/public/arch-x86/*.h $(DESTDIR)/usr/include/xen/arch-x86
42 $(INSTALL_DATA) include/public/hvm/*.h $(DESTDIR)/usr/include/xen/hvm
43 $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
44 $(INSTALL_DATA) include/public/foreign/*.h $(DESTDIR)/usr/include/xen/foreign
45 $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
47 .PHONY: _debug
48 _debug:
49 objdump -D -S $(TARGET)-syms > $(TARGET).s
51 .PHONY: _clean
52 _clean: delete-unfresh-files
53 $(MAKE) -C tools clean
54 $(MAKE) -C include/public/foreign clean
55 $(MAKE) -f $(BASEDIR)/Rules.mk -C include clean
56 $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
57 $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
58 $(MAKE) -f $(BASEDIR)/Rules.mk -C acm clean
59 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
60 rm -f include/asm *.o $(TARGET)* *~ core
61 rm -f include/asm-*/asm-offsets.h
63 .PHONY: _distclean
64 _distclean: clean
65 rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
67 $(TARGET).gz: $(TARGET)
68 gzip -f -9 < $< > $@.new
69 mv $@.new $@
71 $(TARGET): delete-unfresh-files build-headers
72 $(MAKE) -C tools
73 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
74 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
75 $(MAKE) -f $(BASEDIR)/Rules.mk -C include
76 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
77 $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
78 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
80 # drivers/char/console.o contains static banner/compile info. Blow it away.
81 # Don't refresh these files during e.g., 'sudo make install'
82 .PHONY: delete-unfresh-files
83 delete-unfresh-files:
84 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
85 rm -f include/xen/compile.h; \
86 fi
88 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
89 include/xen/compile.h: include/xen/compile.h.in
90 @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
91 -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
92 -e 's/@@whoami@@/$(USER)/g' \
93 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
94 -e 's/@@hostname@@/$(shell hostname)/g' \
95 -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i "gcc.*version")!g' \
96 -e 's/@@version@@/$(XEN_VERSION)/g' \
97 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
98 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
99 -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' \
100 < include/xen/compile.h.in > $@.new
101 tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
102 @mv -f $@.new $@
104 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
105 @(set -e; \
106 echo "/*"; \
107 echo " * DO NOT MODIFY."; \
108 echo " *"; \
109 echo " * This file was auto-generated from $<"; \
110 echo " *"; \
111 echo " */"; \
112 echo ""; \
113 echo "#ifndef __ASM_OFFSETS_H__"; \
114 echo "#define __ASM_OFFSETS_H__"; \
115 echo ""; \
116 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
117 echo ""; \
118 echo "#endif") <$< >$@
120 # generate header files
121 .PHONY: build-headers
122 build-headers:
123 $(MAKE) -C include/public/foreign
125 SUBDIRS = acm arch/$(TARGET_ARCH) common drivers
126 define all_sources
127 ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
128 find include -name 'asm-*' -prune -o -name '*.h' -print; \
129 find $(SUBDIRS) -name '*.[chS]' -print )
130 endef
132 define set_exuberant_flags
133 exuberant_flags=`$1 --version 2>/dev/null | grep -iq exuberant && \
134 echo "-I __initdata,__exitdata,__acquires,__releases \
135 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
136 --extra=+f --c-kinds=+px"`
137 endef
139 .PHONY: _TAGS
140 _TAGS:
141 rm -f TAGS; \
142 $(call set_exuberant_flags,etags); \
143 $(all_sources) | xargs etags $$exuberant_flags -a
145 .PHONY: _tags
146 _tags:
147 rm -f tags; \
148 $(call set_exuberant_flags,ctags); \
149 $(all_sources) | xargs ctags $$exuberant_flags -a
151 .PHONY: _cscope
152 _cscope:
153 $(all_sources) > cscope.files
154 cscope -k -b -q
156 .PHONY: _MAP
157 _MAP:
158 $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
160 .PHONY: FORCE
161 FORCE:
163 %.o %.i: %.c FORCE
164 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
166 %.o %.s: %.S FORCE
167 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
169 %/: FORCE
170 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o