【问题标题】:Make: Command not found, but command exists?Make:找不到命令,但命令存在?
【发布时间】:2013-02-06 15:52:33
【问题描述】:

所以我有一个使用arm-eabi-none-xxx 命令的make 文件,但是当我运行make 时出现“找不到命令”错误:

bash-4.2$ make
arm-none-eabi-as -I source/ source/mailbox.s -o build/mailbox.o
make: arm-none-eabi-as: Command not found
make: *** [build/mailbox.o] Error 127

奇怪的是,该命令是否存在并且在我的路径中(以下与makefile在同一目录中):

bash-4.2$ arm-none-eabi-as --version
GNU assembler (Sourcery G++ Lite 2008q3-66) 2.18.50.20080215
This assembler was configured for a target of `arm-none-eabi'.

我可以运行 make 正在运行的命令:

bash-4.2$ arm-none-eabi-as -I source/ source/mailbox.s -o build/mailbox.o
bash-4.2$ ls build/
README  mailbox.o

所以。我读到如果./ 在当前路径中,make 会使用 shell 执行命令,所以我尝试过,但没有用。最初我根本无法运行 arm-none-eabi-as,因为它是 32 位二进制文​​件,而我在 64 位系统(Slackware 14.0)but I followed the instructions here to install the 32-bit libraries 等上运行。

那么问题是……我犯了什么愚蠢的小学生错误?

【问题讨论】:

  • 您可以将arm-none-eabi-as的路径添加到Makefile中的PATH。或者,指定完整路径。
  • 所以它不使用我当前的路径,其中包括所在的目录?
  • @LaceyStr:默认情况下是这样;在您的Makefile 中查找对PATH 的分配,并检查它使用的shell(/bin/sh,除非它分配给SHELL)与您的交互式shell 相同。
  • 我已经使用命令的完整路径临时修复了它。 Makefile 既没有 SHELL 也没有任何 PATH 分配。
  • type arm-none-eabi-as 告诉你什么?

标签: linux path makefile slackware


【解决方案1】:

您是以 sudo 还是 root 身份运行“make”的?在那种情况下,它对我不起作用。 我必须做的是 mkdir 一个“build”文件夹,然后简单地运行“make”。它奏效了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-04
    • 2022-07-21
    • 1970-01-01
    • 2017-10-01
    相关资源
    最近更新 更多