a Make question

david at cdp.UUCP david at cdp.UUCP
Sat Nov 30 15:00:00 AEST 1985


>
>	DIRS = d1 d2 d3 d4 d5
>	depend: ; (for dir in $(DIRS); do (cd $dir; make depend); done)
>
>The problem with this is that 'make' is interpreting the $d as a null
>string, so the 'cd' command sees an argument of "ir".  I tried
>escaping the $ preceding dir, to no avail.  Can anybody make the
>above loop work, or suggest a better way?  Thanks!

#		add the following line to insure that the bourne is called
#		called as the shell (make in many incarnations
#		reads the users environment).
SHELL=/bin/sh

depend: ; (for dir in $(DIRS); do (cd $$dir; make depend); done)
                                              ^
# to get a literal $ past make one must escape it with another $.


david stone
!{hplabs,glacier}!cdp!david



More information about the Comp.unix mailing list