Hi,

I am using GNU make 3.79 on a Solaris 2.5.1.

Consider the following Makefile fragment:

SUBDIRS = ok-dir-1 bad-dir ok-dir-2 

all.simple:
        $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) all;)

The all targets in ok-dir-1 and ok-dir-2 return an exit status of 0.
The bad-dir all target exits with an error.
However, the top level all target returns success.

I would like to prevent it.
If any of the directories return false, I would like the top level make
to return false.

Is the following a good idea?

all:
        status=0;\
        $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) all;\
        state=$$?;\
        if test $$state -ne 0; then status=$$state; fi;)\
        exit $$status

Are there other ways?

Regards
Sankar

-- 
Sankaranarayanan K. V.          | [EMAIL PROTECTED]
Motorola India Electronics Ltd  | http://www.mot.com/miel
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to