nmake 中文件夹名和文件名的串联
我有一个 Nmake 的 Makefile,其中包含宏中的文件列表:
MYSRCFILES1=myfolder\file1.svg myfolder\file2.svg ... myfolder\file99.svg
还有第二个,如下所示:
MYSRCFILES2=myfolder2\file1.svg myfolder2\file2.svg ... myfolder2\file99.svg
我正在尝试的是避免文件列表重复,并避免文件夹名称重复,如下所示:
MYSRCFILES0=file1.svg file2.svg file3.svg
MYSRCFILES1="prepend 'myfolder\' to each element of $(MYSRCFILES0)"
MYSRCFILES2="prepend 'myfolder2\' to each element of $(MYSRCFILES0)"
仔细研究 Nmake 的文档,到目前为止我还没有找到解决方案。知道如何实现这一点吗?
I have a Makefile for Nmake containing a list of files in a macro:
MYSRCFILES1=myfolder\file1.svg myfolder\file2.svg ... myfolder\file99.svg
and a second one just like this:
MYSRCFILES2=myfolder2\file1.svg myfolder2\file2.svg ... myfolder2\file99.svg
What I am trying is to avoid duplication of the list of files, and to avoid duplication of the folder names, something like this:
MYSRCFILES0=file1.svg file2.svg file3.svg
MYSRCFILES1="prepend 'myfolder\' to each element of $(MYSRCFILES0)"
MYSRCFILES2="prepend 'myfolder2\' to each element of $(MYSRCFILES0)"
Digging myself through the documentation of Nmake I haven't found a solution so far. Any idea how to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
终于找到了解决我的问题的方法,它并不完美,因为我必须向每个文件添加
.\
但在我的情况下似乎没问题:可以解决问题。
Finally found a solution for my problem, it's not perfect since I have to add a
.\
to every file but that seems to be ok in my case:does the trick.
Nmake 和 make 类似吗?您可以使用 patsubst (“模式替换字符串”)函数,如下所示:
Is Nmake simillar to make? You can use patsubst ("pattern substitute string") function like this: