[lug] How do you setup a recursive make?

David Morris lists at morris-clan.net
Mon Jul 23 15:04:36 MDT 2001


The reason your makefile below is failing is that 
"make -C $(CORE_DEPS)" is going to the directory
"../../../basic_services/dm", and making target "..../app".  What you
need to do is setup a loop to call "make -C" for each subdirectory
seperately, instead of all at once.

--David


> > The following is not working. How does one setup a recursive make?
> > I want to be able to let individual developers just fill in the directories
> > of the tools they need and I'll call make somewhere else in the file.
> > 
> > ############################ Makefile ###########################
> > # User configurable section
> > ...
> > 
> > CORE_DEPS = ../../../basic_services/dm \
> >             ../../../basic_services/app \
> >             ../../../basic_services/tm \
> >             ../../../basic_services/utils \
> >             ../../../advanced_services/tlm
> > 
> > ...
> > # End user configurable section
> > 
> > $(MAIN_TARGET): $(OBJS) 
> > 	make -C $(CORE_DEPS)
> > 	@echo "Linking $@"
> > 	$(VB)$(LD_CMD) -r $(OBJS) $(CSC_OBJ) $(CORE_OBJECTS) -o $@
> > 
> > ############################ Makefile ###########################
> > 
> > 
> > This produces the following:
> > make -C ../../../basic_services/dm ../../../basic_services/app
> > ../../../basic_services/tm ../../../basic_services/utils
> > ../../../advanced_services/tlm
> > make[1]: Entering directory
> > `C:\Data\my_cvs\di\sc\fsw\src\core\basic_services\dm'
> > make[1]: Leaving directory
> > `C:\Data\my_cvs\di\sc\fsw\src\core\basic_services\dm'
> > make[1]: *** No rule to make target `../../../basic_services/app'.  Stop.
> > make: *** [coredeps] Error 0x2
> > 
> > 
> > 
> > Is there a better way to accomplish this?
> > We are bound to use make version 3.74.
> > 
> > 
> > --
> > David Holshouser
> > Software Engineer
> > Ball Aerospace & Technologies Corp.
> > (303)939-5085  dholshou at ball.com  
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > 
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 




More information about the LUG mailing list