I have a setup where make is going through a bunch of subdirectories and making inside those directories. I would like it to stop the build on a failure immediately. The code snippet below illustrates this. Can someone point me in the right direction on how the makefile should be set up or some documentation about building from a top level down through subdirectories?
SUBDIRS = \
test1 \
test2
all clean check :
@for dir in $(SUBDIRS); do \
if [ -d $$dir ]; then (cd $$dir; $(MAKE) $@) fi \
done