aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-29 18:36:57 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-29 18:36:57 +0200
commit657104d7ff9ced7908a2dcf398ccee6b06fac3a6 (patch)
treeae740649dc87e3658f2a588783df271733a5ec5d /Makefile
parentbf32d48b0dce56f9fa1a57d1172b037dc284b3cf (diff)
downloadxutil-657104d7ff9ced7908a2dcf398ccee6b06fac3a6.tar.gz
Makefile: Fix link handling
Yes, it is a bit complex. But it works.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 20 insertions, 1 deletions
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'`