Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Loops gnu make中的多变量for循环(类似于bmake)_Loops_For Loop_Makefile - Fatal编程技术网

Loops gnu make中的多变量for循环(类似于bmake)

Loops gnu make中的多变量for循环(类似于bmake),loops,for-loop,makefile,Loops,For Loop,Makefile,bmake使您能够使用非常有用的for循环 LIST= \ s1 t1 \ s2 t2 \ s3 t3 all: .for s t in ${LIST} @echo ${s} ${t} .endfor 列表=\ s1 t1\ s2 t2\ S3T3 全部: .for${LIST}中的ST @echo${s}${t} endfor先生 效果将是: # bmake s1 t1 s2 t2 s3 t3 #制造 s1 t1 s2 t2 S3T3 在gnu make中有可能做这样的事

bmake使您能够使用非常有用的for循环

LIST= \ s1 t1 \ s2 t2 \ s3 t3 all: .for s t in ${LIST} @echo ${s} ${t} .endfor 列表=\ s1 t1\ s2 t2\ S3T3 全部: .for${LIST}中的ST @echo${s}${t} endfor先生 效果将是:

# bmake s1 t1 s2 t2 s3 t3 #制造 s1 t1 s2 t2 S3T3 在gnu make中有可能做这样的事情吗?
thx

没有。但是你可以用不同的方式,比如:

LIST = s1:t1 s2:t2 s3:t3

all: ; $(foreach L,$(LIST),echo $(subst :, ,$L) ;)
如果列表项中可能包含
,请选择其他分隔符