当前位置: 技术问答>linux和unix
makefile切换目录
来源: 互联网 发布时间:2016-02-03
本文导语: 怎么在makefile里写个脚本达到下面这个目的 功能同SHELL里 的cd ../c这个命令 | $ make Current working dir is: /usr/home/mymtom/src/shell Entering dir /usr/home/mymtom/src/shell/../c Current working dir is: /usr/home/my...
怎么在makefile里写个脚本达到下面这个目的
功能同SHELL里 的cd ../c这个命令
功能同SHELL里 的cd ../c这个命令
|
$ make
Current working dir is: /usr/home/mymtom/src/shell
Entering dir /usr/home/mymtom/src/shell/../c
Current working dir is: /usr/home/mymtom/src/c
$ cat Makefile
all:
@_curdir=`pwd`;
echo "Current working dir is: $${_curdir}";
echo "Entering dir $${_curdir}/../c";
cd ../c;
_curdir=`pwd`;
echo "Current working dir is: $${_curdir}"
$
Current working dir is: /usr/home/mymtom/src/shell
Entering dir /usr/home/mymtom/src/shell/../c
Current working dir is: /usr/home/mymtom/src/c
$ cat Makefile
all:
@_curdir=`pwd`;
echo "Current working dir is: $${_curdir}";
echo "Entering dir $${_curdir}/../c";
cd ../c;
_curdir=`pwd`;
echo "Current working dir is: $${_curdir}"
$