今天,我试图编写Makefile来遍历目录中的所有文件。我是用这样的Shell风格写的,
for file in `find $(DEPLOY_PATH)/ -type l`; \
do \
echo $(file); \
done
有9个链接文件,但是当我运行make时,它打印了9条空行,没有文件名
答案 0 :(得分:0)
$$file
是指 Makefile 变量。您想要的是$ cd "$(mktemp --directory)"
$ cat Makefile
all:
for file in *; \
do \
echo "$$file" || exit 1; \
done
$ make
for file in *; \
do \
echo "$file" || exit 1; \
done
Makefile
with spaces
:
/books