direct-io.hg

view xen/include/Makefile @ 13656:78b7ec4e7b86

Fix compat build for weird solaris gcc target.
Signed-off-by: John Levon <john.levon@sun.com>
author kaf24@localhost.localdomain
date Sun Jan 28 16:05:07 2007 +0000 (2007-01-28)
parents 30af6cfdb05c
children d0acb5a3e8d8
line source
1 ifneq ($(CONFIG_COMPAT),)
3 compat-arch-$(CONFIG_X86) := x86_32
5 headers-y := \
6 compat/acm.h \
7 compat/acm_ops.h \
8 compat/callback.h \
9 compat/elfnote.h \
10 compat/event_channel.h \
11 compat/features.h \
12 compat/grant_table.h \
13 compat/kexec.h \
14 compat/memory.h \
15 compat/nmi.h \
16 compat/physdev.h \
17 compat/platform.h \
18 compat/sched.h \
19 compat/trace.h \
20 compat/vcpu.h \
21 compat/version.h \
22 compat/xen.h \
23 compat/xencomm.h \
24 compat/xenoprof.h
25 headers-$(CONFIG_X86) += compat/arch-x86/xen.h
26 headers-$(CONFIG_X86) += compat/arch-x86/xen-$(compat-arch-y).h
27 headers-y += compat/arch-$(compat-arch-y).h compat/xlat.h
29 cppflags-y := -include public/xen-compat.h
30 cppflags-$(CONFIG_X86) += -m32
32 # 8-byte types are 4-byte aligned on x86_32 ...
33 prefix-$(CONFIG_X86) := \#pragma pack(4)
34 suffix-$(CONFIG_X86) := \#pragma pack()
36 endif
38 .PHONY: all
39 all: $(headers-y)
41 compat/%.h: compat/%.i Makefile
42 id=_$$(echo $@ | tr '[:lower:]-/.' '[:upper:]___'); \
43 echo "#ifndef $$id" >$@.new; \
44 echo "#define $$id" >>$@.new; \
45 echo "#include <xen/compat.h>" >>$@.new; \
46 $(if $(filter-out compat/arch-%.h,$@),echo "#include <$(patsubst compat/%,public/%,$@)>" >>$@.new;) \
47 $(if $(prefix-y),echo "$(prefix-y)" >>$@.new;) \
48 grep -v '^# [0-9]' $< | \
49 $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \
50 $(if $(suffix-y),echo "$(suffix-y)" >>$@.new;) \
51 echo "#endif /* $$id */" >>$@.new
52 mv -f $@.new $@
54 compat/%.i: compat/%.c Makefile
55 $(CPP) $(CFLAGS) $(cppflags-y) -o $@ $<
57 compat/%.c: public/%.h xlat.lst Makefile
58 mkdir -p $(@D)
59 grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' $< | \
60 $(BASEDIR)/tools/compat-build-source.py >$@.new
61 mv -f $@.new $@
63 compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile
64 grep -v '^[ ]*#' xlat.lst | \
65 while read what name hdr; do \
66 /bin/bash $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
67 done >$@.new
68 mv -f $@.new $@
70 clean::
71 rm -rf compat