Makefile中获取当前所在目录的文件夹名
在Makefile中获取当前目录名(不含绝对路径),例如:
cd /prj/user/examples;
在Makefile中用以下命令:
DIRNAME = $(notdir $(shell pwd))
debug:
@echo "DIRNAME=$(DIRNAME)"
执行make debug, 会打印:
DIRNAME=examples
在Makefile中获取当前目录名(不含绝对路径),例如:
cd /prj/user/examples;
在Makefile中用以下命令:
DIRNAME = $(notdir $(shell pwd))
debug:
@echo "DIRNAME=$(DIRNAME)"
执行make debug, 会打印:
DIRNAME=examples