Files
xen/tools/libs/util/Makefile
T
Anthony PERARD 98d95437ed libs: Fix auto-generation of version-script for unstable libs
When there isn't a version-script for a shared library (like for
unstable libs), we create one based on the current Xen version. But
that version-script became out-of-date as soon as Xen's version
changes and make as no way to regenerate the version-script on
rebuild.

For unstable libs, we only needs the symver to be different from a
previous release of Xen. There's an option "--default-symver" which
allow to use the soname as symver and as the soname have the Xen
release version, it will be different for every release. With
--default-symver we don't need to generate a version-script.

But we also need to know if there's already an existing version script
, for that we introduce $(version-script) to be used to point to the
path of the existing script. (Guessing if a version script exist for a
stable library with for example $(wildcard) won't work as a file will
exist when building the library without this patch.)

We don't need the version-script unless we are making the shared
library so it is removed from the "all" target.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2023-02-07 15:17:53 +01:00

50 lines
1.1 KiB
Makefile

XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
OBJS-y += libxlu_cfg_y.o
OBJS-y += libxlu_cfg_l.o
OBJS-y += libxlu_cfg.o
OBJS-y += libxlu_disk_l.o
OBJS-y += libxlu_disk.o
OBJS-y += libxlu_vif.o
OBJS-y += libxlu_pci.o
CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-Wno-declaration-after-statement -Wformat-nonliteral
CFLAGS += $(CFLAGS_libxenctrl)
CFLAGS += $(PTHREAD_CFLAGS)
LDFLAGS += $(PTHREAD_LDFLAGS)
ifeq ($(FLEX),)
%.c %.h:: %.l
$(warning Flex is needed to rebuild some libxl parsers and \
scanners, please install it and rerun configure)
endif
ifeq ($(BISON),)
%.c %.h:: %.y
$(warning Bison is needed to rebuild some libxl parsers and \
scanners, please install it and rerun configure)
endif
AUTOINCS = libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h
LIBHEADER := libxlutil.h
PKG_CONFIG_NAME := Xlutil
PKG_CONFIG_DESC := The xl utility library for Xen hypervisor
NO_HEADERS_CHK := y
include $(XEN_ROOT)/tools/libs/libs.mk
$(OBJS-y) $(PIC_OBJS): $(AUTOINCS)
%.c %.h:: %.y
@rm -f $*.[ch]
$(BISON) --output=$*.c $<
%.c %.h:: %.l
@rm -f $*.[ch]
$(FLEX) --header-file=$*.h --outfile=$*.c $<