对于“循环在Makefile中不工作": [英] For Loop Not Working in Makefile: "i was unexpected at this time"

查看:88
本文介绍了对于“循环在Makefile中不工作":的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的makefile:

I have a very simple makefile:

all:
    @for i in 1 2 3;\
    do \
        echo "i: $$i";\
    done

但是,当我运行此命令时,出现了此时我出乎意料"错误.

And yet when I run this, I got a "i was unexpected at this time" error.

知道为什么会这样吗?

我正在Windows XP上运行.以上脚本的Windows等价于什么?

推荐答案

如果您在Windows上运行(可能是由于

If you are running on Windows (likely, because of this) , the commands you write must be valid Windows commands. I mean commands that you could run in the Windows shell cmd.exe.

在这里,您尝试运行的命令是针对bash shell的有效UNIX命令.它们不适用于Windows Shell.

Here, the commands you try to run are valid UNIX commands for a bash shell. They are not for the Windows shell.

这篇关于对于“循环在Makefile中不工作":的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆