aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-09 21:19:33 +0100
committerMattias Andrée <maandree@kth.se>2019-02-09 21:19:33 +0100
commita12c0b13c8d1a18f2254545c746dd1a85d4b91ab (patch)
tree2fce2070b278f4aa47a0932209bfc9aec86c2208 /Makefile
parentUpdate makefile (diff)
downloadlibsha2-a12c0b13c8d1a18f2254545c746dd1a85d4b91ab.tar.gz
libsha2-a12c0b13c8d1a18f2254545c746dd1a85d4b91ab.tar.bz2
libsha2-a12c0b13c8d1a18f2254545c746dd1a85d4b91ab.tar.xz
Add install and uninstall rules to Makefile
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 8d8b2f5..41d351f 100644
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,31 @@ libsha2.a: $(OBJ)
$(AR) rc $@ $?
$(AR) -s $@
+install:
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/libsha2"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man0"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man3"
+ cp -- libsha2.a "$(DESTDIR)$(PREFIX)/lib"
+ cp -- libsha2.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libsha2.$(LIBEXT).$(LIB_MAJOR).$(LIB_MINOR)"
+ ln -sf -- "libsha2.$(LIBEXT).$(LIB_MAJOR).$(LIB_MINOR)" "$(DESTDIR)$(PREFIX)/lib/libsha2.$(LIBEXT).$(LIB_MAJOR)"
+ ln -sf -- "libsha2.$(LIBEXT).$(LIB_MAJOR)" "$(DESTDIR)$(PREFIX)/lib/libsha2.$(LIBEXT)"
+ cp -- libsha2.h "$(DESTDIR)$(PREFIX)/include"
+ cp -- $(MAN0) "$(DESTDIR)$(MANPREFIX)/man0"
+ cp -- $(MAN3) "$(DESTDIR)$(MANPREFIX)/man3"
+ cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/libsha2"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsha2.a"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsha2.$(LIBEXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsha2.$(LIBEXT).$(LIB_MAJOR)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsha2.$(LIBEXT).$(LIB_MAJOR).$(LIB_MINOR)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/include/libsha2.h"
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man0" && rm -f -- $(MAN0)
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man3" && rm -f -- $(MAN3)
+ -rm -rf -- "$(DESTDIR)$(PREFIX)/share/licenses/libsha2"
+
clean:
-rm -f -- *.o *.lo *.su *.a *.so