跳至内容
wiki
用户工具
登录
站点工具
搜索
工具
显示页面
过去修订
反向链接
导出 PDF
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您在这里:
start
»
语法
»
makefile
您的足迹:
•
安装pyqt5
•
sidebar
•
python3升级
•
dll
•
python源码保护
•
python风格指南
•
yum_install_list
•
xilinx_axi_interconnect
•
automatic_bug记录
•
安装php70w
语法:makefile
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
# makefile ## - for ```c NAME := a b c run: @for tmp in $(NAME); do \ echo $$tmp; \ done ``` ## - 根据文件内容循环执行 根据gen.txt文件内容,在makefile中循环执行。 输入文件: ``` > cat gen.txt items = a b c ``` Makefile文件: ```cmake run1: @line=$$(head -n1 gen.txt); \ tile_list=$$(echo "$$line" | awk '{for(i=3;i<=NF;i++) printf " %s", $$i}'); \ for tile in $$tile_list; do \ echo "process tile: $$tile"; \ done ITEMS = $(shell head -n1 gen.txt | awk '{for(i=3;i<=NF;i++) printf " %s", $$i}') run2: @for tile in $(ITEMS); do \ echo "process tile: $$tile"; \ done ITEMS_3 = $(shell head -n1 gen.txt | awk '{for(i=3;i<=NF;i++) printf "%s", $$i}') run3: @for tile in $(ITEMS_3); do \ echo "process tile: $$tile"; \ done ITEMS_4 = $(shell head -n1 gen.txt | awk '{for(i=3;i<=NF;i++) printf $$i}') run4: @for tile in $(ITEMS_4); do \ echo "process tile: $$tile"; \ done ``` 执行结果: ``` > make run1 process tile: a process tile: b process tile: c > make run2 process tile: a process tile: b process tile: c > make run3 process tile: abc > make run4 process tile: abc ```
语法/makefile.txt
· 最后更改:
2026/10/13 22:51
由
127.0.0.1
页面工具
显示页面
过去修订
反向链接
导出 PDF
回到顶部