debuggers.hg

view xen/Makefile @ 3532:4bbe824cb519

bitkeeper revision 1.1159.223.21 (41f2c905sBZq8YH0a-M9_-ucSA_KAQ)

Description: support parallellism better
Using shell for loops doesn't allow make to run it the most parallel
modes. Use patsubst/addsuffix tricks to make this work.

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 21:43:33 2005 +0000 (2005-01-22)
parents 77ecf0226c2c
children 78b5439ce414
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 := $(shell pwd)
13 include Rules.mk
15 default: $(TARGET).gz
16 $(TARGET).gz: $(TARGET)
17 gzip -f -9 < $< > $@.new
18 mv $@.new $@
20 debug:
21 objdump -D -S $(TARGET)-syms > $(TARGET).s
23 install: $(TARGET).gz
24 $(INSTALL_DIR) $(prefix)/boot
25 $(INSTALL_DATA) $(TARGET).gz $(prefix)/boot
26 $(INSTALL_DATA) $(TARGET)-syms $(prefix)/boot
27 $(INSTALL_DIR) $(prefix)/usr/include/xen/io
28 $(INSTALL_DATA) include/public/*.h $(prefix)/usr/include/xen
29 $(INSTALL_DATA) include/public/io/*.h $(prefix)/usr/include/xen/io
30 $(INSTALL_DATA) include/public/COPYING $(prefix)/usr/include/xen
32 dist: $(TARGET)
33 $(MAKE) prefix=`pwd`/../dist/install dist=yes 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
39 tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean : %.clean:
40 $(MAKE) -C $* clean
42 $(TARGET): delete-unfresh-files
43 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
44 $(MAKE) -C tools
45 $(MAKE) include/xen/compile.h
46 $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
47 $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
48 $(MAKE) -C common
49 $(MAKE) -C drivers
50 $(MAKE) -C arch/$(TARGET_ARCH)
52 # Blow away kernel.o because build info is stored statically within it.
53 delete-unfresh-files:
54 rm -f include/xen/compile.h common/kernel.o
56 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
57 include/xen/compile.h:
58 @LANG=C echo /\* Autogenerated by root Makefile. Do not edit. \*/ > $@
59 @LANG=C echo >> $@
60 @LANG=C echo \#define XEN_COMPILE_DATE \"`date`\" >> $@
61 @LANG=C echo \#define XEN_COMPILE_TIME \"`date +%T`\" >> $@
62 @LANG=C echo \#define XEN_COMPILE_BY \"`whoami`\" >> $@
63 @LANG=C echo \#define XEN_COMPILE_DOMAIN \"`([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])`\" >> $@
64 @LANG=C echo \#define XEN_COMPILE_HOST \"`hostname`\" >> $@
65 @LANG=C echo \#define XEN_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -n 1`\" >> $@
66 @LANG=C echo >> $@
67 @LANG=C echo \#define XEN_VERSION\ \ \ \ \ \ $(XEN_VERSION) >> $@
68 @LANG=C echo \#define XEN_SUBVERSION\ \ \ $(XEN_SUBVERSION) >> $@
69 @LANG=C echo \#define XEN_EXTRAVERSION \"$(XEN_EXTRAVERSION)\" >> $@
70 @LANG=C echo >> $@
71 @LANG=C echo \#define XEN_CHANGESET \"`bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo "information unavailable"`\" >> $@
72 @LANG=C echo >> $@
73 @LANG=C echo \#define XEN_BANNER \\ >> $@
74 ( cd ./tools/figlet && ./figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) 1>>../../$@ )
75 @LANG=C echo >> $@
77 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
78 @(set -e; \
79 echo "/*"; \
80 echo " * DO NOT MODIFY."; \
81 echo " *"; \
82 echo " * This file was auto-generated from $<"; \
83 echo " *"; \
84 echo " */"; \
85 echo ""; \
86 echo "#ifndef __ASM_OFFSETS_H__"; \
87 echo "#define __ASM_OFFSETS_H__"; \
88 echo ""; \
89 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
90 echo ""; \
91 echo "#endif") <$< >$@
93 .PHONY: default debug install dist clean delete-unfresh-files TAGS
95 SUBDIRS = arch common drivers
96 TAGS:
97 ( find include/asm-$(TARGET_ARCH) -name '*.h'; \
98 find include -type d \( -name "asm-*" -o -name config \) -prune -o \
99 -name '*.h' -print; \
100 find $(SUBDIRS) -name '*.[ch]' ) | grep -v /SCCS/ | etags -
101 MAP:
102 nm $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map