ia64/xen-unstable

view xen/include/Makefile @ 19836:d9890e67d2b7

tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:05:10 2009 +0100 (2009-06-25)
parents 82366af53828
children
line source
1 XEN_ROOT:=$(BASEDIR)/..
2 include $(XEN_ROOT)/Config.mk
4 ifneq ($(CONFIG_COMPAT),)
6 compat-arch-$(CONFIG_X86) := x86_32
8 headers-y := \
9 compat/callback.h \
10 compat/elfnote.h \
11 compat/event_channel.h \
12 compat/features.h \
13 compat/grant_table.h \
14 compat/kexec.h \
15 compat/memory.h \
16 compat/nmi.h \
17 compat/physdev.h \
18 compat/platform.h \
19 compat/sched.h \
20 compat/tmem.h \
21 compat/trace.h \
22 compat/vcpu.h \
23 compat/version.h \
24 compat/xen.h \
25 compat/xencomm.h \
26 compat/xenoprof.h
27 headers-$(CONFIG_X86) += compat/arch-x86/xen-mca.h
28 headers-$(CONFIG_X86) += compat/arch-x86/xen.h
29 headers-$(CONFIG_X86) += compat/arch-x86/xen-$(compat-arch-y).h
30 headers-y += compat/arch-$(compat-arch-y).h compat/xlat.h
32 cppflags-y := -include public/xen-compat.h
33 cppflags-$(CONFIG_X86) += -m32
35 # 8-byte types are 4-byte aligned on x86_32 ...
36 prefix-$(CONFIG_X86) := \#pragma pack(4)
37 suffix-$(CONFIG_X86) := \#pragma pack()
39 endif
41 public-$(CONFIG_X86) := $(wildcard public/arch-x86/*.h public/arch-x86/*/*.h)
42 public-$(CONFIG_IA64) := $(wildcard public/arch-ia64/*.h public/arch-ia64/*/*.h)
44 .PHONY: all
45 all: $(headers-y)
47 compat/%.h: compat/%.i Makefile
48 set -e; id=_$$(echo $@ | tr '[:lower:]-/.' '[:upper:]___'); \
49 echo "#ifndef $$id" >$@.new; \
50 echo "#define $$id" >>$@.new; \
51 echo "#include <xen/compat.h>" >>$@.new; \
52 $(if $(filter-out compat/arch-%.h,$@),echo "#include <$(patsubst compat/%,public/%,$@)>" >>$@.new;) \
53 $(if $(prefix-y),echo "$(prefix-y)" >>$@.new;) \
54 grep -v '^# [0-9]' $< | \
55 $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \
56 $(if $(suffix-y),echo "$(suffix-y)" >>$@.new;) \
57 echo "#endif /* $$id */" >>$@.new
58 mv -f $@.new $@
60 compat/%.i: compat/%.c Makefile
61 $(CPP) $(filter-out -M% .%.d,$(CFLAGS)) $(cppflags-y) -o $@ $<
63 compat/%.c: public/%.h xlat.lst Makefile
64 mkdir -p $(@D)
65 grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' $< | \
66 $(BASEDIR)/tools/compat-build-source.py >$@.new
67 mv -f $@.new $@
69 compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile
70 grep -v '^[ ]*#' xlat.lst | \
71 while read what name hdr; do \
72 $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
73 done >$@.new
74 mv -f $@.new $@
76 ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
77 # public/arch-ia64.h explicitly bails on __STRICT_ANSI__
78 ifeq ($(CONFIG_IA64),)
80 all: headers.chk
82 headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
83 for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
84 mv $@.new $@
86 endif
87 endif
89 clean::
90 rm -rf compat headers.chk