GNU make question

I’ve got a makefile that needs to make a second makefile, but I’m running into problems using environment variables in the second one. I looked at the make documentation and don’t see anything helpful.

Basically, what I’ve got looks like this:

Here foo is defined in the machine environment. makefile 2 works just fine if I make it on its own, so I’m pretty sure that it’s a problem communicating between the two. Any ideas?

Hmm, make normally should keep you in the same environment. Have you tried adding > or | or any shell-interpreted symbol to the make command? In your example, you could do:

cd \overhere; $(MAKE) > /tmp/junk

I think this forces make to pass the command to the shell instead of running it itself, which may help you. Other than that I’m stumped.

I ended up moving the call to makefile 2 into a .bat file (that I was using anyway for some other stuff), and now everything’s happy. Thanks for the suggestion, though.