Merge branch 'maint'
[platform/upstream/automake.git] / lib / am / ltlib.am
index 65210c1..10ce7ce 100644 (file)
@@ -105,12 +105,14 @@ endif %?INSTALL%
 .PHONY clean-am: clean-%DIR%LTLIBRARIES
 clean-%DIR%LTLIBRARIES:
        -test -z "$(%DIR%_LTLIBRARIES)" || rm -f $(%DIR%_LTLIBRARIES)
-## `so_locations' files are created by some linkers (IRIX, OSF) when
+## 'so_locations' files are created by some linkers (IRIX, OSF) when
 ## building a shared object.  Libtool places these files in the
 ## directory where the shared object is created.
-       @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
+       @list='$(%DIR%_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }