From: j DOT aldrich6 AT genie DOT com Message-Id: <199604040625.AA102869132@relay1.geis.com> Date: Thu, 4 Apr 96 05:57:00 UTC 0000 To: kjt AT nando DOT net Cc: djgpp AT delorie DOT com Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Subject: Re:GNU MAKE NOT WORKING WITH G Reply to message 5227492 from KJT AT NANDO DOT NET on 04/03/96 6:56AM >I just installed djgpp V.2, gnu for dos. I also loaded the other gnu >tools including make. When I enter the command gcc -I..\h -c calls.c >the complilation works fine. When the same command is entered >via a makefile it does not work. Make echos the identical command as >the one entered on the command line but complains, gcc may be doing >the complaining, that the include files can not be found. I have heard that make has problems with traversing parent and child directories to find files. As I have not encountered the problem myself, I can't tell you for sure. All I can suggest is to look in the INFO docs for make. >Since I am writing I have another question. In other versions of make >a for loop is supported. I try the same loop with gnu and it does not >work. Is there any looping capabilties in GMAKE. An example loop >follows: > >all: > for dir in $(DIR);{cd $$dir; make all; cd ..} >lib: > for dir in $(DIR);{cd $$dir; make lib; cd ..} You are using an operating system-dependent command in your makefile. What you typed is not recognized as an internal make function; make tries to run it as a shell command just like any other command in the makefile. DOS 'for' doesn't recognize the syntax you are using and sends you an error. Were those other versions of make you refer to running on Unix machines? To invoke make's own internal functions, you have to call them simililarly to a variable. The function you want is called 'foreach', and would work as follows: $(foreach dir, $(DIR), cd $(dir); make lib; cd ..) At least, that should do what you want. I am not sure about the syntax for including multiple commands as part of function arguments. You may want to try it and see. You _definitely_ want to look in the docs for make that come with DJGPP. FYI, many Unix commands have no equivalent in DOS. There are workarounds, but for what you are trying to do it becomes difficult. Hope this helps! John