作者gecer (gecer)
看板Programming
标题Re: [问题] makefile语法疑问
时间Wed Nov 30 20:57:08 2022
小弟试着更改makefile内容
===============================================================================
source:=folder1_%\
folder2_%\
$(source)
@echo $@
===============================================================================
指令make folder1_01
folder01_01
指令make folder2__01
folder02_01
但是如果增加一个没有%的target pattern
===============================================================================
source:=sim\
folder1_%\
folder2_%\
$(source)
@echo $@
===============================================================================
指令make sim
mixed implicit and normal rules: deprecated syntax
sim
指令make folder1_01
mixed implicit and normal rules: deprecated syntax
No rule to make target 'folder1_01'. Stop.
似乎增加一个normal target pattern会影响到含% target pattern的match
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 220.143.209.106 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Programming/M.1669813030.A.1FD.html
1F:推 LPH66: 所以你想要让同一批指令给含 % 和不含 % 的123.194.181.180 12/01 19:50
2F:→ LPH66: 规则执行是吗?123.194.181.180 12/01 19:50
3F:→ gecer: 对的220.143.209.106 12/02 08:01
4F:推 LPH66: 稍微搜了一下, 好像只能用巨集了, 如下123.194.181.180 12/06 19:41
6F:→ LPH66: 把同一批指令写成巨集, 然後把所有规则分开123.194.181.180 12/06 19:42
7F:→ LPH66: 在每个规则中使用巨集定义指令123.194.181.180 12/06 19:43
8F:→ LPH66: 上面那个问题问的是同指令给多个 % 规则用123.194.181.180 12/06 19:43
9F:→ LPH66: 不过看起来因为 % 的处理规则的关系123.194.181.180 12/06 19:43
10F:→ LPH66: 要混一般目标的话应该也只能一起这样用123.194.181.180 12/06 19:44