比较 makefile 中的字符串变量
我的代码如下所示(如下),其中 ${IMPJAVASRC:T} 计算结果为 PJCentric.java。我想将此字符串变量与仅由字符“PJC”组成的前缀进行比较,因为还有其他具有相同前缀的模块,我想使用与以不同前缀开头的其他模块不同的 -classpath 进行编译。然而,我下面的陈述并不正确。有什么建议吗?
.if !empty(${IMPJAVASRC:T}:MPJC*) (一种方式编译) 。别的 (另一种方式编译)
I have code that looks like the following (below) where ${IMPJAVASRC:T} evaluates to PJCentric.java. I would like to compare this string variable to a prefix consisting of just the characters "PJC" since there are other modules with the same prefix which I would like to compile with a different -classpath than other modules that start with a different prefix. However, my statement below does not evaluate to true. Any suggestions?
.if !empty(${IMPJAVASRC:T}:MPJC*)
(compile one way)
.else
(compile another way)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您专门使用GNU Make,例如及其条件函数 或其 控制功能。但其他
make
程序不具备这种能力。然而,也存在比make
更好的构建程序,例如 omake 和 Java 也有 antYou probably can do this if you use specifically GNU Make e.g. with its conditional functions or its control functions. But other
make
programs don't give you this ability. However, there also exist better building programs thanmake
such as omake and Java have also ant