]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Check that noinst_PROGRAMS and noinst_LIBRARIES are not empty strings
authorTom Hughes <tom@compton.nu>
Mon, 19 Dec 2005 12:48:03 +0000 (12:48 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 19 Dec 2005 12:48:03 +0000 (12:48 +0000)
before trying to run a for loop over them as some versions of bash can't
cope with being asked to loop over an empty list.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5373

Makefile.install.am

index 38d7fff7892d6a02b2d2bca553dd699a6bfe2914..77887df691fae6062d989111609040809188eb75 100644 (file)
 # It then copies libcoregrind.a and libvex.a to the right places.
 
 install-exec-local:
-       for f in $(noinst_PROGRAMS); do \
-         p=`echo $$f | sed -e 's/^[^-]*-//' -e 's/\..*$$//'`; \
-         n=`echo $$f | sed -e 's/-[^-]\{1,\}-[^-.]\{1,\}//'`; \
-         $(mkinstalldirs) $(DESTDIR)$(valdir)/$$p; \
-         $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$p/$$n; \
-       done ; \
-       for f in $(noinst_LIBRARIES); do \
-         if expr match $$f libcoregrind_ > /dev/null ; then \
-           pU=`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \
-           pD=`echo $$pU | sed -e 's/_/-/g'` ; \
-           $(INSTALL_DATA) $$f $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \
-           $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a $(DESTDIR)$(valdir)/$$pD/libvex.a ; \
-         fi ; \
-       done
+       if [ -n "$(noinst_PROGRAMS)" ] ; then \
+         for f in $(noinst_PROGRAMS); do \
+           p=`echo $$f | sed -e 's/^[^-]*-//' -e 's/\..*$$//'`; \
+           n=`echo $$f | sed -e 's/-[^-]\{1,\}-[^-.]\{1,\}//'`; \
+           $(mkinstalldirs) $(DESTDIR)$(valdir)/$$p; \
+           $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$p/$$n; \
+         done ; \
+       fi ; \
+       if [ -n "$(noinst_LIBRARIES)" ] ; then \
+         for f in $(noinst_LIBRARIES); do \
+           if expr match $$f libcoregrind_ > /dev/null ; then \
+             pU=`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \
+             pD=`echo $$pU | sed -e 's/_/-/g'` ; \
+             $(INSTALL_DATA) $$f $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \
+             $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a $(DESTDIR)$(valdir)/$$pD/libvex.a ; \
+           fi ; \
+         done ; \
+       fi