How can invoke a shell to make a new environment to run a make inside another make?

Posted by WilliamKF on Stack Overflow See other posts from Stack Overflow or by WilliamKF
Published on 2010-06-16T01:43:50Z Indexed on 2010/06/16 1:52 UTC
Read the original article Hit count: 246

Filed under:
|

I would like in my GNUmakefile to have a target rule that invokes a new shell and then with the clean slate of the new shell invokes a new make.

What is the syntax to do this?

I tried this but it didn't work:

.PHONY: setup
setup:
 shell cd myDir; make; cd ..

It gets infinite repeat of the following error:

make[1]: Entering directory `/disk4/home/user/parent'
shell cd myDir; make; cd ..
/bin/sh: shell: command not found
make[1]: Entering directory `/disk4/home/user/parent'
shell cd myDir; make; cd ..
/bin/sh: shell: command not found
[...]

© Stack Overflow or respective owner

Related posts about recursive

Related posts about gnumakefile