我尝试将此命令的输出(即在我的makefile中)分配给makefile头变量,如以下代码行所示:
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文件。
有什么想法吗?
发布于 2010-03-04 00:48:09
为什么不干脆这么做呢
HEADER = $(shell find . -name '*.h')https://stackoverflow.com/questions/2373081
复制相似问题