@@ -365,7 +365,7 @@ define BUILD_lib
$$(MAKE) -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
fi
- libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile
+ libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile.common
$$(do_links)
endef
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 3
-OBJS-y += core.o buffer.o
-OBJS-$(CONFIG_Linux) += linux.o
-OBJS-$(CONFIG_FreeBSD) += freebsd.o
-OBJS-$(CONFIG_SunOS) += solaris.o
-OBJS-$(CONFIG_NetBSD) += netbsd.o
-OBJS-$(CONFIG_MiniOS) += minios.o
+include Makefile.common
include $(XEN_ROOT)/tools/libs/libs.mk
new file mode 100644
@@ -0,0 +1,6 @@
+OBJS-y += core.o buffer.o
+OBJS-$(CONFIG_Linux) += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS) += solaris.o
+OBJS-$(CONFIG_NetBSD) += netbsd.o
+OBJS-$(CONFIG_MiniOS) += minios.o
@@ -1,50 +1,7 @@
XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
-OBJS-y += xc_altp2m.o
-OBJS-y += xc_cpupool.o
-OBJS-y += xc_domain.o
-OBJS-y += xc_evtchn.o
-OBJS-y += xc_gnttab.o
-OBJS-y += xc_misc.o
-OBJS-y += xc_flask.o
-OBJS-y += xc_physdev.o
-OBJS-y += xc_private.o
-OBJS-y += xc_csched.o
-OBJS-y += xc_csched2.o
-OBJS-y += xc_arinc653.o
-OBJS-y += xc_rt.o
-OBJS-y += xc_tbuf.o
-OBJS-y += xc_pm.o
-OBJS-y += xc_cpu_hotplug.o
-OBJS-y += xc_vm_event.o
-OBJS-y += xc_vmtrace.o
-OBJS-y += xc_monitor.o
-OBJS-y += xc_mem_paging.o
-OBJS-y += xc_mem_access.o
-OBJS-y += xc_memshr.o
-OBJS-y += xc_hcall_buf.o
-OBJS-y += xc_foreign_memory.o
-OBJS-y += xc_kexec.o
-OBJS-y += xc_resource.o
-OBJS-$(CONFIG_X86) += xc_psr.o
-OBJS-$(CONFIG_X86) += xc_pagetab.o
-OBJS-$(CONFIG_Linux) += xc_linux.o
-OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
-OBJS-$(CONFIG_SunOS) += xc_solaris.o
-OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
-OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
-OBJS-$(CONFIG_MiniOS) += xc_minios.o
-OBJS-y += xc_evtchn_compat.o
-OBJS-y += xc_gnttab_compat.o
-OBJS-y += xc_devicemodel_compat.o
-
-CFLAGS += -D__XEN_TOOLS__
-CFLAGS += $(PTHREAD_CFLAGS)
-CFLAGS += -include $(XEN_ROOT)/tools/config.h
-
-# Needed for posix_fadvise64() in xc_linux.c
-CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
+include Makefile.common
LIBHEADER := xenctrl.h xenctrl_compat.h
PKG_CONFIG := xencontrol.pc
new file mode 100644
@@ -0,0 +1,44 @@
+OBJS-y += xc_altp2m.o
+OBJS-y += xc_cpupool.o
+OBJS-y += xc_domain.o
+OBJS-y += xc_evtchn.o
+OBJS-y += xc_gnttab.o
+OBJS-y += xc_misc.o
+OBJS-y += xc_flask.o
+OBJS-y += xc_physdev.o
+OBJS-y += xc_private.o
+OBJS-y += xc_csched.o
+OBJS-y += xc_csched2.o
+OBJS-y += xc_arinc653.o
+OBJS-y += xc_rt.o
+OBJS-y += xc_tbuf.o
+OBJS-y += xc_pm.o
+OBJS-y += xc_cpu_hotplug.o
+OBJS-y += xc_vm_event.o
+OBJS-y += xc_vmtrace.o
+OBJS-y += xc_monitor.o
+OBJS-y += xc_mem_paging.o
+OBJS-y += xc_mem_access.o
+OBJS-y += xc_memshr.o
+OBJS-y += xc_hcall_buf.o
+OBJS-y += xc_foreign_memory.o
+OBJS-y += xc_kexec.o
+OBJS-y += xc_resource.o
+OBJS-$(CONFIG_X86) += xc_psr.o
+OBJS-$(CONFIG_X86) += xc_pagetab.o
+OBJS-$(CONFIG_Linux) += xc_linux.o
+OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
+OBJS-$(CONFIG_SunOS) += xc_solaris.o
+OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
+OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
+OBJS-$(CONFIG_MiniOS) += xc_minios.o
+OBJS-y += xc_evtchn_compat.o
+OBJS-y += xc_gnttab_compat.o
+OBJS-y += xc_devicemodel_compat.o
+
+CFLAGS += -D__XEN_TOOLS__
+CFLAGS += $(PTHREAD_CFLAGS)
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+
+# Needed for posix_fadvise64() in xc_linux.c
+CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 4
-OBJS-y += core.o
-OBJS-$(CONFIG_Linux) += common.o
-OBJS-$(CONFIG_FreeBSD) += common.o
-OBJS-$(CONFIG_SunOS) += compat.o
-OBJS-$(CONFIG_NetBSD) += compat.o
-OBJS-$(CONFIG_MiniOS) += compat.o
+include Makefile.common
include $(XEN_ROOT)/tools/libs/libs.mk
new file mode 100644
@@ -0,0 +1,6 @@
+OBJS-y += core.o
+OBJS-$(CONFIG_Linux) += common.o
+OBJS-$(CONFIG_FreeBSD) += common.o
+OBJS-$(CONFIG_SunOS) += compat.o
+OBJS-$(CONFIG_NetBSD) += compat.o
+OBJS-$(CONFIG_MiniOS) += compat.o
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 2
-OBJS-y += core.o
-OBJS-$(CONFIG_Linux) += linux.o
-OBJS-$(CONFIG_FreeBSD) += freebsd.o
-OBJS-$(CONFIG_SunOS) += solaris.o
-OBJS-$(CONFIG_NetBSD) += netbsd.o
-OBJS-$(CONFIG_MiniOS) += minios.o
+include Makefile.common
include $(XEN_ROOT)/tools/libs/libs.mk
new file mode 100644
@@ -0,0 +1,6 @@
+OBJS-y += core.o
+OBJS-$(CONFIG_Linux) += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS) += solaris.o
+OBJS-$(CONFIG_NetBSD) += netbsd.o
+OBJS-$(CONFIG_MiniOS) += minios.o
@@ -4,11 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 4
-OBJS-y += core.o
-OBJS-$(CONFIG_Linux) += linux.o
-OBJS-$(CONFIG_FreeBSD) += freebsd.o
-OBJS-$(CONFIG_SunOS) += compat.o solaris.o
-OBJS-$(CONFIG_NetBSD) += netbsd.o
-OBJS-$(CONFIG_MiniOS) += minios.o
+include Makefile.common
include $(XEN_ROOT)/tools/libs/libs.mk
new file mode 100644
@@ -0,0 +1,6 @@
+OBJS-y += core.o
+OBJS-$(CONFIG_Linux) += linux.o
+OBJS-$(CONFIG_FreeBSD) += freebsd.o
+OBJS-$(CONFIG_SunOS) += compat.o solaris.o
+OBJS-$(CONFIG_NetBSD) += netbsd.o
+OBJS-$(CONFIG_MiniOS) += minios.o
@@ -4,13 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 2
-OBJS-GNTTAB += gnttab_core.o
-OBJS-GNTSHR += gntshr_core.o
-
-OBJS-$(CONFIG_Linux) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) linux.o
-OBJS-$(CONFIG_MiniOS) += $(OBJS-GNTTAB) gntshr_unimp.o minios.o
-OBJS-$(CONFIG_FreeBSD) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) freebsd.o
-OBJS-$(CONFIG_NetBSD) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) netbsd.o
-OBJS-$(CONFIG_SunOS) += gnttab_unimp.o gntshr_unimp.o
+include Makefile.common
include $(XEN_ROOT)/tools/libs/libs.mk
new file mode 100644
@@ -0,0 +1,8 @@
+OBJS-GNTTAB += gnttab_core.o
+OBJS-GNTSHR += gntshr_core.o
+
+OBJS-$(CONFIG_Linux) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) linux.o
+OBJS-$(CONFIG_MiniOS) += $(OBJS-GNTTAB) gntshr_unimp.o minios.o
+OBJS-$(CONFIG_FreeBSD) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) freebsd.o
+OBJS-$(CONFIG_NetBSD) += $(OBJS-GNTTAB) $(OBJS-GNTSHR) netbsd.o
+OBJS-$(CONFIG_SunOS) += gnttab_unimp.o gntshr_unimp.o
@@ -1,97 +1,11 @@
XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-# Save/restore of a domain is currently incompatible with a stubdom environment
-override CONFIG_MIGRATE := n
-endif
-
-OBJS-y += xg_private.o
-OBJS-y += xg_domain.o
-OBJS-y += xg_suspend.o
-OBJS-y += xg_resume.o
-ifeq ($(CONFIG_MIGRATE),y)
-OBJS-y += xg_sr_common.o
-OBJS-$(CONFIG_X86) += xg_sr_common_x86.o
-OBJS-$(CONFIG_X86) += xg_sr_common_x86_pv.o
-OBJS-$(CONFIG_X86) += xg_sr_restore_x86_pv.o
-OBJS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.o
-OBJS-$(CONFIG_X86) += xg_sr_save_x86_pv.o
-OBJS-$(CONFIG_X86) += xg_sr_save_x86_hvm.o
-OBJS-y += xg_sr_restore.o
-OBJS-y += xg_sr_save.o
-OBJS-y += xg_offline_page.o
-else
-OBJS-y += xg_nomigrate.o
-endif
-OBJS-y += xg_core.o
-OBJS-$(CONFIG_X86) += xg_core_x86.o
-OBJS-$(CONFIG_ARM) += xg_core_arm.o
-
-vpath %.c ../../../xen/common/libelf
-
-LIBELF_OBJS += libelf-tools.o libelf-loader.o
-LIBELF_OBJS += libelf-dominfo.o
-
-OBJS-y += $(LIBELF_OBJS)
-
-ifeq ($(CONFIG_X86),y) # Add libx86 to the build
-vpath %.c ../../../xen/lib/x86
-
-OBJS-y += cpuid.o msr.o policy.o
-endif
-
-# new domain builder
-OBJS-y += xg_dom_core.o
-OBJS-y += xg_dom_boot.o
-OBJS-y += xg_dom_elfloader.o
-OBJS-$(CONFIG_X86) += xg_dom_bzimageloader.o
-OBJS-$(CONFIG_X86) += xg_dom_decompress_lz4.o
-OBJS-$(CONFIG_X86) += xg_dom_hvmloader.o
-OBJS-$(CONFIG_ARM) += xg_dom_armzimageloader.o
-OBJS-y += xg_dom_binloader.o
-OBJS-y += xg_dom_compat_linux.o
-
-OBJS-$(CONFIG_X86) += xg_dom_x86.o
-OBJS-$(CONFIG_X86) += xg_cpuid_x86.o
-OBJS-$(CONFIG_ARM) += xg_dom_arm.o
-
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-OBJS-y += xg_dom_decompress_unsafe.o
-OBJS-y += xg_dom_decompress_unsafe_bzip2.o
-OBJS-y += xg_dom_decompress_unsafe_lzma.o
-OBJS-y += xg_dom_decompress_unsafe_lzo1x.o
-OBJS-y += xg_dom_decompress_unsafe_xz.o
-OBJS-y += xg_dom_decompress_unsafe_zstd.o
-endif
-
-CFLAGS += -D__XEN_TOOLS__
-CFLAGS += -include $(XEN_ROOT)/tools/config.h
-CFLAGS += -iquote ../../../xen/common/libelf
-
-# To be able to include xc_private.h
-CFLAGS += -iquote $(XEN_libxenctrl)
-
-# Needed for posix_fadvise64() in xc_linux.c
-CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
-
-CFLAGS += $(PTHREAD_CFLAGS)
-CFLAGS += $(CFLAGS_libxentoollog)
-CFLAGS += $(CFLAGS_libxenevtchn)
-CFLAGS += $(CFLAGS_libxendevicemodel)
-
-# libxenguest includes xc_private.h, so needs this despite not using
-# this functionality directly.
-CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
-
-ifeq ($(CONFIG_MiniOS),y)
-ZLIB_CFLAGS :=
-ZLIB_LIBS :=
-endif
+include Makefile.common
xg_dom_bzimageloader.o xg_dom_bzimageloader.opic: CFLAGS += $(ZLIB_CFLAGS)
-$(LIBELF_OBJS) $(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
+$(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
LIBHEADER := xenguest.h
new file mode 100644
@@ -0,0 +1,84 @@
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+# Save/restore of a domain is currently incompatible with a stubdom environment
+override CONFIG_MIGRATE := n
+endif
+
+OBJS-y += xg_private.o
+OBJS-y += xg_domain.o
+OBJS-y += xg_suspend.o
+OBJS-y += xg_resume.o
+ifeq ($(CONFIG_MIGRATE),y)
+OBJS-y += xg_sr_common.o
+OBJS-$(CONFIG_X86) += xg_sr_common_x86.o
+OBJS-$(CONFIG_X86) += xg_sr_common_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_restore_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.o
+OBJS-$(CONFIG_X86) += xg_sr_save_x86_pv.o
+OBJS-$(CONFIG_X86) += xg_sr_save_x86_hvm.o
+OBJS-y += xg_sr_restore.o
+OBJS-y += xg_sr_save.o
+OBJS-y += xg_offline_page.o
+else
+OBJS-y += xg_nomigrate.o
+endif
+OBJS-y += xg_core.o
+OBJS-$(CONFIG_X86) += xg_core_x86.o
+OBJS-$(CONFIG_ARM) += xg_core_arm.o
+
+vpath %.c ../../../xen/common/libelf
+
+LIBELF_OBJS += libelf-tools.o libelf-loader.o
+LIBELF_OBJS += libelf-dominfo.o
+
+OBJS-y += $(LIBELF_OBJS)
+
+ifeq ($(CONFIG_X86),y) # Add libx86 to the build
+vpath %.c ../../../xen/lib/x86
+
+OBJS-y += cpuid.o msr.o policy.o
+endif
+
+# new domain builder
+OBJS-y += xg_dom_core.o
+OBJS-y += xg_dom_boot.o
+OBJS-y += xg_dom_elfloader.o
+OBJS-$(CONFIG_X86) += xg_dom_bzimageloader.o
+OBJS-$(CONFIG_X86) += xg_dom_decompress_lz4.o
+OBJS-$(CONFIG_X86) += xg_dom_hvmloader.o
+OBJS-$(CONFIG_ARM) += xg_dom_armzimageloader.o
+OBJS-y += xg_dom_binloader.o
+OBJS-y += xg_dom_compat_linux.o
+
+OBJS-$(CONFIG_X86) += xg_dom_x86.o
+OBJS-$(CONFIG_X86) += xg_cpuid_x86.o
+OBJS-$(CONFIG_ARM) += xg_dom_arm.o
+
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+OBJS-y += xg_dom_decompress_unsafe.o
+OBJS-y += xg_dom_decompress_unsafe_bzip2.o
+OBJS-y += xg_dom_decompress_unsafe_lzma.o
+OBJS-y += xg_dom_decompress_unsafe_lzo1x.o
+OBJS-y += xg_dom_decompress_unsafe_xz.o
+OBJS-y += xg_dom_decompress_unsafe_zstd.o
+endif
+
+CFLAGS += -D__XEN_TOOLS__
+CFLAGS += -include $(XEN_ROOT)/tools/config.h
+CFLAGS += -iquote ../../../xen/common/libelf
+
+# To be able to include xc_private.h
+CFLAGS += -iquote $(XEN_libxenctrl)
+
+# Needed for posix_fadvise64() in xc_linux.c
+CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
+
+CFLAGS += $(PTHREAD_CFLAGS)
+CFLAGS += $(CFLAGS_libxentoollog)
+CFLAGS += $(CFLAGS_libxenevtchn)
+CFLAGS += $(CFLAGS_libxendevicemodel)
+
+# libxenguest includes xc_private.h, so needs this despite not using
+# this functionality directly.
+CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
+
+$(LIBELF_OBJS): CFLAGS += -Wno-pointer-sign
@@ -3,19 +3,13 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 0
-AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
LIBHEADER := xentoolcore.h
-OBJS-y += handlereg.o
+include Makefile.common
include $(XEN_ROOT)/tools/libs/libs.mk
PKG_CONFIG_DESC := Central support for Xen Hypervisor userland libraries
-$(OBJS-y): $(AUTOINCS)
$(PIC_OBJS): $(AUTOINCS)
-
-$(XEN_INCLUDE)/_xentoolcore_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
- $(PERL) $^ --prefix=xentoolcore >$(notdir $@).new
- $(call move-if-changed,$(notdir $@).new,$@)
new file mode 100644
@@ -0,0 +1,9 @@
+OBJS-y += handlereg.o
+
+AUTOINCS := $(XEN_INCLUDE)/_xentoolcore_list.h
+
+$(OBJS-y): $(AUTOINCS)
+
+$(XEN_INCLUDE)/_xentoolcore_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
+ $(PERL) $^ --prefix=xentoolcore >$(notdir $@).new
+ $(call move-if-changed,$(notdir $@).new,$@)
@@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 0
-OBJS-y += xtl_core.o
-OBJS-y += xtl_logger_stdio.o
+include Makefile.common
include $(XEN_ROOT)/tools/libs/libs.mk
new file mode 100644
@@ -0,0 +1,2 @@
+OBJS-y += xtl_core.o
+OBJS-y += xtl_logger_stdio.o
This new "Makefile.common" is intended to be used by both tools/ and stubdom/ build system without stubdom needed to use tools/ build system. It should contain the necessary list of objects and CFLAGS needed to build a static library. Change stubdom/ to check Makefile.common, for the linkfarm. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> --- stubdom/Makefile | 2 +- tools/libs/call/Makefile | 7 +- tools/libs/call/Makefile.common | 6 ++ tools/libs/ctrl/Makefile | 45 +----------- tools/libs/ctrl/Makefile.common | 44 ++++++++++++ tools/libs/devicemodel/Makefile | 7 +- tools/libs/devicemodel/Makefile.common | 6 ++ tools/libs/evtchn/Makefile | 7 +- tools/libs/evtchn/Makefile.common | 6 ++ tools/libs/foreignmemory/Makefile | 7 +- tools/libs/foreignmemory/Makefile.common | 6 ++ tools/libs/gnttab/Makefile | 9 +-- tools/libs/gnttab/Makefile.common | 8 +++ tools/libs/guest/Makefile | 90 +----------------------- tools/libs/guest/Makefile.common | 84 ++++++++++++++++++++++ tools/libs/toolcore/Makefile | 8 +-- tools/libs/toolcore/Makefile.common | 9 +++ tools/libs/toollog/Makefile | 3 +- tools/libs/toollog/Makefile.common | 2 + 19 files changed, 182 insertions(+), 174 deletions(-) create mode 100644 tools/libs/call/Makefile.common create mode 100644 tools/libs/ctrl/Makefile.common create mode 100644 tools/libs/devicemodel/Makefile.common create mode 100644 tools/libs/evtchn/Makefile.common create mode 100644 tools/libs/foreignmemory/Makefile.common create mode 100644 tools/libs/gnttab/Makefile.common create mode 100644 tools/libs/guest/Makefile.common create mode 100644 tools/libs/toolcore/Makefile.common create mode 100644 tools/libs/toollog/Makefile.common