From: Guillem Jover Date: Sun, 12 Apr 2020 01:58:12 +0000 (+0200) Subject: [PATCH libaio 09/11] build: Fix DESTDIR handling X-Git-Tag: archive/raspbian/0.3.112-13+rpi1~1^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=23718285376ceeb8679ab1adb06258501583fcc8;p=libaio.git [PATCH libaio 09/11] build: Fix DESTDIR handling The convention for DESTDIR is that it is only prefixed during the install target. In this case we postpone that to the inner Makefile so that it can be invoked directly while preserving the expected semantics. Signed-off-by: Guillem Jover Gbp-Pq: Name 0009-build-Fix-DESTDIR-handling.patch --- diff --git a/Makefile b/Makefile index c1fb831..e48b520 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE)) TAG = $(NAME)-$(VERSION) RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm") +DESTDIR= prefix=/usr includedir=$(prefix)/include libdir=$(prefix)/lib @@ -14,7 +15,12 @@ all: @$(MAKE) -C src install: - @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir) + @$(MAKE) -C src install \ + DESTDIR=$(DESTDIR) \ + prefix=$(prefix) \ + includedir=$(includedir) \ + libdir=$(libdir) \ + $(nil) check: @$(MAKE) -C harness check diff --git a/src/Makefile b/src/Makefile index 37ae219..a53c43c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,3 +1,4 @@ +DESTDIR= prefix=/usr includedir=$(prefix)/include libdir=$(prefix)/lib @@ -58,12 +59,12 @@ $(libname): $(libaio_sobjs) libaio.map $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS) install: $(all_targets) - install -D -m 644 libaio.h $(includedir)/libaio.h - install -D -m 644 libaio.a $(libdir)/libaio.a + install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h + install -D -m 644 libaio.a $(DESTDIR)$(libdir)/libaio.a ifeq ($(ENABLE_SHARED),1) - install -D -m 755 $(libname) $(libdir)/$(libname) - ln -sf $(libname) $(libdir)/$(soname) - ln -sf $(libname) $(libdir)/libaio.so + install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname) + ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname) + ln -sf $(libname) $(DESTDIR)$(libdir)/libaio.so endif $(libaio_objs): libaio.h