stubdom: introduce xenlibs.mk

This new makefile will be used to build libraries that provides
"Makefile.common".

At some point, we will be converting Makefile in tools/ to "subdirmk"
and stubdom build will not be able to use those new makefiles, so we
will put the necessary information for stubdom to build the xen
libraries into a new Makefile.common and xenlibs.mk will use it.
We only need to build static libraries and don't need anything else.

The check for the presence of "Makefile.common" will go aways once
there is one for all libraries used by stubdom build.

Also remove DESTDIR= from "clean" targets, we don't do installation in
this recipe so the value of DESTDIR doesn't matter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
Anthony PERARD authored and Julien Grall committed 2022-06-16 16:58:50 +01:00
1 parent 9ae030da5c
commit 1489a2a084
2 files changed
+20 -2

No files matched your search

+7 -2
View File
@@ -346,6 +346,7 @@ define do_links
cd $(dir $@); \
ln -sf $(dir $<)include/*.h include/; \
ln -sf $(dir $<)*.[ch] .; \
[ -e $(dir $<)Makefile.common ] && ln -sf $(dir $<)Makefile.common . ||:; \
ln -sf $(dir $<)Makefile .
touch $@
endef
@@ -355,10 +356,14 @@ define BUILD_lib
libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a
libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1))
libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) .phony
CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y -C $$(@D) $$(@F)
CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) CONFIG_LIBXC_MINIOS=y $$(if $$(wildcard $$(@D)/Makefile.common),-f $(CURDIR)/xenlibs.mk) -C $$(@D) $$(@F)
clean-libxen$(1):
[ ! -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ] || $$(MAKE) DESTDIR= -C libs-$$(XEN_TARGET_ARCH)/$(1) clean
if [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile.common ]; then \
$$(MAKE) -f $(CURDIR)/xenlibs.mk -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
elif [ -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ]; then \
$$(MAKE) -C libs-$$(XEN_TARGET_ARCH)/$(1) clean; \
fi
libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile
$$(do_links)
+13
View File
@@ -0,0 +1,13 @@
include $(XEN_ROOT)/tools/Rules.mk
include Makefile.common
LIBNAME := $(notdir $(CURDIR))
FILENAME_$(LIBNAME) ?= xen$(LIBNAME)
LIB_FILE_NAME = $(FILENAME_$(LIBNAME))
lib$(LIB_FILE_NAME).a: $(OBJS-y)
$(AR) rc $@ $^
clean::
rm -f $(OBJS-y) lib$(LIB_FILE_NAME).a
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.