summaryrefslogtreecommitdiff
path: root/lib/am/scripts.am
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2002-07-20 15:11:50 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2002-07-20 15:11:50 +0000
commit7481f43685dcb69d9269951fe2edb9140e86124b (patch)
treeeae9253cde1c491350f6b6ba86f8b363872bcdac /lib/am/scripts.am
parent74d9ca82d7a4cd9c6309d5d4ab3eea06e96717a3 (diff)
downloadautomake-7481f43685dcb69d9269951fe2edb9140e86124b.tar.gz
* lib/am/progs.am (install-%DIR%PROGRAMS, uninstall-%DIR%PROGRAMS):
Always strip the directory part before applying $(transform), even for nobase_ targets. * lib/am/scripts.am (install-%DIR%SCRIPTS, uninstall-%DIR%SCRIPTS): Likewise. * tests/nobase.test: Use --program-prefix while testing nobase support.
Diffstat (limited to 'lib/am/scripts.am')
-rw-r--r--lib/am/scripts.am17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/am/scripts.am b/lib/am/scripts.am
index 9d4ea7ba0..b99ba6860 100644
--- a/lib/am/scripts.am
+++ b/lib/am/scripts.am
@@ -36,13 +36,15 @@ install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
@list='$(%DIR%_SCRIPTS)'; for p in $$list; do \
## A file can be in the source directory or the build directory.
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
## If the _SCRIPTS variable has an entry like foo/bar, install it as
## $(destdir)/bar, not $(destdir)/foo/bar. The user can make a
## new dir variable or use a nobase_ target for the latter case.
-?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \
-?!BASE? f="$$p"; \
- if test -f $$d$$p; then \
- f="`echo $$f|sed '$(transform)'`"; \
+## However in all cases $(transform) applies only to the basename,
+## so we have to strip the directory part.
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+## Prepend the directory part if nobase_ is used.
+?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
echo " $(%DIR%SCRIPT_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
$(%DIR%SCRIPT_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \
else :; fi; \
@@ -59,9 +61,10 @@ if %?INSTALL%
uninstall-%DIR%SCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_SCRIPTS)'; for p in $$list; do \
-?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \
-?!BASE? f="$$p"; \
- f="`echo $$f|sed '$(transform)'`"; \
+## Remove any leading directory before applying $(transform).
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+## Prepend the directory part if nobase_ is used.
+?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \
rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \
done