debuggers.hg

annotate xen/Makefile @ 16715:c5deb251b9dc

Update version to 3.2.0-rc4
author Keir Fraser <keir.fraser@citrix.com>
date Sat Dec 29 17:57:37 2007 +0000 (2007-12-29)
parents 3a2ff31ac913
children 36bb2ab47227
rev   line source
kaf24@459 1 # This is the correct place to edit the build version.
kaf24@459 2 # All other places this is stored (eg. compile.h) should be autogenerated.
cl349@9996 3 export XEN_VERSION = 3
kfraser@15778 4 export XEN_SUBVERSION = 2
keir@16715 5 export XEN_EXTRAVERSION ?= .0-rc4$(XEN_VENDORVERSION)
cl349@9996 6 export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
cl349@9996 7 -include xen-version
kaf24@459 8
kaf24@9580 9 export BASEDIR := $(CURDIR)
iap10@274 10
kaf24@9645 11 .PHONY: default
doogie@4147 12 default: build
kaf24@9580 13
kaf24@9668 14 .PHONY: dist
kaf24@9668 15 dist: install
iap10@408 16
ian@13331 17 .PHONY: build install clean distclean cscope TAGS tags MAP
ian@13331 18 build install debug clean distclean cscope TAGS tags MAP::
kfraser@10687 19 $(MAKE) -f Rules.mk _$@
mafetter@3655 20
kaf24@9668 21 .PHONY: _build
kaf24@9668 22 _build: $(TARGET).gz
iap10@4581 23
kaf24@9668 24 .PHONY: _install
ian@13752 25 _install: $(TARGET).gz build-headers
cl349@3599 26 [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
vh249@6761 27 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
vh249@6761 28 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
vh249@6761 29 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
vh249@6761 30 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
vh249@6761 31 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
ian@13242 32 [ -d $(DESTDIR)/usr/include/xen/arch-x86 ] || \
ian@13242 33 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/arch-x86
ian@13242 34 [ -d $(DESTDIR)/usr/include/xen/hvm ] || \
ian@13242 35 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/hvm
cl349@3599 36 [ -d $(DESTDIR)/usr/include/xen/io ] || \
cl349@3599 37 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
kfraser@15878 38 [ -d $(DESTDIR)/usr/include/xen/xsm ] || \
kfraser@15878 39 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/xsm
ack@13660 40 [ -d $(DESTDIR)/usr/include/xen/foreign ] || \
ack@13660 41 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/foreign
iap10@3537 42 $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
ian@13242 43 $(INSTALL_DATA) include/public/arch-x86/*.h $(DESTDIR)/usr/include/xen/arch-x86
ian@13242 44 $(INSTALL_DATA) include/public/hvm/*.h $(DESTDIR)/usr/include/xen/hvm
iap10@3537 45 $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
kfraser@15878 46 $(INSTALL_DATA) include/public/xsm/*.h $(DESTDIR)/usr/include/xen/xsm
ack@13660 47 $(INSTALL_DATA) include/public/foreign/*.h $(DESTDIR)/usr/include/xen/foreign
iap10@3537 48 $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
iap10@274 49
kaf24@9774 50 .PHONY: _debug
kaf24@9774 51 _debug:
kaf24@9774 52 objdump -D -S $(TARGET)-syms > $(TARGET).s
kaf24@9774 53
kaf24@9668 54 .PHONY: _clean
kaf24@9668 55 _clean: delete-unfresh-files
iap10@3552 56 $(MAKE) -C tools clean
ack@13660 57 $(MAKE) -C include/public/foreign clean
ack@13292 58 $(MAKE) -f $(BASEDIR)/Rules.mk -C include clean
kaf24@9580 59 $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
kaf24@9580 60 $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
kfraser@15846 61 $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
kaf24@9580 62 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
kaf24@3941 63 rm -f include/asm *.o $(TARGET)* *~ core
kaf24@3079 64 rm -f include/asm-*/asm-offsets.h
iap10@274 65
kaf24@10538 66 .PHONY: _distclean
kaf24@10538 67 _distclean: clean
kaf24@10538 68 rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
kaf24@10538 69
kaf24@9580 70 $(TARGET).gz: $(TARGET)
kaf24@9580 71 gzip -f -9 < $< > $@.new
kaf24@9580 72 mv $@.new $@
kaf24@9580 73
ian@13752 74 $(TARGET): delete-unfresh-files build-headers
kaf24@5862 75 $(MAKE) -C tools
kaf24@9580 76 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
kaf24@2878 77 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
ack@13292 78 $(MAKE) -f $(BASEDIR)/Rules.mk -C include
kaf24@9580 79 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
kaf24@9580 80 $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
kaf24@9580 81 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
iap10@274 82
kaf24@5619 83 # drivers/char/console.o contains static banner/compile info. Blow it away.
kaf24@5672 84 # Don't refresh these files during e.g., 'sudo make install'
kaf24@9645 85 .PHONY: delete-unfresh-files
kaf24@455 86 delete-unfresh-files:
kaf24@5672 87 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
kfraser@10919 88 rm -f include/xen/compile.h; \
kaf24@5672 89 fi
kaf24@455 90
kaf24@459 91 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
kfraser@10919 92 include/xen/compile.h: include/xen/compile.h.in
kaf24@11504 93 @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
kaf24@11504 94 -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
kfraser@11828 95 -e 's/@@whoami@@/$(USER)/g' \
iap10@3539 96 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
iap10@3539 97 -e 's/@@hostname@@/$(shell hostname)/g' \
kfraser@11830 98 -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i "gcc.*version")!g' \
iap10@3539 99 -e 's/@@version@@/$(XEN_VERSION)/g' \
iap10@3539 100 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
iap10@3539 101 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
kfraser@11828 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' \
iap10@3539 103 < include/xen/compile.h.in > $@.new
kfraser@10919 104 tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
kaf24@3562 105 @mv -f $@.new $@
kaf24@455 106
kaf24@3079 107 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
kaf24@3079 108 @(set -e; \
kaf24@3079 109 echo "/*"; \
kaf24@3079 110 echo " * DO NOT MODIFY."; \
kaf24@3079 111 echo " *"; \
kaf24@3079 112 echo " * This file was auto-generated from $<"; \
kaf24@3079 113 echo " *"; \
kaf24@3079 114 echo " */"; \
kaf24@3079 115 echo ""; \
kaf24@3079 116 echo "#ifndef __ASM_OFFSETS_H__"; \
kaf24@3079 117 echo "#define __ASM_OFFSETS_H__"; \
kaf24@3079 118 echo ""; \
kaf24@3079 119 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
kaf24@3079 120 echo ""; \
kaf24@3079 121 echo "#endif") <$< >$@
kaf24@3079 122
ian@13752 123 # generate header files
ian@13752 124 .PHONY: build-headers
ian@13752 125 build-headers:
ian@13752 126 $(MAKE) -C include/public/foreign
ian@13752 127
kfraser@15849 128 SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers
iap10@4581 129 define all_sources
kfraser@11634 130 ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
kfraser@11634 131 find include -name 'asm-*' -prune -o -name '*.h' -print; \
kfraser@11634 132 find $(SUBDIRS) -name '*.[chS]' -print )
kfraser@11634 133 endef
kfraser@11634 134
kfraser@11634 135 define set_exuberant_flags
kfraser@11634 136 exuberant_flags=`$1 --version 2>/dev/null | grep -iq exuberant && \
kfraser@11634 137 echo "-I __initdata,__exitdata,__acquires,__releases \
kfraser@11634 138 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
kfraser@11634 139 --extra=+f --c-kinds=+px"`
iap10@4581 140 endef
kaf24@9645 141
kaf24@9667 142 .PHONY: _TAGS
kaf24@9667 143 _TAGS:
keir@16688 144 set -e; rm -f TAGS; \
kfraser@11634 145 $(call set_exuberant_flags,etags); \
kfraser@11634 146 $(all_sources) | xargs etags $$exuberant_flags -a
kaf24@9645 147
kaf24@9667 148 .PHONY: _tags
kaf24@9667 149 _tags:
keir@16688 150 set -e; rm -f tags; \
kfraser@11634 151 $(call set_exuberant_flags,ctags); \
kfraser@11634 152 $(all_sources) | xargs ctags $$exuberant_flags -a
kaf24@9645 153
kaf24@9667 154 .PHONY: _cscope
kaf24@9667 155 _cscope:
iap10@4581 156 $(all_sources) > cscope.files
iap10@4581 157 cscope -k -b -q
kaf24@9645 158
ian@13331 159 .PHONY: _MAP
ian@13331 160 _MAP:
ian@13331 161 $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
kfraser@10944 162
kfraser@10944 163 .PHONY: FORCE
kfraser@10944 164 FORCE:
kfraser@10944 165
kfraser@10944 166 %.o %.i: %.c FORCE
kfraser@10944 167 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
kfraser@10944 168
kfraser@10944 169 %.o %.s: %.S FORCE
kfraser@10944 170 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
kfraser@10944 171
kfraser@10944 172 %/: FORCE
kfraser@10944 173 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o