ia64/xen-unstable

view xen/Makefile @ 4166:aeccd691af4c

bitkeeper revision 1.1236.34.7 (423735acABhfn7rysHwGJkcVOLD6GA)

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