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