ia64/xen-unstable

view xen/Makefile @ 18842:9be2fe3de567

shadow: fix the fix for promotion/resync race.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 28 12:02:43 2008 +0000 (2008-11-28)
parents 11606c429084
children 7c831b755c78
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 = 4
5 export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
6 export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
7 -include xen-version
9 export XEN_WHOAMI ?= $(USER)
10 export XEN_DOMAIN ?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))
12 export BASEDIR := $(CURDIR)
14 .PHONY: default
15 default: build
17 .PHONY: dist
18 dist: install
20 .PHONY: build install clean distclean cscope TAGS tags MAP
21 build install debug clean distclean cscope TAGS tags MAP::
22 $(MAKE) -f Rules.mk _$@
24 .PHONY: _build
25 _build: $(TARGET).gz
27 .PHONY: _install
28 _install: $(TARGET).gz
29 [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
30 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
31 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
32 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
33 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
34 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
36 .PHONY: _debug
37 _debug:
38 objdump -D -S $(TARGET)-syms > $(TARGET).s
40 .PHONY: _clean
41 _clean: delete-unfresh-files
42 $(MAKE) -C tools clean
43 $(MAKE) -f $(BASEDIR)/Rules.mk -C include clean
44 $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
45 $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
46 $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
47 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
48 rm -f include/asm *.o $(TARGET)* *~ core
49 rm -f include/asm-*/asm-offsets.h
50 [ -d tools/figlet ] && rm -f .banner*
52 .PHONY: _distclean
53 _distclean: clean
54 rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
56 $(TARGET).gz: $(TARGET)
57 gzip -f -9 < $< > $@.new
58 mv $@.new $@
60 $(TARGET): delete-unfresh-files
61 $(MAKE) -C tools
62 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
63 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
64 $(MAKE) -f $(BASEDIR)/Rules.mk -C include
65 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
66 $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
67 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
69 # drivers/char/console.o contains static banner/compile info. Blow it away.
70 # Don't refresh these files during e.g., 'sudo make install'
71 .PHONY: delete-unfresh-files
72 delete-unfresh-files:
73 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
74 rm -f include/xen/compile.h; \
75 fi
77 .banner: Makefile
78 $(MAKE) -C tools
79 @tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) 2>$@2 >$@1
80 @cat $@1 $@2 >$@
81 @rm -f $@1 $@2
83 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
84 include/xen/compile.h: include/xen/compile.h.in .banner
85 @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
86 -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
87 -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
88 -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
89 -e 's/@@hostname@@/$(shell hostname)/g' \
90 -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)!g' \
91 -e 's/@@version@@/$(XEN_VERSION)/g' \
92 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
93 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
94 -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' \
95 < include/xen/compile.h.in > $@.new
96 @grep \" .banner >> $@.new
97 @grep -v \" .banner
98 @mv -f $@.new $@
100 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
101 @(set -e; \
102 echo "/*"; \
103 echo " * DO NOT MODIFY."; \
104 echo " *"; \
105 echo " * This file was auto-generated from $<"; \
106 echo " *"; \
107 echo " */"; \
108 echo ""; \
109 echo "#ifndef __ASM_OFFSETS_H__"; \
110 echo "#define __ASM_OFFSETS_H__"; \
111 echo ""; \
112 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
113 echo ""; \
114 echo "#endif") <$< >$@
116 SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers
117 define all_sources
118 ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
119 find include -name 'asm-*' -prune -o -name '*.h' -print; \
120 find $(SUBDIRS) -name '*.[chS]' -print )
121 endef
123 define set_exuberant_flags
124 exuberant_flags=`$1 --version 2>/dev/null | grep -iq exuberant && \
125 echo "-I __initdata,__exitdata,__acquires,__releases \
126 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
127 --extra=+f --c-kinds=+px"`
128 endef
130 .PHONY: _TAGS
131 _TAGS:
132 set -e; rm -f TAGS; \
133 $(call set_exuberant_flags,etags); \
134 $(all_sources) | xargs etags $$exuberant_flags -a
136 .PHONY: _tags
137 _tags:
138 set -e; rm -f tags; \
139 $(call set_exuberant_flags,ctags); \
140 $(all_sources) | xargs ctags $$exuberant_flags -a
142 .PHONY: _cscope
143 _cscope:
144 $(all_sources) > cscope.files
145 cscope -k -b -q
147 .PHONY: _MAP
148 _MAP:
149 $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
151 .PHONY: FORCE
152 FORCE:
154 %.o %.i: %.c FORCE
155 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
157 %.o %.s: %.S FORCE
158 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
160 %/: FORCE
161 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o