debuggers.hg

annotate xen/Makefile @ 22850:5e91e7a6b130

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