ia64/xen-unstable

view xen/Makefile @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 8baf03526ab1
children
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 = 5
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 crypto clean
48 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
49 rm -f include/asm *.o $(TARGET)* *~ core
50 rm -f include/asm-*/asm-offsets.h
51 [ -d tools/figlet ] && rm -f .banner*
53 .PHONY: _distclean
54 _distclean: clean
55 rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
57 $(TARGET).gz: $(TARGET)
58 gzip -f -9 < $< > $@.new
59 mv $@.new $@
61 $(TARGET): delete-unfresh-files
62 $(MAKE) -C tools
63 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
64 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
65 $(MAKE) -f $(BASEDIR)/Rules.mk -C include
66 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
67 $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
68 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
70 # drivers/char/console.o contains static banner/compile info. Blow it away.
71 # Don't refresh these files during e.g., 'sudo make install'
72 .PHONY: delete-unfresh-files
73 delete-unfresh-files:
74 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
75 rm -f include/xen/compile.h; \
76 fi
78 .banner: Makefile
79 $(MAKE) -C tools
80 @tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) 2>$@2 >$@1
81 @cat $@1 $@2 >$@
82 @rm -f $@1 $@2
84 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
85 include/xen/compile.h: include/xen/compile.h.in .banner
86 @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
87 -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
88 -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
89 -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
90 -e 's/@@hostname@@/$(shell hostname)/g' \
91 -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)!g' \
92 -e 's/@@version@@/$(XEN_VERSION)/g' \
93 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
94 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
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' \
96 < include/xen/compile.h.in > $@.new
97 @grep \" .banner >> $@.new
98 @grep -v \" .banner
99 @mv -f $@.new $@
101 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
102 @(set -e; \
103 echo "/*"; \
104 echo " * DO NOT MODIFY."; \
105 echo " *"; \
106 echo " * This file was auto-generated from $<"; \
107 echo " *"; \
108 echo " */"; \
109 echo ""; \
110 echo "#ifndef __ASM_OFFSETS_H__"; \
111 echo "#define __ASM_OFFSETS_H__"; \
112 echo ""; \
113 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
114 echo ""; \
115 echo "#endif") <$< >$@
117 SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers
118 define all_sources
119 ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
120 find include -name 'asm-*' -prune -o -name '*.h' -print; \
121 find $(SUBDIRS) -name '*.[chS]' -print )
122 endef
124 define set_exuberant_flags
125 exuberant_flags=`$1 --version 2>/dev/null | grep -iq exuberant && \
126 echo "-I __initdata,__exitdata,__acquires,__releases \
127 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
128 --extra=+f --c-kinds=+px"`
129 endef
131 .PHONY: _TAGS
132 _TAGS:
133 set -e; rm -f TAGS; \
134 $(call set_exuberant_flags,etags); \
135 $(all_sources) | xargs etags $$exuberant_flags -a
137 .PHONY: _tags
138 _tags:
139 set -e; rm -f tags; \
140 $(call set_exuberant_flags,ctags); \
141 $(all_sources) | xargs ctags $$exuberant_flags -a
143 .PHONY: _cscope
144 _cscope:
145 $(all_sources) > cscope.files
146 cscope -k -b -q
148 .PHONY: _MAP
149 _MAP:
150 $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
152 .PHONY: FORCE
153 FORCE:
155 %.o %.i: %.c FORCE
156 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
158 %.o %.s: %.S FORCE
159 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
161 %/: FORCE
162 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o