Yu *_*hou 36 makefile gnu-make
我需要从规则中获取第n个依赖文件,类似于bash中的$ n.我需要这个,因为我想将各个依赖项文件作为构建程序的选项提供.
这是一个例子:
dep.o: dep.src config1.cfg config2.cfg
parse -cfg1 $2 -cfg2 $3 -o $@ $<
Run Code Online (Sandbox Code Playgroud)
可能吗?
Bet*_*eta 53
dep.o: dep.src config1.cfg config2.cfg
@echo the second preq is $(word 2,$^), the third is $(word 3,$^)
Run Code Online (Sandbox Code Playgroud)