Commit a29e9fa7c40532562219f6886a1440fd60e2441c

Steffen Jaeckel 2017-08-28T15:56:30

add uninstall make-target [skip ci]

diff --git a/makefile b/makefile
index 0e305d6..14d8cda 100644
--- a/makefile
+++ b/makefile
@@ -88,6 +88,10 @@ install: $(LIBNAME)
 	install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)
 	install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
 
+uninstall:
+	rm $(DESTDIR)$(LIBPATH)/$(LIBNAME)
+	rm $(HEADERS_PUB:%=$(DESTDIR)$(INCPATH)/%)
+
 test: $(LIBNAME) demo/demo.o
 	$(CC) $(CFLAGS) demo/demo.o $(LIBNAME) $(LFLAGS) -o test
 
diff --git a/makefile.shared b/makefile.shared
index b92c1ea..be0c9d5 100644
--- a/makefile.shared
+++ b/makefile.shared
@@ -61,6 +61,11 @@ install: $(LIBNAME)
 	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
 	$(LT) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)