summaryrefslogtreecommitdiffstats
path: root/libtommath/makefile.shared
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/makefile.shared')
-rw-r--r--libtommath/makefile.shared25
1 files changed, 21 insertions, 4 deletions
diff --git a/libtommath/makefile.shared b/libtommath/makefile.shared
index 559720e..67213a2 100644
--- a/libtommath/makefile.shared
+++ b/libtommath/makefile.shared
@@ -7,9 +7,16 @@ ifndef LIBNAME
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 @@ objs: $(OBJECTS)
.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