From 657104d7ff9ced7908a2dcf398ccee6b06fac3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 29 Jun 2021 18:36:57 +0200 Subject: Makefile: Fix link handling Yes, it is a bit complex. But it works. --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a783668..20f5c13 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,22 @@ +EXEC != ls -l | perl -ne ' \ + if (/^-\S*x\s/) { \ + s/.* //; \ + print; \ + $$x{$$_} = 1; \ + } elsif (/^l\S*x\s/) { \ + s/ -> (.*)//; \ + $$d = $$1; \ + s/.* //; \ + push @ln, [$$_ => "$$d\n"] \ + } \ + END { \ + for (@ln) { \ + print $$_->[0] if $$x{$$_->[1]}; \ + } \ + } \ +' + install: install -m 644 *.1 /usr/local/man/man1/ - install `ls -l | perl -ne 'next if not /^[-l]\S*x\s/; s/ -> .*//; s/.* //; print'` /usr/local/bin + install $(EXEC) /usr/local/bin + ./re! `echo $(EXEC) | sed -E 's,^| ,&/usr/local/bin/,g'` -- cgit v1.2.3