Commit 093fdc11 authored by Keir Fraser's avatar Keir Fraser

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: default avatarBastian Blank <waldi@debian.org>
parent ab75b1bc
......@@ -118,6 +118,9 @@
^tools/firmware/vmxassist/offsets\.h$
^tools/firmware/vmxassist/vmxassist$
^tools/flask/loadpolicy/flask-loadpolicy$
^tools/include/\.dir$
^tools/include/xen-foreign/.*\.(c|h|size)$
^tools/include/xen-foreign/checker$
^tools/ioemu/\.pc/.*$
^tools/ioemu/config-host\.h$
^tools/ioemu/config-host\.mak$
......@@ -227,8 +230,6 @@
^xen/include/asm-ia64/asm-xsi-offsets\.h$
^xen/include/compat/.*$
^xen/include/hypervisor-ifs/arch$
^xen/include/public/foreign/.*\.(c|h|size)$
^xen/include/public/foreign/checker$
^xen/include/public/public$
^xen/include/xen/.*\.new$
^xen/include/xen/acm_policy\.h$
......
......@@ -2,6 +2,7 @@ XEN_ROOT = ../
include $(XEN_ROOT)/tools/Rules.mk
SUBDIRS-y :=
SUBDIRS-y += include
SUBDIRS-y += libxc
SUBDIRS-y += flask
SUBDIRS-y += xenstore
......
......@@ -5,6 +5,7 @@ all:
include $(XEN_ROOT)/Config.mk
XEN_INCLUDE = $(XEN_ROOT)/tools/include
XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
XEN_LIBXC = $(XEN_ROOT)/tools/libxc
XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore
......@@ -37,26 +38,3 @@ $(eval $(check-y))
%.o: %.cc
$(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
.PHONY: mk-symlinks
mk-symlinks:
mkdir -p xen/sys
( cd xen/sys && \
ln -sf ../../$(XEN_ROOT)/tools/include/$(XEN_OS)/*.h . )
mkdir -p xen
( cd xen && ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
mkdir -p xen/hvm
( cd xen/hvm && ln -sf ../../$(XEN_ROOT)/xen/include/public/hvm/*.h . )
mkdir -p xen/io
( cd xen/io && ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
mkdir -p xen/xsm
( cd xen/xsm && ln -sf ../../$(XEN_ROOT)/xen/include/public/xsm/*.h . )
mkdir -p xen/arch-x86
( cd xen/arch-x86 && ln -sf ../../$(XEN_ROOT)/xen/include/public/arch-x86/*.h . )
mkdir -p xen/arch-ia64
( cd xen/arch-ia64 && ln -sf ../../$(XEN_ROOT)/xen/include/public/arch-ia64/*.h . )
mkdir -p xen/foreign
( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/Makefile . )
( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/reference.size . )
( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/*.py . )
$(MAKE) -C xen/foreign
XEN_ROOT = ../../..
include $(XEN_ROOT)/tools/Rules.mk
INCLUDES += -I.. -I../lib
INCLUDES += -I.. -I../lib -I$(XEN_INCLUDE)
IBIN = blktapctrl tapdisk
QCOW_UTIL = img2qcow qcow2raw qcow-create
......
......@@ -5,7 +5,7 @@ MAJOR = 3.0
MINOR = 0
SONAME = libblktap.so.$(MAJOR)
INCLUDES += -I. -I.. -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
INCLUDES += -I. -I.. -I $(XEN_LIBXC) -I $(XEN_XENSTORE) -I$(XEN_INCLUDE)
LIBS := -lxenstore
......
......@@ -8,6 +8,7 @@ CFLAGS += -Werror
CFLAGS += -I $(XEN_LIBXC)
CFLAGS += -I $(XEN_XENSTORE)
CFLAGS += -I $(XEN_INCLUDE)
BIN = xenconsoled xenconsole
......
......@@ -11,7 +11,7 @@ SRCS += flask_op.c
CFLAGS += -Werror
CFLAGS += -fno-strict-aliasing
CFLAGS += $(INCLUDES) -I./include -I$(XEN_LIBXC)
CFLAGS += $(INCLUDES) -I./include -I$(XEN_LIBXC) -I$(XEN_INCLUDE)
# Get gcc to generate the dependencies for us.
CFLAGS += -Wp,-MD,.$(@F).d
......
......@@ -15,6 +15,7 @@ BASECFLAGS+= $(PROFILE)
BASECFLAGS+= -I$(LIBXC_ROOT)
BASECFLAGS+= -I$(LIBFLASK_ROOT)/include
BASECFLAGS+= -I.
BASECFLAGS+= -I$(XEN_INCLUDE)
CFLAGS += $(BASECFLAGS)
LDFLAGS += $(PROFILE) -L$(XEN_LIBXC) -L$(LIBFLASK_ROOT)
......
XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
.PHONY: all
all:
$(MAKE) .dir
.dir:
@rm -rf xen
mkdir xen
ln -sf ../$(XEN_ROOT)/xen/include/public/COPYING xen
ln -sf $(addprefix ../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) xen
ln -sf $(addprefix ../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) xen
ln -sf ../$(XEN_OS) xen/sys
$(MAKE) -C xen-foreign
ln -s ../xen-foreign xen/foreign
touch $@
.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/arch-ia64
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/arch-x86
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/foreign
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/hvm
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/io
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/xsm
$(INSTALL_DATA) xen/COPYING $(DESTDIR)$(INCLUDEDIR)/xen
$(INSTALL_DATA) xen/*.h $(DESTDIR)$(INCLUDEDIR)/xen
$(INSTALL_DATA) xen/arch-ia64/*.h $(DESTDIR)$(INCLUDEDIR)/xen/arch-x86
$(INSTALL_DATA) xen/arch-x86/*.h $(DESTDIR)$(INCLUDEDIR)/xen/arch-x86
$(INSTALL_DATA) xen/foreign/*.h $(DESTDIR)$(INCLUDEDIR)/xen/foreign
$(INSTALL_DATA) xen/hvm/*.h $(DESTDIR)$(INCLUDEDIR)/xen/hvm
$(INSTALL_DATA) xen/io/*.h $(DESTDIR)$(INCLUDEDIR)/xen/io
$(INSTALL_DATA) xen/xsm/*.h $(DESTDIR)$(INCLUDEDIR)/xen/xsm
.PHONY: clean
clean:
rm -rf xen .dir
$(MAKE) -C xen-foreign clean
XEN_ROOT=../../../..
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)
......@@ -10,28 +16,30 @@ all: $(headers) check-headers
clean:
rm -f $(headers)
rm -f checker checker.c $(XEN_TARGET_ARCH).size
rm -f checker checker.c
rm -f *.pyc *.o *~
ifeq ($(CROSS_COMPILE)$(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
check-headers: checker
./checker > $(XEN_TARGET_ARCH).size
diff -u reference.size $(XEN_TARGET_ARCH).size
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: ../arch-x86/xen-x86_32.h ../arch-x86/xen.h ../xen.h $(scripts)
python mkheader.py $* $@ $(filter %.h,$^)
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: ../arch-x86/xen-x86_64.h ../arch-x86/xen.h ../xen.h $(scripts)
python mkheader.py $* $@ $(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: ../arch-ia64.h ../xen.h $(scripts)
python mkheader.py $* $@ $(filter %.h,$^)
ia64.h: $(ROOT)/mkheader.py ../xen/arch-ia64.h ../xen/xen.h
python $< $* $@ $(filter %.h,$^)
checker.c: $(scripts)
python mkchecker.py $(XEN_TARGET_ARCH) $@ $(architectures)
checker.c: $(ROOT)/mkchecker.py
python $< $(XEN_TARGET_ARCH) $@ $(architectures)
......@@ -18,6 +18,7 @@ VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc
CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore
CPPFLAGS+= -I$(XEN_ROOT)/tools/include
ifdef CONFIG_DARWIN_USER
VPATH+=:$(SRC_PATH)/darwin-user
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
......
......@@ -50,7 +50,7 @@ GUEST_SRCS-$(CONFIG_POWERPC) += xc_dom_powerpc.c
-include $(XEN_TARGET_ARCH)/Makefile
CFLAGS += -Werror -Wmissing-prototypes
CFLAGS += $(INCLUDES) -I. -I../xenstore
CFLAGS += $(INCLUDES) -I. -I../xenstore -I../include
# Needed for posix_fadvise64() in xc_linux.c
CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
......@@ -80,7 +80,7 @@ LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
all: build
.PHONY: build
build: check-for-zlib mk-symlinks
build: check-for-zlib
$(MAKE) $(LIB)
.PHONY: check-for-zlib
......@@ -114,7 +114,7 @@ TAGS:
.PHONY: clean
clean:
rm -rf *.rpm $(LIB) *~ $(DEPS) xen \
rm -rf *.rpm $(LIB) *~ $(DEPS) \
$(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
......
......@@ -5,6 +5,7 @@ CFLAGS += -Werror
INCLUDES += -I $(XEN_XC)
INCLUDES += -I $(XEN_LIBXC)
INCLUDES += -I $(XEN_INCLUDE)
CFLAGS += $(INCLUDES)
HDRS = $(wildcard *.h)
......
......@@ -8,6 +8,7 @@ extra_compile_args = [ "-fno-strict-aliasing", "-Werror" ]
include_dirs = [ XEN_ROOT + "/tools/libxc",
XEN_ROOT + "/tools/xenstore",
XEN_ROOT + "/tools/include",
]
library_dirs = [ XEN_ROOT + "/tools/libxc",
......
......@@ -13,7 +13,7 @@ include $(XEN_ROOT)/tools/Rules.mk
PROGRAMS_INSTALL_DIR = $(LIBDIR)/xen/bin
INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE) -I$(XEN_INCLUDE)
CFLAGS += -Werror
CFLAGS += $(INCLUDES)
......
......@@ -16,6 +16,7 @@ include $(XEN_ROOT)/tools/Rules.mk
CFLAGS += -Werror
CFLAGS += -I $(XEN_XC)
CFLAGS += -I $(XEN_LIBXC)
CFLAGS += -I $(XEN_INCLUDE)
LDFLAGS += -L $(XEN_LIBXC)
BIN = xentrace_setmask xenbaked
......
......@@ -36,7 +36,7 @@ SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR)
WARN_FLAGS=-Wall -Werror
CFLAGS+=-Isrc -I$(XEN_LIBXC) -I$(XEN_XENSTORE)
CFLAGS+=-Isrc -I$(XEN_LIBXC) -I$(XEN_XENSTORE) -I$(XEN_INCLUDE)
LDFLAGS+=-Lsrc -L$(XEN_XENSTORE)/ -L$(XEN_LIBXC)/
LDLIBS-y = -lxenstore -lxenctrl
LDLIBS-$(CONFIG_SunOS) += -lkstat
......
......@@ -13,6 +13,7 @@ PROG_DEP = .*.d
BASECFLAGS+= $(PROFILE)
BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
BASECFLAGS+= -I.
BASECFLAGS+= -I$(XEN_INCLUDE)
CFLAGS += $(BASECFLAGS)
LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
......
......@@ -5,6 +5,7 @@ CFLAGS += -Werror
CFLAGS += -I $(XEN_XC)
CFLAGS += -I $(XEN_LIBXC)
CFLAGS += -I $(XEN_INCLUDE)
HDRS = $(wildcard *.h)
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
......
......@@ -22,30 +22,13 @@ build install debug clean distclean cscope TAGS tags MAP::
_build: $(TARGET).gz
.PHONY: _install
_install: $(TARGET).gz build-headers
_install: $(TARGET).gz
[ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
$(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
[ -d $(DESTDIR)/usr/include/xen/arch-x86 ] || \
$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/arch-x86
[ -d $(DESTDIR)/usr/include/xen/hvm ] || \
$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/hvm
[ -d $(DESTDIR)/usr/include/xen/io ] || \
$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
[ -d $(DESTDIR)/usr/include/xen/xsm ] || \
$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/xsm
[ -d $(DESTDIR)/usr/include/xen/foreign ] || \
$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/foreign
$(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
$(INSTALL_DATA) include/public/arch-x86/*.h $(DESTDIR)/usr/include/xen/arch-x86
$(INSTALL_DATA) include/public/hvm/*.h $(DESTDIR)/usr/include/xen/hvm
$(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
$(INSTALL_DATA) include/public/xsm/*.h $(DESTDIR)/usr/include/xen/xsm
$(INSTALL_DATA) include/public/foreign/*.h $(DESTDIR)/usr/include/xen/foreign
$(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
.PHONY: _debug
_debug:
......@@ -54,7 +37,6 @@ _debug:
.PHONY: _clean
_clean: delete-unfresh-files
$(MAKE) -C tools clean
$(MAKE) -C include/public/foreign clean
$(MAKE) -f $(BASEDIR)/Rules.mk -C include clean
$(MAKE) -f $(BASEDIR)/Rules.mk -C common clean
$(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean
......@@ -71,7 +53,7 @@ $(TARGET).gz: $(TARGET)
gzip -f -9 < $< > $@.new
mv $@.new $@
$(TARGET): delete-unfresh-files build-headers
$(TARGET): delete-unfresh-files
$(MAKE) -C tools
$(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h
[ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm
......@@ -120,11 +102,6 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
echo ""; \
echo "#endif") <$< >$@
# generate header files
.PHONY: build-headers
build-headers:
$(MAKE) -C include/public/foreign
SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers
define all_sources
( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment