aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/Makefile
diff options
context:
space:
mode:
authorEmmanuel Ackaouy <ack@xensource.com>2007-01-10 17:56:54 +0000
committerEmmanuel Ackaouy <ack@xensource.com>2007-01-10 17:56:54 +0000
commit2736a406e4eac36a6de7a3b5e08b7f30da038f35 (patch)
treed469b1f23a86bb92ea03ac598d6b7c1e3278875b /xen/include/Makefile
parent7220350010061dfd1c354397d7a25ec6829ae88a (diff)
downloadxen-2736a406e4eac36a6de7a3b5e08b7f30da038f35.tar.gz
xen-2736a406e4eac36a6de7a3b5e08b7f30da038f35.tar.bz2
xen-2736a406e4eac36a6de7a3b5e08b7f30da038f35.zip
[XEN] Partial fix for compat build non-portability.
Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'xen/include/Makefile')
-rw-r--r--xen/include/Makefile50
1 files changed, 27 insertions, 23 deletions
diff --git a/xen/include/Makefile b/xen/include/Makefile
index d2efb237c3..15b347ca11 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -2,8 +2,28 @@ ifneq ($(CONFIG_COMPAT),)
compat-arch-$(CONFIG_X86) := x86_32
-headers-y := $(shell echo public/*.h | sed -e 's,[^[:space:]]*-[^[:space:]]*,,g' -e 's,public/,compat/,g')
-headers-y := $(filter-out %/dom0_ops.h,$(headers-y))
+headers-y := \
+ compat/acm.h \
+ compat/acm_ops.h \
+ compat/callback.h \
+ compat/domctl.h \
+ compat/elfnote.h \
+ compat/event_channel.h \
+ compat/features.h \
+ compat/grant_table.h \
+ compat/kexec.h \
+ compat/memory.h \
+ compat/nmi.h \
+ compat/physdev.h \
+ compat/platform.h \
+ compat/sched.h \
+ compat/sysctl.h \
+ compat/trace.h \
+ compat/vcpu.h \
+ compat/version.h \
+ compat/xen.h \
+ compat/xencomm.h \
+ compat/xenoprof.h
headers-$(CONFIG_X86) += compat/arch-x86/xen.h
headers-$(CONFIG_X86) += compat/arch-x86/xen-$(compat-arch-y).h
headers-y += compat/arch-$(compat-arch-y).h compat/xlat.h
@@ -21,24 +41,14 @@ endif
all: $(headers-y)
compat/%.h: compat/%.i Makefile
- id=_$$(echo $@ | sed 'y,abcdefghijklmnopqrstuvwxyz-/.,ABCDEFGHIJKLMNOPQRSTUVWXYZ___,'); \
+ id=_$$(echo $@ | tr '[:lower:]-/.' '[:upper:]___'); \
echo "#ifndef $$id" >$@.new; \
echo "#define $$id" >>$@.new; \
echo "#include <xen/compat.h>" >>$@.new; \
$(if $(filter-out compat/arch-%.h,$@),echo "#include <$(patsubst compat/%,public/%,$@)>" >>$@.new;) \
$(if $(prefix-y),echo "$(prefix-y)" >>$@.new;) \
- grep -v '^# [[:digit:]]' $< | \
- sed -e 's,__InClUdE__,#include,' \
- -e 's,"xen-compat.h",<public/xen-compat.h>,' \
- -e 's,\(struct\|union\|enum\)[[:space:]]\+\(xen_\?\)\?\([[:alpha:]_]\),\1 compat_\3,g' \
- -e 's,@KeeP@,,g' \
- -e 's,_t\([^[:alnum:]_]\|$$\),_compat_t\1,g' \
- -e 's,\(8\|16\|32\|64\)_compat_t\([^[:alnum:]_]\|$$\),\1_t\2,g' \
- -e 's,\(^\|[^[:alnum:]_]\)xen_\?\([[:alnum:]_]*\)_compat_t\([^[:alnum:]_]\|$$\),\1compat_\2_t\3,g' \
- -e 's,\(^\|[^[:alnum:]_]\)XEN_\?,\1COMPAT_,' \
- -e 's,\(^\|[^[:alnum:]_]\)Xen_\?,\1Compat_,' \
- -e 's,\(^\|[^[:alnum:]]\)long\([^[:alnum:]]\|$$\),\1int\2,g' | \
- uniq >>$@.new; \
+ grep -v '^# [0-9]' $< | \
+ $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \
$(if $(suffix-y),echo "$(suffix-y)" >>$@.new;) \
echo "#endif /* $$id */" >>$@.new
mv -f $@.new $@
@@ -49,17 +59,11 @@ compat/%.i: compat/%.c Makefile
compat/%.c: public/%.h xlat.lst Makefile
mkdir -p $(@D)
grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' $< | \
- sed -e 's,^[[:space:]]*#[[:space:]]*include[[:space:]]\+,__InClUdE__ ,' \
- -e 's,^[[:space:]]*#[[:space:]]*define[[:space:]]\+\([[:upper:]_]*_GUEST_HANDLE\),#define HIDE_\1,' \
- -e 's,^[[:space:]]*#[[:space:]]*define[[:space:]]\+\([[:lower:]_]*_guest_handle\),#define hide_\1,' \
- -e 's,XEN_GUEST_HANDLE\(_[[:xdigit:]]\+\)\?,COMPAT_HANDLE,g' \
- $(foreach n,$(shell sed -n 's,^[[:space:]]*?[[:space:]]\+\([[:alnum:]_]*\)[[:space:]].*,\1,p' xlat.lst), \
- -e 's,\(struct\|union\)[[:space:]]\+\(xen_\?\)\?$n[[:space:]]\+\([[:alpha:]_]\),\1 @KeeP@\2$n \3,g') \
- >$@.new
+ $(BASEDIR)/tools/compat-build-source.py >$@.new
mv -f $@.new $@
compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile
- grep -v '^[[:space:]]*#' xlat.lst | \
+ grep -v '^[ ]*#' xlat.lst | \
while read what name hdr; do \
$(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
done >$@.new