ia64/xen-unstable

view xen/Makefile @ 4072:ee7313088070

bitkeeper revision 1.1159.258.38 (4230628bX3yukmWYtNDh925BckMoHQ)

Merge ssh://xenbk@gandalf.hpl.hp.com//var/bk/xen-2.0-testing.bk
into tetris.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
author iap10@tetris.cl.cam.ac.uk
date Thu Mar 10 15:06:51 2005 +0000 (2005-03-10)
parents 4755ec1437fb
children f715bcbba0b3 3ee85723a341 a0be5e5a1f37
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 = 2
12 export XEN_SUBVERSION = 0
13 export XEN_EXTRAVERSION = ""
15 export BASEDIR := $(CURDIR)
17 include Rules.mk
19 default: $(TARGET).gz
20 $(TARGET).gz: $(TARGET)
21 gzip -f -9 < $< > $@.new
22 mv $@.new $@
24 debug:
25 objdump -D -S $(TARGET)-syms > $(TARGET).s
27 dist:
28 $(MAKE) install
30 install: $(TARGET).gz
31 [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
32 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot
33 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot
34 [ -d $(DESTDIR)/usr/include/xen/io ] || \
35 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
36 $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
37 $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
38 $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
40 clean: delete-unfresh-files
41 $(MAKE) -C tools clean
42 $(MAKE) -C common clean
43 $(MAKE) -C drivers clean
44 $(MAKE) -C arch/$(TARGET_ARCH) clean
45 rm -f include/asm *.o $(TARGET)* *~ core
46 rm -f include/asm-*/asm-offsets.h
47 rm -f tools/figlet/*.o tools/figlet/figlet
49 $(TARGET): delete-unfresh-files
50 $(MAKE) include/xen/compile.h
51 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
52 $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
53 $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
54 $(MAKE) -C common
55 $(MAKE) -C drivers
56 $(MAKE) -C arch/$(TARGET_ARCH)
58 # drivers/char/console.o may contain static banner/compile info. Blow it away.
59 delete-unfresh-files:
60 rm -f include/xen/banner.h include/xen/compile.h drivers/char/console.o
61 $(MAKE) -C arch/$(TARGET_ARCH) delete-unfresh-files
63 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
64 include/xen/compile.h: LANG=C
65 include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
66 @sed -e 's/@@date@@/$(shell date)/g' \
67 -e 's/@@time@@/$(shell date +%T)/g' \
68 -e 's/@@whoami@@/$(shell whoami)/g' \
69 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
70 -e 's/@@hostname@@/$(shell hostname)/g' \
71 -e 's/@@compiler@@/$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)/g' \
72 -e 's/@@version@@/$(XEN_VERSION)/g' \
73 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
74 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
75 -e 's!@@changeset@@!$(shell bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo information unavailable)!g' \
76 < include/xen/compile.h.in > $@.new
77 @cat include/xen/banner.h >> $@.new
78 @mv -f $@.new $@
80 tools/figlet/figlet: tools/figlet/figlet.o
81 $(CC) -o $@ $<
82 tools/figlet/figlet.o: tools/figlet/figlet.c
83 $(CC) -o $@ -c $<
85 include/xen/banner.h: tools/figlet/figlet tools/figlet/xen.flf
86 tools/figlet/figlet -d tools/figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) > $@.new
87 @mv -f $@.new $@
89 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
90 @(set -e; \
91 echo "/*"; \
92 echo " * DO NOT MODIFY."; \
93 echo " *"; \
94 echo " * This file was auto-generated from $<"; \
95 echo " *"; \
96 echo " */"; \
97 echo ""; \
98 echo "#ifndef __ASM_OFFSETS_H__"; \
99 echo "#define __ASM_OFFSETS_H__"; \
100 echo ""; \
101 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
102 echo ""; \
103 echo "#endif") <$< >$@
105 .PHONY: default debug install dist clean delete-unfresh-files TAGS
107 SUBDIRS = arch common drivers
108 TAGS:
109 ( find include/asm-$(TARGET_ARCH) -name '*.h'; \
110 find include -type d \( -name "asm-*" -o -name config \) -prune -o \
111 -name '*.h' -print; \
112 find $(SUBDIRS) -name '*.[ch]' ) | grep -v /SCCS/ | etags -
113 MAP:
114 nm $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map