ia64/xen-unstable

view xen/Makefile @ 6743:b3b4391a14e5

use XEN_FULLVERSION variable where possible

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vh249@arcadians.cl.cam.ac.uk
date Sat Sep 10 14:42:39 2005 +0000 (2005-09-10)
parents dd668f7527cb
children 5721657e8130
line source
1 # Default is to install to local 'dist' directory.
2 DISTDIR ?= ../dist
3 DESTDIR ?= $(DISTDIR)/install
5 INSTALL = install
6 INSTALL_DATA = $(INSTALL) -m0644
7 INSTALL_DIR = $(INSTALL) -d -m0755
9 # This is the correct place to edit the build version.
10 # All other places this is stored (eg. compile.h) should be autogenerated.
11 export XEN_VERSION = 3
12 export XEN_SUBVERSION = 0
13 export XEN_EXTRAVERSION = -devel
14 export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
16 export BASEDIR := $(CURDIR)
18 include Rules.mk
20 default: build
21 $(TARGET).gz: $(TARGET)
22 gzip -f -9 < $< > $@.new
23 mv $@.new $@
25 debug:
26 objdump -D -S $(TARGET)-syms > $(TARGET).s
28 dist: install
30 build: $(TARGET).gz
32 install: $(TARGET).gz
33 [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
34 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
35 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
36 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
37 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
38 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
39 [ -d $(DESTDIR)/usr/include/xen/io ] || \
40 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
41 $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
42 $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
43 $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
45 clean: delete-unfresh-files
46 $(MAKE) -C tools clean
47 $(MAKE) -C common clean
48 $(MAKE) -C drivers clean
49 $(MAKE) -C acm clean
50 $(MAKE) -C arch/$(TARGET_ARCH) clean
51 rm -f include/asm *.o $(TARGET)* *~ core
52 rm -f include/asm-*/asm-offsets.h
53 rm -f include/xen/acm_policy.h
55 $(TARGET): delete-unfresh-files
56 $(MAKE) -C tools
57 $(MAKE) include/xen/compile.h
58 $(MAKE) include/xen/acm_policy.h
59 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
60 $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
61 $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
62 $(MAKE) -C common
63 $(MAKE) -C drivers
64 ifneq ($(ACM_USE_SECURITY_POLICY),ACM_NULL_POLICY)
65 $(MAKE) -C acm
66 endif
67 $(MAKE) -C arch/$(TARGET_ARCH)
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 delete-unfresh-files:
72 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
73 rm -f include/xen/{banner,compile}.h; \
74 fi
76 # acm_policy.h contains security policy for Xen
77 include/xen/acm_policy.h:
78 @(set -e; \
79 echo "/*"; \
80 echo " * DO NOT MODIFY."; \
81 echo " *"; \
82 echo " * This file was auto-generated by xen/Makefile $<"; \
83 echo " *"; \
84 echo " */"; \
85 echo ""; \
86 echo "#ifndef ACM_USE_SECURITY_POLICY"; \
87 echo "#define ACM_USE_SECURITY_POLICY $(ACM_USE_SECURITY_POLICY)"; \
88 echo "#endif") >$@
90 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
91 include/xen/compile.h: LANG=C
92 include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
93 @sed -e 's/@@date@@/$(shell date)/g' \
94 -e 's/@@time@@/$(shell date +%T)/g' \
95 -e 's/@@whoami@@/$(shell whoami)/g' \
96 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
97 -e 's/@@hostname@@/$(shell hostname)/g' \
98 -e 's/@@compiler@@/$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -n 1)/g' \
99 -e 's/@@version@@/$(XEN_VERSION)/g' \
100 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
101 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
102 -e 's!@@changeset@@!$(shell (hg parents | awk -F: '/^changeset/{CS=$$3};{FS="date:[ ]+"}/^date/{D=$$2}; END {print D, CS}') 2>/dev/null || (head -n 6 ChangeLog | awk -F: '/^changeset/{CS=$$3};{FS="date:[ ]+"}/^date/{D=$$2}; END {print D, CS}') 2>/dev/null || echo information unavailable)!g' \
103 < include/xen/compile.h.in > $@.new
104 @cat include/xen/banner.h >> $@.new
105 @mv -f $@.new $@
107 include/xen/banner.h:
108 tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) > $@.new
109 @mv -f $@.new $@
111 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
112 @(set -e; \
113 echo "/*"; \
114 echo " * DO NOT MODIFY."; \
115 echo " *"; \
116 echo " * This file was auto-generated from $<"; \
117 echo " *"; \
118 echo " */"; \
119 echo ""; \
120 echo "#ifndef __ASM_OFFSETS_H__"; \
121 echo "#define __ASM_OFFSETS_H__"; \
122 echo ""; \
123 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
124 echo ""; \
125 echo "#endif") <$< >$@
127 .PHONY: default debug install dist clean delete-unfresh-files TAGS tags
129 SUBDIRS = acm arch/$(TARGET_ARCH) common drivers
130 define all_sources
131 ( find include/asm-$(TARGET_ARCH) -name SCCS -prune -o -name '*.h' -print; \
132 find include -type d -name SCCS -prune -o \( -name "asm-*" -o \
133 -name config \) -prune -o -name '*.h' -print; \
134 find $(SUBDIRS) -name SCCS -prune -o -name '*.[chS]' -print )
135 endef
136 TAGS:
137 $(all_sources) | etags -
138 tags:
139 $(all_sources) | xargs ctags
140 cscope:
141 $(all_sources) > cscope.files
142 cscope -k -b -q
143 MAP:
144 $(NM) $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map