我正在尝试将此命令的输出(在我的makefile中)分配给makefile header var,如下代码行所示:
HEADER = $(shell for file in `find . -name *.h`;do echo $file; done)
问题是,如果我在makefile中使用以下方法打印头文件:
print:
@echo $(HEADER)
我得到
ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile ile
如果我直接在控制台中运行这个命令,并直接在makefile所在的位置运行:
myaccount$ for file in `find . -name *.h`;do echo $file; done
./engine/helper/crypto/tomcrypt/headers/._tomcrypt_pk.h
./engine/helper/crypto/tomcrypt/headers/tomcrypt.h
./engine/helper/crypto/tomcrypt/headers/tomcrypt_argchk.h
./engine/helper/crypto/tomcrypt/headers/tomcrypt_cfg.h
./engine/helper/crypto/tomcrypt/headers/tomcrypt_cipher.h
./engine/helper/crypto/tomcrypt/headers/tomcrypt_custom.h
./engine/helper/crypto/tomcrypt/headers/tomcrypt_hash.h
./engine/helper/crypto/tomcrypt/headers/tomcrypt_mac.h
....
所以我得到了所有的头文件。我这样做是为了避免在makefile中手动指定所有.h文件。
有什么想法吗?