ia64/xen-unstable

view xen/include/Makefile @ 18922:68b76ad4faf7

xentop: Fix fprintf() build failure.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Dec 11 22:32:20 2008 +0000 (2008-12-11)
parents a49673cd23d2
children dbf53b739af0
line source
1 ifneq ($(CONFIG_COMPAT),)
3 compat-arch-$(CONFIG_X86) := x86_32
5 headers-y := \
6 compat/callback.h \
7 compat/elfnote.h \
8 compat/event_channel.h \
9 compat/features.h \
10 compat/grant_table.h \
11 compat/kexec.h \
12 compat/memory.h \
13 compat/nmi.h \
14 compat/physdev.h \
15 compat/platform.h \
16 compat/sched.h \
17 compat/trace.h \
18 compat/vcpu.h \
19 compat/version.h \
20 compat/xen.h \
21 compat/xencomm.h \
22 compat/xenoprof.h
23 headers-$(CONFIG_X86) += compat/arch-x86/xen-mca.h
24 headers-$(CONFIG_X86) += compat/arch-x86/xen.h
25 headers-$(CONFIG_X86) += compat/arch-x86/xen-$(compat-arch-y).h
26 headers-y += compat/arch-$(compat-arch-y).h compat/xlat.h
28 cppflags-y := -include public/xen-compat.h
29 cppflags-$(CONFIG_X86) += -m32
31 # 8-byte types are 4-byte aligned on x86_32 ...
32 prefix-$(CONFIG_X86) := \#pragma pack(4)
33 suffix-$(CONFIG_X86) := \#pragma pack()
35 endif
37 .PHONY: all
38 all: $(headers-y)
40 compat/%.h: compat/%.i Makefile
41 set -e; id=_$$(echo $@ | tr '[:lower:]-/.' '[:upper:]___'); \
42 echo "#ifndef $$id" >$@.new; \
43 echo "#define $$id" >>$@.new; \
44 echo "#include <xen/compat.h>" >>$@.new; \
45 $(if $(filter-out compat/arch-%.h,$@),echo "#include <$(patsubst compat/%,public/%,$@)>" >>$@.new;) \
46 $(if $(prefix-y),echo "$(prefix-y)" >>$@.new;) \
47 grep -v '^# [0-9]' $< | \
48 $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \
49 $(if $(suffix-y),echo "$(suffix-y)" >>$@.new;) \
50 echo "#endif /* $$id */" >>$@.new
51 mv -f $@.new $@
53 compat/%.i: compat/%.c Makefile
54 $(CPP) $(CFLAGS) $(cppflags-y) -o $@ $<
56 compat/%.c: public/%.h xlat.lst Makefile
57 mkdir -p $(@D)
58 grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' $< | \
59 $(BASEDIR)/tools/compat-build-source.py >$@.new
60 mv -f $@.new $@
62 compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile
63 grep -v '^[ ]*#' xlat.lst | \
64 while read what name hdr; do \
65 $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
66 done >$@.new
67 mv -f $@.new $@
69 clean::
70 rm -rf compat