ia64/xen-unstable

view xen/Makefile @ 13240:9c028b3cdb55

Install hvm and arch-x86 subdirectories of xen/include/public
to /usr/include/xen.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Tue Jan 02 14:14:15 2007 +0000 (2007-01-02)
parents bd207697f0c7
children e98b092c2057
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 = 3
4 export XEN_SUBVERSION = 0
5 export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
6 export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
7 -include xen-version
9 export BASEDIR := $(CURDIR)
11 .PHONY: default
12 default: build
14 .PHONY: dist
15 dist: install
17 .PHONY: build install clean distclean cscope TAGS tags
18 build install debug clean distclean cscope TAGS tags::
19 $(MAKE) -f Rules.mk _$@
21 .PHONY: _build
22 _build: $(TARGET).gz
24 .PHONY: _install
25 _install: $(TARGET).gz
26 [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
27 $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
28 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
29 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
30 ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
31 $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
32 [ -d $(DESTDIR)/usr/include/xen/arch-x86 ] || \
33 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/arch-x86
34 [ -d $(DESTDIR)/usr/include/xen/hvm ] || \
35 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/hvm
36 [ -d $(DESTDIR)/usr/include/xen/io ] || \
37 $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
38 $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
39 $(INSTALL_DATA) include/public/arch-x86/*.h $(DESTDIR)/usr/include/xen/arch-x86
40 $(INSTALL_DATA) include/public/hvm/*.h $(DESTDIR)/usr/include/xen/hvm
41 $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
42 $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
44 .PHONY: _debug
45 _debug:
46 objdump -D -S $(TARGET)-syms > $(TARGET).s
48 .PHONY: _clean
49 _clean: delete-unfresh-files
50 $(MAKE) -C tools clean
51 $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
52 $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
53 $(MAKE) -f $(BASEDIR)/Rules.mk -C acm clean
54 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
55 rm -f include/asm *.o $(TARGET)* *~ core
56 rm -f include/asm-*/asm-offsets.h
57 rm -f include/xen/acm_policy.h
59 .PHONY: _distclean
60 _distclean: clean
61 rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
63 $(TARGET).gz: $(TARGET)
64 gzip -f -9 < $< > $@.new
65 mv $@.new $@
67 $(TARGET): delete-unfresh-files
68 $(MAKE) -C tools
69 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
70 $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/acm_policy.h
71 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
72 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s
73 $(MAKE) -f $(BASEDIR)/Rules.mk include/asm-$(TARGET_ARCH)/asm-offsets.h
74 $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) $(TARGET)
76 # drivers/char/console.o contains static banner/compile info. Blow it away.
77 # Don't refresh these files during e.g., 'sudo make install'
78 .PHONY: delete-unfresh-files
79 delete-unfresh-files:
80 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
81 rm -f include/xen/compile.h; \
82 fi
84 # acm_policy.h contains security policy for Xen
85 include/xen/acm_policy.h:
86 @(set -e; \
87 echo "/*"; \
88 echo " * DO NOT MODIFY."; \
89 echo " *"; \
90 echo " * This file was auto-generated by xen/Makefile $<"; \
91 echo " *"; \
92 echo " */"; \
93 echo ""; \
94 echo "#ifndef ACM_DEFAULT_SECURITY_POLICY"; \
95 echo "#define ACM_DEFAULT_SECURITY_POLICY $(ACM_DEFAULT_SECURITY_POLICY)"; \
96 echo "#endif") >$@
98 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
99 include/xen/compile.h: include/xen/compile.h.in
100 @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
101 -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
102 -e 's/@@whoami@@/$(USER)/g' \
103 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
104 -e 's/@@hostname@@/$(shell hostname)/g' \
105 -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i "gcc.*version")!g' \
106 -e 's/@@version@@/$(XEN_VERSION)/g' \
107 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
108 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
109 -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' \
110 < include/xen/compile.h.in > $@.new
111 tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
112 @mv -f $@.new $@
114 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
115 @(set -e; \
116 echo "/*"; \
117 echo " * DO NOT MODIFY."; \
118 echo " *"; \
119 echo " * This file was auto-generated from $<"; \
120 echo " *"; \
121 echo " */"; \
122 echo ""; \
123 echo "#ifndef __ASM_OFFSETS_H__"; \
124 echo "#define __ASM_OFFSETS_H__"; \
125 echo ""; \
126 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
127 echo ""; \
128 echo "#endif") <$< >$@
130 SUBDIRS = acm arch/$(TARGET_ARCH) common drivers
131 define all_sources
132 ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
133 find include -name 'asm-*' -prune -o -name '*.h' -print; \
134 find $(SUBDIRS) -name '*.[chS]' -print )
135 endef
137 define set_exuberant_flags
138 exuberant_flags=`$1 --version 2>/dev/null | grep -iq exuberant && \
139 echo "-I __initdata,__exitdata,__acquires,__releases \
140 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
141 --extra=+f --c-kinds=+px"`
142 endef
144 .PHONY: _TAGS
145 _TAGS:
146 rm -f TAGS; \
147 $(call set_exuberant_flags,etags); \
148 $(all_sources) | xargs etags $$exuberant_flags -a
150 .PHONY: _tags
151 _tags:
152 rm -f tags; \
153 $(call set_exuberant_flags,ctags); \
154 $(all_sources) | xargs ctags $$exuberant_flags -a
156 .PHONY: _cscope
157 _cscope:
158 $(all_sources) > cscope.files
159 cscope -k -b -q
161 .PHONY: MAP
162 MAP:
163 $(NM) -n $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
165 .PHONY: FORCE
166 FORCE:
168 %.o %.i: %.c FORCE
169 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
171 %.o %.s: %.S FORCE
172 $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F)
174 %/: FORCE
175 $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o