aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'`