SHELL = /bin/bash
test1:
@echo before
@pushd /tmp
@echo in /tmp
@popd
@echo after
test2:
@/bin/bash -c "echo before;\
pwd; \
pushd /tmp; \
echo in /tmp; \
pwd; \
popd; \
echo after; \
pwd;"
当运行make test1和make test2时,它提供了以下内容:
代码语言:
javascript
复制
prompt>make test1
before
/download/2011/03_mar
make: pushd: Command not found
make: *** [test1] Error 127
prompt>make test2
before
/download/2011/03_mar
/tmp /download/2011/03_mar