qrexec-lib: make it shared library

This commit is contained in:
Marek Marczykowski-Górecki 2014-02-07 05:29:59 +01:00
parent 113826aa1a
commit 516815a266
2 changed files with 18 additions and 9 deletions

View File

@ -1,20 +1,27 @@
CC=gcc CC=gcc
CFLAGS+=-I. -g -Wall -pie -fPIC -Wall CFLAGS+=-I. -g -Wall -pie -fPIC -Wextra
XENLIBS=-lxenctrl -lxenstore -lvchan
COMMONIOALL=ioall.o COMMONIOALL=ioall.o
SO_VER=1
LDFLAGS=-shared
all: libqrexec-utils.a libqubes-rpc-filecopy.a all: libqrexec-utils.so.$(SO_VER) libqubes-rpc-filecopy.so.$(SO_VER)
libqrexec-utils.a: unix-server.o ioall.o buffer.o write-stdin.o exec.o txrx-vchan.o libqrexec-utils.so.$(SO_VER): unix-server.o ioall.o buffer.o write-stdin.o exec.o txrx-vchan.o
libqubes-rpc-filecopy.a: ioall.o copy-file.o crc32.o unpack.o $(CC) $(LDFLAGS) -Wl,-soname,$@ -o $@ $^ $(XENLIBS)
libqubes-rpc-filecopy.so.$(SO_VER): ioall.o copy-file.o crc32.o unpack.o
$(CC) $(LDFLAGS) -Wl,-soname,$@ -o $@ $^
%.a: %.a:
$(AR) rcs $@ $^ $(AR) rcs $@ $^
clean: clean:
rm -f *.o *~ *.a rm -f *.o *~ *.a *.so.*
install: install:
mkdir -p $(DESTDIR)$(LIBDIR) mkdir -p $(DESTDIR)$(LIBDIR)
cp libqrexec-utils.a $(DESTDIR)$(LIBDIR) cp libqrexec-utils.so.$(SO_VER) $(DESTDIR)$(LIBDIR)
cp libqubes-rpc-filecopy.a $(DESTDIR)$(LIBDIR) ln -s libqrexec-utils.so.$(SO_VER) $(DESTDIR)$(LIBDIR)/libqrexec-utils.so
cp libqubes-rpc-filecopy.so.$(SO_VER) $(DESTDIR)$(LIBDIR)
ln -s libqubes-rpc-filecopy.so.$(SO_VER) $(DESTDIR)$(LIBDIR)/libqubes-rpc-filecopy.so
mkdir -p $(DESTDIR)$(INCLUDEDIR) mkdir -p $(DESTDIR)$(INCLUDEDIR)
cp libqrexec-utils.h $(DESTDIR)$(INCLUDEDIR) cp libqrexec-utils.h $(DESTDIR)$(INCLUDEDIR)
cp libqubes-rpc-filecopy.h $(DESTDIR)$(INCLUDEDIR) cp libqubes-rpc-filecopy.h $(DESTDIR)$(INCLUDEDIR)

View File

@ -66,8 +66,10 @@ rm -rf $RPM_BUILD_ROOT
/usr/include/libqrexec-utils.h /usr/include/libqrexec-utils.h
/usr/include/libqubes-rpc-filecopy.h /usr/include/libqubes-rpc-filecopy.h
/usr/include/qrexec.h /usr/include/qrexec.h
%{_libdir}/libqrexec-utils.a %{_libdir}/libqrexec-utils.so
%{_libdir}/libqubes-rpc-filecopy.a %{_libdir}/libqubes-rpc-filecopy.so
%{_libdir}/libqrexec-utils.so.1
%{_libdir}/libqubes-rpc-filecopy.so.1
%changelog %changelog