1From 060b9b4147f6e5ff386a8b017796118d783e59fa Mon Sep 17 00:00:00 2001 2From: Matt Weber <matthew.weber@rockwellcollins.com> 3Date: Tue, 22 Oct 2019 12:44:30 -0500 4Subject: [PATCH] Makefile: cleanup install for rebuilds 5 6Support the ability to rebuild and redeploy without a clean. This 7required some force linking and man archive creation. 8 9Provide the ability to override the stripping of the shared lib for 10cases where a embedded target build may want to control stripping 11or provide cross arch tools. 12 13Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> 14Signed-off-by: Stephan Mueller <smueller@chronox.de> 15[Retrieved from: 16https://github.com/smuellerDD/jitterentropy-library/commit/060b9b4147f6e5ff386a8b017796118d783e59fa] 17Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 18--- 19 Makefile | 10 ++++++---- 20 1 file changed, 6 insertions(+), 4 deletions(-) 21 22diff --git a/Makefile b/Makefile 23index 4ff069b..2e78607 100644 24--- a/Makefile 25+++ b/Makefile 26@@ -14,6 +14,8 @@ LIBDIR := lib 27 # include target directory 28 INCDIR := include 29 30+INSTALL_STRIP ?= install -s 31+ 32 NAME := jitterentropy 33 LIBMAJOR=$(shell cat jitterentropy-base.c | grep define | grep MAJVERSION | awk '{print $$3}') 34 LIBMINOR=$(shell cat jitterentropy-base.c | grep define | grep MINVERSION | awk '{print $$3}') 35@@ -58,15 +60,15 @@ cppcheck: 36 install: 37 install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man3 38 install -m 644 doc/$(NAME).3 $(DESTDIR)$(PREFIX)/share/man/man3/ 39- gzip -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3 40+ gzip -f -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3 41 install -d -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR) 42- install -m 0755 -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/ 43+ $(INSTALL_STRIP) -m 0755 lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/ 44 install -d -m 0755 $(DESTDIR)$(PREFIX)/$(INCDIR) 45 install -m 0644 jitterentropy.h $(DESTDIR)$(PREFIX)/$(INCDIR)/ 46 install -m 0644 jitterentropy-base-user.h $(DESTDIR)$(PREFIX)/$(INCDIR)/ 47 $(RM) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR) 48- ln -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR) 49- ln -s lib$(NAME).so.$(LIBMAJOR) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so 50+ ln -sf lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR) 51+ ln -sf lib$(NAME).so.$(LIBMAJOR) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so 52 53 clean: 54 @- $(RM) $(NAME) 55