a make question

Greg Strockbine gregs at well.sf.ca.us
Tue Feb 26 03:46:28 AEST 1991


Here is a 'make' question.
I run a make at a top level directory to do a link.  Before the link
is done make descends into 2 sub directories and builds libraries
needed for the link.  So far so good.  My problem is, if one of the
libraries fails to build how do I abort the link?  Do I check the
return code from the makes?  If the first library does not build I
would like 'make' to still try to build the second library.

                         1550
                           |   (make link)
                    +------+------+
                    |             |
                  comn           pdbb
                  (lib1)         (lib2)

relevant parts of Makefile extracted below (this is gnu make):
---------------------

SUBDIRS = pdbb comn

link: SubDirs
	$(LD) -c $(LDCMD) -o $(LN).X -H $(LN).L $(LDFLAGS)  > $(LN).map

SubDirs: 
	@echo "Checking subdirectories..."
	@for i in $(SUBDIRS);do \
		echo "---"$$i"---";\
		(cd $$i;$(MAKE);)\
	done;\
	echo "---Done checking subdirectories---";

----------------------------
thanx in advance,
greg strockbine, dataproducts, woodland hills, ca.



More information about the Comp.unix.shell mailing list