debuggers.hg

view xen/Makefile @ 22906:700ac6445812

Now add KDB to the non-kdb tree
author Mukesh Rathor
date Thu Feb 03 15:42:41 2011 -0800 (2011-02-03)
parents 5e91e7a6b130
children
line source
1 # This is the correct place to edit the build version.
2 # All other places this is stored (eg. compile.h) should be autogenerated.
3 export XEN_VERSION = 4
4 export XEN_SUBVERSION = 1
5 export XEN_EXTRAVERSION ?= .0-rc3-pre$(XEN_VENDORVERSION)
6 export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
7 -include xen-version
9 export XEN_WHOAMI ?= $(USER)
10 export XEN_DOMAIN ?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))
12 export BASEDIR := $(CURDIR)
14 .PHONY: default
15 default: build
17 .PHONY: dist
18 dist: install
20 .PHONY: build install clean distclean cscope TAGS tags MAP
21 build install debug clean distclean cscope TAGS tags MAP::
22 $(MAKE) -f Rules.mk _$@
24 .PHONY: _build
25 _build: $(TARGET).gz
27 .PHONY: _install
28 _install: $(TARGET).gz
29 [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
30 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
31 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
32 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
33 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
34 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
36 .PHONY: _debug
37 _debug:
38 objdump -D -S $(TARGET)-syms > $(TARGET).s
40 .PHONY: _clean
41 _clean: delete-unfresh-files
42 $(MAKE) -C tools clean
43 $(MAKE) -f $(BASEDIR)/Rules.mk -C include clean
44 $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
45 $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
46 $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
47 $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
48 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
49 $(MAKE) -f $(BASEDIR)/Rules.mk -C kdb clean
50 rm -f include/asm *.o $(TARGET)* *~ core
51 rm -f include/asm-*/asm-offsets.h
52 [ -d tools/figlet ] && rm -f .banner*
54 .PHONY: _distclean
55 _distclean: clean
56 rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
58 $(TARGET).gz: $(TARGET)
59 gzip -f -9 < $< > $@.new
60 mv $@.new $@
62 $(TARGET): delete-unfresh-files
63 $(MAKE) -C tools
64 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
65 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
66 $(MAKE) -f $(BASEDIR)/Rules.mk -C include
67 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
68 $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
69 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
71 # drivers/char/console.o contains static banner/compile info. Blow it away.
72 # Don't refresh these files during e.g., 'sudo make install'
73 .PHONY: delete-unfresh-files
74 delete-unfresh-files:
75 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
76 rm -f include/xen/compile.h; \
77 fi
79 .banner: Makefile
80 $(MAKE) -C tools
81 @tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) 2>$@2 >$@1
82 @cat $@1 $@2 >$@
83 @rm -f $@1 $@2
85 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
86 include/xen/compile.h: include/xen/compile.h.in .banner
87 @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
88 -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
89 -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
90 -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
91 -e 's/@@hostname@@/$(shell hostname)/g' \
92 -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)!g' \
93 -e 's/@@version@@/$(XEN_VERSION)/g' \
94 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
95 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
96 -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date} {rev}:{node|short}" >/dev/null && hg parents --template "{date|date} {rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
97 < include/xen/compile.h.in > $@.new
98 @grep \" .banner >> $@.new
99 @grep -v \" .banner
100 @mv -f $@.new $@
102 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
103 @(set -e; \
104 echo "/*"; \
105 echo " * DO NOT MODIFY."; \
106 echo " *"; \
107 echo " * This file was auto-generated from $<"; \
108 echo " *"; \
109 echo " */"; \
110 echo ""; \
111 echo "#ifndef __ASM_OFFSETS_H__"; \
112 echo "#define __ASM_OFFSETS_H__"; \
113 echo ""; \
114 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
115 echo ""; \
116 echo "#endif") <$< >$@
118 SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers kdb
119 define all_sources
120 ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
121 find include -name 'asm-*' -prune -o -name '*.h' -print; \
122 find $(SUBDIRS) -name '*.[chS]' -print )
123 endef
125 define set_exuberant_flags
126 exuberant_flags=`$1 --version 2>/dev/null | (grep -iq exuberant && \
127 echo "-I __initdata,__exitdata,__acquires,__releases \
128 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
129 --extra=+f --c-kinds=+px") || true`
130 endef
132 .PHONY: _TAGS
133 _TAGS:
134 set -e; rm -f TAGS; \
135 $(call set_exuberant_flags,etags); \
136 $(all_sources) | xargs etags $$exuberant_flags -a
138 .PHONY: _tags
139 _tags:
140 set -e; rm -f tags; \
141 $(call set_exuberant_flags,ctags); \
142 $(all_sources) | xargs ctags $$exuberant_flags -a
144 .PHONY: _cscope
145 _cscope:
146 $(all_sources) > cscope.files
147 cscope -k -b -q
149 .PHONY: _MAP
150 _MAP:
151 $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
153 .PHONY: FORCE
154 FORCE:
156 %.o %.i: %.c FORCE
157 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
159 %.o %.s: %.S FORCE
160 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
162 %/: FORCE
163 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o