[lug] How do you setup a recursive make?

Holshouser, David dholshou at ball.com
Mon Jul 23 16:29:38 MDT 2001


is make sending this scripting to the shell or is it handled within make?
is this sh syntax specific?
where do I look for info on for loops?

FYI, using gcc make from Tornado2 on an NT box, so if this is passed through
to the shell, I'm in trouble.




> -----Original Message-----
> From: bdoctor at ps-ax.com [mailto:bdoctor at ps-ax.com]
> Sent: Monday, July 23, 2001 5:09 AM
> To: lug at lug.boulder.co.us
> Subject: Re: [lug] How do you setup a recursive make?
> 
> 
> Here is an applicable stub:
> 
> SUBDIRS = lib server client docs 
> 
>         list='$(SUBDIRS)'; for subdir in $$list; do \
>           echo "Making $$target in $$subdir"; \
>           (cd $$subdir && $(MAKE) $(MAKEFLAGS) $$target) \ 
> 
> Order is important, in terms of library dependency.
> 
> -brad
> 
> > 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