Hi Paul!
Paul Jarc wrote:
> Bob Proulx wrote:
> > depend all clean distclean:
> > rm -f make.log ; \
> > for d in $(DIRS) ; do \
> >$(MAKE) -C $$d $@ ; \
> >if [ $$? -ne 0 ]; then \
> > echo "make failed with error $$?"; \
> > exit 1; \
> >fi; \
> > done | tee -a make.log
Bob Proulx wrote:
> ElChino wrote:
>>$(MAKE) -C $$d $@ | tee -a make.log ; \
>
>> But the 'exit' isn't called when $(MAKE) fails on a target.
>> Anybody see the problem?
>
> If tee exits last then it will set the $? exit code.
That will happen regardless of what order the commands exit. It's
"Bob Proulx" wrote:
If tee exits last then it will set the $? exit code. I didn't try it
but I think that is your problem. I didn't try it so I could be wrong.
You were right.
depend all clean distclean:
rm -f make.log ; \
for d in $(DIRS) ; do \
$(MAKE) -C $$d $@ ; \
if [ $$? -ne 0 ]
ElChino wrote:
>$(MAKE) -C $$d $@ | tee -a make.log ; \
> But the 'exit' isn't called when $(MAKE) fails on a target.
> Anybody see the problem?
If tee exits last then it will set the $? exit code. I didn't try it
but I think that is your problem. I didn't try it so I could be wrong.
Havin