g77 中的 Make 和 Shell 命令选项

发布于 2024-08-17 10:03:37 字数 676 浏览 4 评论 0原文

g77 中的 makeshell 选项是什么意思?例如,如果我的 Makefile 中有以下脚本:

FC = g77
FFLAGS = -O2 -mno-cygwin
LDFLAGS =
CD = cd
LN = ln
LNFLAGS = -s
MAKE = /bin/make
RM = rm
RMFLAGS = -f
SHELL = /bin/sh

这是否意味着 make 操作需要使用 /bin/make.exe

附带说明:当我使用上面的命令行运行编译时,出现错误:

/bin/sh: 第 4 行:命令不 找到了

不确定两者是否相关。

编辑:这是我的 Makfile:

arpacklib:
    @( \
    for f in $(DIRS); \
    do \
        $(CD) $$f; \
        $(ECHO) Making lib in $$f; \
        $(MAKE) $(PRECISIONS); \
        $(CD) ..; \
    done );
    $(RANLIB) $(ARPACKLIB)

What do the make and shell option mean in g77? For example, if I have the following script in my Makefile:

FC = g77
FFLAGS = -O2 -mno-cygwin
LDFLAGS =
CD = cd
LN = ln
LNFLAGS = -s
MAKE = /bin/make
RM = rm
RMFLAGS = -f
SHELL = /bin/sh

Does this mean that make operation needs to make use of /bin/make.exe?

On a side note: when I run the compilation, using the above command line, I got an error:

/bin/sh: line 4: Making: command not
found

Not sure whether the two are related.

Edit: This is my Makfile:

arpacklib:
    @( \
    for f in $(DIRS); \
    do \
        $(CD) $f; \
        $(ECHO) Making lib in $f; \
        $(MAKE) $(PRECISIONS); \
        $(CD) ..; \
    done );
    $(RANLIB) $(ARPACKLIB)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

您的好友蓝忘机已上羡 2024-08-24 10:03:37

这些只是保存计算机上程序位置的变量。可能会有像 $(SHELL) a_shell_script.sh 这样的规则使用这些变量。 FCCDLNRM 类似,只是没有显式列出路径。将程序作为变量可以很容易地更改它们,例如,如果您想使用不同的版本。

您的错误看起来像是 shell 正在尝试运行命令 Making。可能的原因是前面有一个未定义的变量,例如,

all:
    $(ECHO) Making something

运行时会扩展为 Making Something 的规则,而不是 echo Making Something。没有看到相关的线路,这是我能想到的最好的。

These are just variables holding the location of programs on your computer. There will probably be rules like $(SHELL) a_shell_script.sh using these variables. The FC, CD, LN and RM are similar, they just don't have the path explicitly listed. Having programs as variables makes it simple to change them, for example if you want to use a different version.

Your error looks like the shell is trying to run the command Making. A possible cause is there is an undefined variable in front of this, eg a rule

all:
    $(ECHO) Making something

which would expand to Making something when run instead of echo Making something. Without seeing the relevant line that's the best I can think of.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文