[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH XEN v3 02/22] tools: Refactor "xentoollog" into its own library



On 07/10/15 15:15, Ian Campbell wrote:
> diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
> new file mode 100644
> index 0000000..bd12403
> --- /dev/null
> +++ b/tools/libs/toollog/Makefile
> @@ -0,0 +1,59 @@
> +XEN_ROOT = $(CURDIR)/../../..
> +include $(XEN_ROOT)/tools/Rules.mk
> +
> +MAJOR        = 1
> +MINOR        = 0
> +SHLIB_LDFLAGS += -Wl,--version-script=libxentoollog.map
> +
> +CFLAGS       += -Werror -Wmissing-prototypes
> +CFLAGS       += -I./include
> +
> +SRCS-y       += xtl_core.c
> +SRCS-y       += xtl_logger_stdio.c
> +
> +LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
> +PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
> +
> +LIB := libxentoollog.a
> +ifneq ($(nosharedlibs),y)
> +LIB += libxentoollog.so
> +endif
> +
> +.PHONY: all
> +all: build
> +
> +.PHONY: build
> +build:
> +     $(MAKE) libs
> +
> +.PHONY: libs
> +libs: $(LIB)
> +
> +libxentoollog.a: $(LIB_OBJS)
> +     $(AR) rc $@ $^
> +
> +libxentoollog.so: libxentoollog.so.$(MAJOR)
> +     $(SYMLINK_SHLIB) $< $@
> +libxentoollog.so.$(MAJOR): libxentoollog.so.$(MAJOR).$(MINOR)
> +     $(SYMLINK_SHLIB) $< $@
> +
> +libxentoollog.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxentoollog.map
> +     $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxentoollog.so.$(MAJOR) 
> $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(APPEND_LDFLAGS)
> +
> +.PHONY: install
> +install: build
> +     $(INSTALL_DIR) $(DESTDIR)$(libdir)
> +     $(INSTALL_DIR) $(DESTDIR)$(includedir)
> +     $(INSTALL_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
> +     $(INSTALL_DATA) libxentoollog.a $(DESTDIR)$(libdir)
> +     $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) 
> $(DESTDIR)$(libdir)/libxentoollog.so.$(MAJOR)
> +     $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR) 
> $(DESTDIR)$(libdir)/libxentoollog.so

Installation of all .so's needs to be conditional on $(nosharedlibs) to
match the condition in the build rule.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.