ia64/xen-unstable

view xen/Makefile @ 9357:156505f40a8a

Add a.out files to mercurial ignore list.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 21 11:40:41 2006 +0100 (2006-03-21)
parents 0d9855e12426
children ae212c225e2a
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 = 3
8 export XEN_SUBVERSION = 0
9 export XEN_EXTRAVERSION = -unstable
10 export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
12 export BASEDIR := $(CURDIR)
14 include Rules.mk
16 default: build
17 $(TARGET).gz: $(TARGET)
18 gzip -f -9 < $< > $@.new
19 mv $@.new $@
21 debug:
22 objdump -D -S $(TARGET)-syms > $(TARGET).s
24 dist: install
26 build: $(TARGET).gz
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)
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 acm clean
46 $(MAKE) -C arch/$(TARGET_ARCH) clean
47 rm -f include/asm *.o $(TARGET)* *~ core
48 rm -f include/asm-*/asm-offsets.h
49 rm -f include/xen/acm_policy.h
51 $(TARGET): delete-unfresh-files
52 $(MAKE) -C tools
53 $(MAKE) include/xen/compile.h
54 $(MAKE) include/xen/acm_policy.h
55 [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
56 $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s
57 $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h
58 ifneq ($(TARGET_ARCH),x86)
59 $(MAKE) -C common
60 $(MAKE) -C drivers
61 ifeq ($(ACM_SECURITY),y)
62 $(MAKE) -C acm
63 endif
64 $(MAKE) -C arch/$(TARGET_ARCH)
65 endif
66 $(MAKE) -C arch/$(TARGET_ARCH) $(TARGET)
68 # drivers/char/console.o contains static banner/compile info. Blow it away.
69 # Don't refresh these files during e.g., 'sudo make install'
70 delete-unfresh-files:
71 @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
72 rm -f include/xen/{banner,compile}.h; \
73 fi
75 # acm_policy.h contains security policy for Xen
76 include/xen/acm_policy.h:
77 @(set -e; \
78 echo "/*"; \
79 echo " * DO NOT MODIFY."; \
80 echo " *"; \
81 echo " * This file was auto-generated by xen/Makefile $<"; \
82 echo " *"; \
83 echo " */"; \
84 echo ""; \
85 echo "#ifndef ACM_DEFAULT_SECURITY_POLICY"; \
86 echo "#define ACM_DEFAULT_SECURITY_POLICY $(ACM_DEFAULT_SECURITY_POLICY)"; \
87 echo "#endif") >$@
89 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
90 include/xen/compile.h: LANG=C
91 include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
92 @sed -e 's/@@date@@/$(shell date)/g' \
93 -e 's/@@time@@/$(shell date +%T)/g' \
94 -e 's/@@whoami@@/$(shell whoami)/g' \
95 -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
96 -e 's/@@hostname@@/$(shell hostname)/g' \
97 -e 's|@@compiler@@|$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -n 1 | sed -e "s;|;/;")|g' \
98 -e 's/@@version@@/$(XEN_VERSION)/g' \
99 -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
100 -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
101 -e 's!@@changeset@@!$(shell ((hg parents || head -n 7 ../ChangeLog || echo date: unavailable) | awk '{FS="changeset:[ ]+"}/^changeset/{CS=$$2};{FS="date:[ ]+"}/^date/{D=$$2}; END {print D, CS}') 2>/dev/null)!g' \
102 < include/xen/compile.h.in > $@.new
103 @cat include/xen/banner.h >> $@.new
104 @mv -f $@.new $@
106 include/xen/banner.h:
107 tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) > $@.new
108 @mv -f $@.new $@
110 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
111 @(set -e; \
112 echo "/*"; \
113 echo " * DO NOT MODIFY."; \
114 echo " *"; \
115 echo " * This file was auto-generated from $<"; \
116 echo " *"; \
117 echo " */"; \
118 echo ""; \
119 echo "#ifndef __ASM_OFFSETS_H__"; \
120 echo "#define __ASM_OFFSETS_H__"; \
121 echo ""; \
122 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
123 echo ""; \
124 echo "#endif") <$< >$@
126 .PHONY: default debug install dist clean delete-unfresh-files TAGS tags
128 SUBDIRS = acm arch/$(TARGET_ARCH) common drivers
129 define all_sources
130 ( find include/asm-$(TARGET_ARCH) -name SCCS -prune -o -name '*.h' -print; \
131 find include -type d -name SCCS -prune -o \( -name "asm-*" -o \
132 -name config \) -prune -o -name '*.h' -print; \
133 find $(SUBDIRS) -name SCCS -prune -o -name '*.[chS]' -print )
134 endef
135 TAGS:
136 $(all_sources) | etags -
137 tags:
138 $(all_sources) | xargs ctags
139 cscope:
140 $(all_sources) > cscope.files
141 cscope -k -b -q
142 MAP:
143 $(NM) $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map