From: Helmut Grohne <helmut@subdivi.de>
Date: Sun, 10 Jun 2018 19:56:36 +0200
Subject: make-package-cross-buildable

libkarma fails to cross build from source, because it fails relinking
the library during make install. This is because it uses the build
architecture compiler there as dh_auto_install (unlike dh_auto_build)
does not pass cross compilers along. This relinking is entirely
unnecessary though and is due to depending on $(LIBDIR) which is always
modified. Turning that dependency into an order-only dependency avoids
the unnecessary relinking and thus makes libkarma cross buildable. It
also builds slightly faster.

Last-Update: 2019-01-01
Bug-Debian: https://bugs.debian.org/901265
---
 src/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 16d698c..42a7755 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -57,17 +57,17 @@ OBJS = $(SRCS:.c=.o)
 $(LIBDIR):
 	@[ -d $(LIBDIR) ] || mkdir -p $(LIBDIR) > /dev/null 2>&1
 
-$(LIBDIR)/$(TARGET).a: $(OBJS) $(LIBDIR)
+$(LIBDIR)/$(TARGET).a: $(OBJS) | $(LIBDIR)
 	$(AR) r $(LIBDIR)/$(TARGET).a $(OBJS)
 	$(RANLIB) $(LIBDIR)/$(TARGET).a
 
-$(LIBDIR)/$(OUT_VERSION): $(OBJS) $(LIBDIR)
+$(LIBDIR)/$(OUT_VERSION): $(OBJS) | $(LIBDIR)
 	$(CC) $(LDFLAGS) $(OBJS) $(CFLAGS) -o $(LIBDIR)/$(OUT_VERSION) $(LIBS)
 
-$(LIBDIR)/$(OUT_MAJOR): $(LIBDIR)/$(OUT_VERSION) $(LIBDIR)
+$(LIBDIR)/$(OUT_MAJOR): $(LIBDIR)/$(OUT_VERSION) | $(LIBDIR)
 	$(LN_S) $(OUT_VERSION) $(LIBDIR)/$(OUT_MAJOR)
 
-$(LIBDIR)/$(OUT_BASE): $(LIBDIR)/$(OUT_VERSION) $(LIBDIR)
+$(LIBDIR)/$(OUT_BASE): $(LIBDIR)/$(OUT_VERSION) | $(LIBDIR)
 	$(LN_S) $(OUT_VERSION) $(LIBDIR)/$(OUT_BASE)
 
 shared-lib-stamp: $(LIBDIR)/$(OUT_VERSION) $(LIBDIR)/$(OUT_MAJOR) $(LIBDIR)/$(OUT_BASE)
