Merge pull request #114 from orbea/libtool

makefile.shared: Respect LIBTOOL.
This commit is contained in:
Steffen Jaeckel 2018-05-20 14:21:15 +02:00 committed by GitHub
commit 9f7e1a3cb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -10,14 +10,14 @@ endif
include makefile_include.mk include makefile_include.mk
ifndef LT ifndef LIBTOOL
ifeq ($(PLATFORM), Darwin) ifeq ($(PLATFORM), Darwin)
LT:=glibtool LIBTOOL:=glibtool
else else
LT:=libtool LIBTOOL:=libtool
endif endif
endif endif
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC)
LCOV_ARGS=--directory .libs --directory . LCOV_ARGS=--directory .libs --directory .
@ -57,32 +57,32 @@ objs: $(OBJECTS)
LOBJECTS = $(OBJECTS:.o=.lo) LOBJECTS = $(OBJECTS:.o=.lo)
$(LIBNAME): $(OBJECTS) $(LIBNAME): $(OBJECTS)
$(LT) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO)
install: $(LIBNAME) install: $(LIBNAME)
install -d $(DESTDIR)$(LIBPATH) install -d $(DESTDIR)$(LIBPATH)
install -d $(DESTDIR)$(INCPATH) install -d $(DESTDIR)$(INCPATH)
$(LT) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME) $(LIBTOOL) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH) install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtommath.pc.in > libtommath.pc sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtommath.pc.in > libtommath.pc
install -d $(DESTDIR)$(LIBPATH)/pkgconfig install -d $(DESTDIR)$(LIBPATH)/pkgconfig
install -m 644 libtommath.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ install -m 644 libtommath.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
uninstall: uninstall:
$(LT) --mode=uninstall rm $(DESTDIR)$(LIBPATH)/$(LIBNAME) $(LIBTOOL) --mode=uninstall rm $(DESTDIR)$(LIBPATH)/$(LIBNAME)
rm $(HEADERS_PUB:%=$(DESTDIR)$(INCPATH)/%) rm $(HEADERS_PUB:%=$(DESTDIR)$(INCPATH)/%)
rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtommath.pc rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtommath.pc
test: $(LIBNAME) demo/demo.o test: $(LIBNAME) demo/demo.o
$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o $(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o
$(LT) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)
test_standalone: $(LIBNAME) demo/demo.o test_standalone: $(LIBNAME) demo/demo.o
$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o $(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o
$(LT) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)
mtest: mtest:
cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest
timing: $(LIBNAME) demo/timing.c timing: $(LIBNAME) demo/timing.c
$(LT) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o timing $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o timing