debuggers.hg

view xen/Makefile @ 3539:502b0127031e

bitkeeper revision 1.1159.223.28 (41f2cea9tkhheORopsoScolnVoBxgw)

Description: split banner.h
Split banner.h, to make it easier to edit, and more properly fit in with
normal build systems.
Also, inline the rules to actually build figlet.

From: Adam Heath <doogie@brainfood.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@labyrinth.cl.cam.ac.uk
date Sat Jan 22 22:07:37 2005 +0000 (2005-01-22)
parents 78b5439ce414
children 288b96264654
line source
1 INSTALL = install
2 INSTALL_DATA = $(INSTALL) -m0644
3 INSTALL_DIR = $(INSTALL) -d -m0755
5 # This is the correct place to edit the build version.
6 # All other places this is stored (eg. compile.h) should be autogenerated.
7 export XEN_VERSION = 2
8 export XEN_SUBVERSION = 0
9 export XEN_EXTRAVERSION = ""
11 export BASEDIR := $(CURDIR)
12 DESTDIR := $(CURDIR)/../dist/install
14 include Rules.mk
16 default: $(TARGET).gz
17 $(TARGET).gz: $(TARGET)
18 gzip -f -9 < $< > $@.new
19 mv $@.new $@
21 debug:
22 objdump -D -S $(TARGET)-syms > $(TARGET).s
24 install: $(TARGET).gz
25 $(INSTALL_DIR) $(DESTDIR)/boot
26 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot
27 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot
28 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
29 $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
30 $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
31 $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
33 dist: install
35 clean: tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean
36 rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h
37 rm -f include/asm-*/asm-offsets.h
38 rm -f tools/figlet/*.o tools/figlet/figlet
40 tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean : %.clean:
41 $(MAKE) -C $* clean
43 $(TARGET): delete-unfresh-files include/xen/compile.h
44 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
45 $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
46 $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
47 $(MAKE) -C common
48 $(MAKE) -C drivers
49 $(MAKE) -C arch/$(TARGET_ARCH)
51 # Blow away kernel.o because build info is stored statically within it.
52 delete-unfresh-files:
53 rm -f include/xen/compile.h common/kernel.o
55 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
56 include/xen/compile.h: LANG=C
57 include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
58 sed -e 's/@@date@@/$(shell date)/g' \
59 -e 's/@@time@@/$(shell date +%T)/g' \
60 -e 's/@@whoami@@/$(shell whoami)/g' \
61 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
62 -e 's/@@hostname@@/$(shell hostname)/g' \
63 -e 's/@@compiler@@/$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)/g' \
64 -e 's/@@version@@/$(XEN_VERSION)/g' \
65 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
66 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
67 -e 's/@@changeset@@/$(shell bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo information unavailable)/g' \
68 < include/xen/compile.h.in > $@.new
69 cat include/xen/banner.h >> $@.new
70 mv $@.new $@
72 tools/figlet/figlet: tools/figlet/figlet.o
73 $(CC) -o $@ $<
74 tools/figlet/figlet.o: tools/figlet/figlet.c
75 $(CC) -o $@ -c $<
77 include/xen/banner.h: tools/figlet/figlet tools/figlet/xen.flf
78 tools/figlet/figlet -d tools/figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) > $@.new
79 mv $@.new $@
81 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
82 @(set -e; \
83 echo "/*"; \
84 echo " * DO NOT MODIFY."; \
85 echo " *"; \
86 echo " * This file was auto-generated from $<"; \
87 echo " *"; \
88 echo " */"; \
89 echo ""; \
90 echo "#ifndef __ASM_OFFSETS_H__"; \
91 echo "#define __ASM_OFFSETS_H__"; \
92 echo ""; \
93 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
94 echo ""; \
95 echo "#endif") <$< >$@
97 .PHONY: default debug install dist clean delete-unfresh-files TAGS
99 SUBDIRS = arch common drivers
100 TAGS:
101 ( find include/asm-$(TARGET_ARCH) -name '*.h'; \
102 find include -type d \( -name "asm-*" -o -name config \) -prune -o \
103 -name '*.h' -print; \
104 find $(SUBDIRS) -name '*.[ch]' ) | grep -v /SCCS/ | etags -
105 MAP:
106 nm $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map