aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/xen-foreign
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-01-26 10:38:44 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-01-26 10:38:44 +0000
commitbe5fbf9a7fecc31c192ca0c547a1f6b864d7aa05 (patch)
tree9e7ea5294656ebe1b5e31904644a4cf5560c68f4 /tools/include/xen-foreign
parentbc4a5b7bf50bf466cfc63f20a3907d904d5f0cdf (diff)
downloadxen-be5fbf9a7fecc31c192ca0c547a1f6b864d7aa05.tar.gz
xen-be5fbf9a7fecc31c192ca0c547a1f6b864d7aa05.tar.bz2
xen-be5fbf9a7fecc31c192ca0c547a1f6b864d7aa05.zip
Move generation of public header hierarchy into the tools.
This patch merges the two versions of public header generation currently used in the build into one. Signed-off-by: Bastian Blank <waldi@debian.org>
Diffstat (limited to 'tools/include/xen-foreign')
-rw-r--r--tools/include/xen-foreign/Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
new file mode 100644
index 0000000000..394edb602e
--- /dev/null
+++ b/tools/include/xen-foreign/Makefile
@@ -0,0 +1,45 @@
+XEN_ROOT=../../..
+include $(XEN_ROOT)/Config.mk
+
+ROOT = $(XEN_ROOT)/xen/include/public/foreign
+#VPATH = $(ROOT)
+HOSTCFLAGS += -I$(ROOT)
+
+MKHEADER_PY = $(ROOT)/mkheader.py
+
+architectures := x86_32 x86_64 ia64
+headers := $(patsubst %, %.h, $(architectures))
+scripts := $(wildcard *.py)
+
+.PHONY: all clean check-headers
+all: $(headers) check-headers
+
+clean:
+ rm -f $(headers)
+ rm -f checker checker.c
+ rm -f *.pyc *.o *~
+
+ifeq ($(CROSS_COMPILE)$(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
+checker: checker.c $(headers)
+ $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
+
+check-headers: checker
+ ./checker > tmp.size
+ diff -u $(ROOT)/reference.size tmp.size
+ rm tmp.size
+else
+check-headers:
+ @echo "cross build: skipping check"
+endif
+
+x86_32.h: $(ROOT)/mkheader.py ../xen/arch-x86/xen-x86_32.h ../xen/arch-x86/xen.h ../xen/xen.h
+ python $< $* $@ $(filter %.h,$^)
+
+x86_64.h: $(ROOT)/mkheader.py ../xen/arch-x86/xen-x86_64.h ../xen/arch-x86/xen.h ../xen/xen.h
+ python $< $* $@ $(filter %.h,$^)
+
+ia64.h: $(ROOT)/mkheader.py ../xen/arch-ia64.h ../xen/xen.h
+ python $< $* $@ $(filter %.h,$^)
+
+checker.c: $(ROOT)/mkchecker.py
+ python $< $(XEN_TARGET_ARCH) $@ $(architectures)