diff libtommath/makefile.shared @ 1470:8bba51a55704

Update to libtommath v1.0.1
author Matt Johnston <matt@ucc.asn.au>
date Thu, 08 Feb 2018 23:11:40 +0800
parents 60fc6476e044
children
line wrap: on
line diff
--- a/libtommath/makefile.shared	Thu Feb 08 22:21:47 2018 +0800
+++ b/libtommath/makefile.shared	Thu Feb 08 23:11:40 2018 +0800
@@ -7,9 +7,16 @@
    LIBNAME=libtommath.la
 endif
 
-include makefile.include
+include makefile_include.mk
+
 
-LT	?= libtool
+ifndef LT
+  ifeq ($(PLATFORM), Darwin)
+    LT:=glibtool
+  else
+    LT:=libtool
+  endif
+endif
 LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
 
 LCOV_ARGS=--directory .libs --directory .
@@ -47,14 +54,24 @@
 .c.o:
 	$(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $<
 
+LOBJECTS = $(OBJECTS:.o=.lo)
+
 $(LIBNAME):  $(OBJECTS)
-	$(LT) --mode=link --tag=CC $(CC) $(LDFLAGS) *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO)
+	$(LT) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO)
 
 install: $(LIBNAME)
 	install -d $(DESTDIR)$(LIBPATH)
 	install -d $(DESTDIR)$(INCPATH)
-	$(LT) --mode=install install -c $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
+	$(LT) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
 	install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
+	sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtommath.pc.in > libtommath.pc
+	install -d $(DESTDIR)$(LIBPATH)/pkgconfig
+	install -m 644 libtommath.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
+
+uninstall:
+	$(LT) --mode=uninstall rm $(DESTDIR)$(LIBPATH)/$(LIBNAME)
+	rm $(HEADERS_PUB:%=$(DESTDIR)$(INCPATH)/%)
+	rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtommath.pc
 
 test: $(LIBNAME) demo/demo.o
 	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o