ia64/xen-unstable

view xen/Makefile @ 4958:cc1c80ec8139

bitkeeper revision 1.1432 (428a0372Dg_Q9mIOPOkDIc7D3T4aww)

Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
author cl349@firebug.cl.cam.ac.uk
date Tue May 17 14:45:06 2005 +0000 (2005-05-17)
parents 0651c17c1f17
children 777fa188124b
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_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz
35 ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
36 ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
37 ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
38 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)-syms
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 arch/$(TARGET_ARCH) clean
50 rm -f include/asm *.o $(TARGET)* *~ core
51 rm -f include/asm-*/asm-offsets.h
52 rm -f tools/figlet/*.o tools/figlet/figlet
54 $(TARGET): delete-unfresh-files
55 $(MAKE) include/xen/compile.h
56 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
57 $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
58 $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
59 $(MAKE) -C common
60 $(MAKE) -C drivers
61 $(MAKE) -C arch/$(TARGET_ARCH)
63 # drivers/char/console.o may contain static banner/compile info. Blow it away.
64 delete-unfresh-files:
65 rm -f include/xen/banner.h include/xen/compile.h drivers/char/console.o
66 $(MAKE) -C arch/$(TARGET_ARCH) delete-unfresh-files
68 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
69 include/xen/compile.h: LANG=C
70 include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
71 @sed -e 's/@@date@@/$(shell date)/g' \
72 -e 's/@@time@@/$(shell date +%T)/g' \
73 -e 's/@@whoami@@/$(shell whoami)/g' \
74 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
75 -e 's/@@hostname@@/$(shell hostname)/g' \
76 -e 's/@@compiler@@/$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)/g' \
77 -e 's/@@version@@/$(XEN_VERSION)/g' \
78 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
79 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
80 -e 's!@@changeset@@!$(shell bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo information unavailable)!g' \
81 < include/xen/compile.h.in > $@.new
82 @cat include/xen/banner.h >> $@.new
83 @mv -f $@.new $@
85 tools/figlet/figlet: tools/figlet/figlet.o
86 $(HOSTCC) -o $@ $<
87 tools/figlet/figlet.o: tools/figlet/figlet.c
88 $(HOSTCC) -o $@ -c $<
90 include/xen/banner.h: tools/figlet/figlet tools/figlet/xen.flf
91 tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) > $@.new
92 @mv -f $@.new $@
94 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
95 @(set -e; \
96 echo "/*"; \
97 echo " * DO NOT MODIFY."; \
98 echo " *"; \
99 echo " * This file was auto-generated from $<"; \
100 echo " *"; \
101 echo " */"; \
102 echo ""; \
103 echo "#ifndef __ASM_OFFSETS_H__"; \
104 echo "#define __ASM_OFFSETS_H__"; \
105 echo ""; \
106 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
107 echo ""; \
108 echo "#endif") <$< >$@
110 .PHONY: default debug install dist clean delete-unfresh-files TAGS tags
112 SUBDIRS = arch/$(TARGET_ARCH) common drivers
113 define all_sources
114 ( find include/asm-$(TARGET_ARCH) -name SCCS -prune -o -name '*.h' -print; \
115 find include -type d -name SCCS -prune -o \( -name "asm-*" -o \
116 -name config \) -prune -o -name '*.h' -print; \
117 find $(SUBDIRS) -name SCCS -prune -o -name '*.[chS]' -print )
118 endef
119 TAGS:
120 $(all_sources) | etags -
121 tags:
122 $(all_sources) | xargs ctags
123 cscope:
124 $(all_sources) > cscope.files
125 cscope -k -b -q
126 MAP:
127 nm $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map