【问题标题】:Makefile variable生成文件变量
【发布时间】:2017-02-14 21:29:24
【问题描述】:

您好,我有带有变量的 makefile,如下所示:

NDK     := ~/Application/Android/SDK/NDK
ARCH    := arm
ifeq ($(ARCH),arm)
//..etc..
endif

但是当我尝试makefile 时,我得到了这个错误:

: NDK: command not found
: ARCH: command not found
: syntax error near unexpected token `$(ARCH),arm'

我在ubuntu上
这是我知道的变量,但为什么我对他们有错误?怎么了,怎么解决?
我是 ubuntu 的新手!

【问题讨论】:

  • “我尝试制作文件”是什么意思。你不使用'make'吗?
  • @robsn 不,我不使用来自make ,在这里你可以看到我的makefile :https://github.com/mtmiller/openconnect/blob/master/android/Makefile
  • 你必须使用make。您不能单独运行生成文件。生成文件只是make 的说明。请参阅 jotik 的回答。
  • @robsn 是的,你可以。看我的回答:)
  • @jotik 好吧,好吧。在这种情况下,它会隐式运行 make :)

标签: makefile


【解决方案1】:

您正在尝试将./makefile 作为可执行文件运行。但您应该改为使用make 运行它。例如:

make -f makefile

或者只是

make

如果您的 makefile 正确命名为 makefile 或 Makefile。

如果您确实需要直接执行 makefile,请参阅 this StackOverflow question and answers 了解如何向 makefile 添加适当的 shebang。

【讨论】:

  • 谢谢,你说得对,抱歉问题不好,谢谢你的回答
猜你喜欢
  • 1970-01-01
  • 2016-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-07
  • 2013-01-28
相关资源
最近更新 更多