I am trying to create my own homebrew formula using
make -f makefile otherMakeTarget
system "cd", "sub/dir/place/"
system "make", "etc"
system creates a subshell and any modifications to the working directory go away when that call completes.
You could try using