g77 中的 Make 和 Shell 命令选项
g77 中的 make
和 shell
选项是什么意思?例如,如果我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些只是保存计算机上程序位置的变量。可能会有像
$(SHELL) a_shell_script.sh
这样的规则使用这些变量。FC
、CD
、LN
和RM
类似,只是没有显式列出路径。将程序作为变量可以很容易地更改它们,例如,如果您想使用不同的版本。您的错误看起来像是 shell 正在尝试运行命令
Making
。可能的原因是前面有一个未定义的变量,例如,运行时会扩展为
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. TheFC
,CD
,LN
andRM
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 rulewhich would expand to
Making something
when run instead ofecho Making something
. Without seeing the relevant line that's the best I can think of.