diff options
Diffstat (limited to 'lib/am/progs.am')
-rw-r--r-- | lib/am/progs.am | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/lib/am/progs.am b/lib/am/progs.am index 3dcb55e5e..9fb5cd961 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -84,18 +84,17 @@ if %?INSTALL% .PHONY uninstall-am: uninstall-%DIR%PROGRAMS uninstall-%DIR%PROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(%DIR%_PROGRAMS)'; test -n "$(%NDIR%dir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ -## Remove any leading directory before applying $(transform), -## but keep the directory part in the hold buffer, in order to -## reapply it again afterwards in the nobase case. Append $(EXEEXT). - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ -?!BASE? -e 'x;s,[^/]*$$,,;G;s,\n,,' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files +## The need to apply $(transform) is quite tricky, and forces us to +## go though a $(shell) invocation. + $(call am.uninst.cmd,$(%NDIR%dir),$(shell \ + list='$(%DIR%_PROGRAMS)'; for p in $$list; do echo "$$p"; done | \ +## Remove any leading directory before applying $(transform), but keep +## the directory part in the hold buffer, in order to reapply it again +## afterwards in the nobase case. Append $(EXEEXT). + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ +?!BASE? -e 'x;s,[^/]*$$,,;G;s,\n,,' \ + )) endif %?INSTALL% @@ -103,9 +102,7 @@ endif %?INSTALL% ## Cleaning. ## ## ---------- ## -.PHONY clean-am: clean-%DIR%PROGRAMS -clean-%DIR%PROGRAMS: -?!LIBTOOL? -test -z "$(%DIR%_PROGRAMS)" || rm -f $(%DIR%_PROGRAMS) +am.clean.normal.f += $(%DIR%_PROGRAMS) ## Under Cygwin, we build 'program$(EXEEXT)'. However, if this ## program uses a Libtool library, Libtool will move it in ## '_libs/program$(EXEEXT)' and create a 'program' wrapper (without @@ -114,14 +111,7 @@ clean-%DIR%PROGRAMS: ## Cleaning the '_libs/' or '.libs/' directory is done from clean-libtool. ## FIXME: In the future (i.e., when it works) it would be nice to delegate ## this task to "libtool --mode=clean". -?LIBTOOL? @list='$(%DIR%_PROGRAMS)'; test -n "$$list" || exit 0; \ -?LIBTOOL? echo " rm -f" $$list; \ -?LIBTOOL? rm -f $$list || exit $$?; \ -?LIBTOOL? test -n "$(EXEEXT)" || exit 0; \ -?LIBTOOL? list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ -?LIBTOOL? echo " rm -f" $$list; \ -?LIBTOOL? rm -f $$list - +?LIBTOOL?am.clean.normal.f += $(if $(EXEEXT),$(patsubst %$(EXEEXT),%,$(%DIR%_PROGRAMS))) ## ---------- ## ## Checking. ## |