836b73dcf9a90141ad0923009f03d2494fdd18ca
markd
  Tue Apr 22 15:17:05 2025 -0700
Replaced shell loops in build paths of makefile to use rules.  This should address issues where errors in some rules are not reported (#35339) and also increase speed of builds using multiple cores

diff --git src/hg/txGraph/makefile src/hg/txGraph/makefile
index be860af9612..fbfd342125d 100644
--- src/hg/txGraph/makefile
+++ src/hg/txGraph/makefile
@@ -1,47 +1,35 @@
 kentSrc = ../..
 include ../../inc/common.mk
 
 L += -lm
 MYLIBDIR = ../../lib/${MACHTYPE}
 MYLIBS =  ${MYLIBDIR}/jkweb.a
 
-all:
-	@for D in ${DIRS} x; do \
-	  if test "$$D" != "x" ; then \
-	    ( cd $$D && echo $$D && ${MAKE}  ) ;\
-	    x=$$? ; if [ $$x -ne 0 ]; then exit $$x ; fi \
-	    fi ;\
-	done
-
 DIRS = \
     agxToTxg \
     bedToTxEdges \
     txAbFragFind \
     txBedToGraph \
     txOrtho \
     txPslFilter \
     txPslToBed \
     txReadRa \
     txWalk \
     txgAddEvidence \
     txgAnalyze \
     txgGoodEdges \
     txgToAgx \
     txgToXml \
     txgTrim
 
-clean:
-	@for D in ${DIRS} x; do \
-	  if test "$$D" != "x" ; then \
-	    ( cd $$D && echo $$D && ${MAKE} clean ) ;\
-	    x=$$? ; if [ $$x -ne 0 ]; then exit $$x ; fi \
-	    fi ;\
-	done
+all: ${DIRS:%=%_all}
+%_all:
+	${MAKE} -C $*
+
+clean: ${DIRS:%=%_clean}
+%_clean:
+	${MAKE} -C $* clean
 
-compile:
-	@for D in ${DIRS} x; do \
-	  if test "$$D" != "x" ; then \
-	    ( cd $$D && echo $$D && ${MAKE} compile ) ;\
-	    x=$$? ; if [ $$x -ne 0 ]; then exit $$x ; fi \
-	    fi ;\
-	done
+compile: ${DIRS:%=%_compile}
+%_compile:
+	${MAKE} -C $* compile