首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用ndk中的make跟踪选项

如何使用ndk中的make跟踪选项
EN

Stack Overflow用户
提问于 2015-03-28 17:35:06
回答 2查看 468关注 0票数 1

*这个问题是关于从ndk-build*调用make跟踪选项的。

我试图通过一个make文件进行跟踪,但是我得到了一个错误。据我理解,ndk是shell,它调用make。因此,我应该能够调用make开关,并且可以执行其中的一些操作。但是跟踪选项不起作用:-(请看下面的输出,我做错了什么?

@Mad科学家--我下载并输入了4.0版。但我还是看到了同样的错误。有人能在他们的系统上运行它,并发布他们使用的命令吗?我想我可能是在触发开关坏掉什么的。如果我能看到一个工作实例,我可以从那里微调命令。另外,我看了一下您发布的make-4.0更新链接,也列出了调试。因此,我不知道为什么或如何调试3.81;也许是早期版本的。此外,我也不知道为什么调试工作,但不跟踪。我认为这是ndk的问题。我所做的是直接发布make,不仅我看到跟踪工作,而且我没有看到促使我发布这个问题的错误。这是一种投诉,所有这些都与":“和”:“连用。我将在这篇文章上贴上ndk标签,希望有ndk专业知识的人加入进来。我非常感谢你的帮助。

代码语言:javascript
复制
sansari@ubuntu:~/AndroidStudioProjects/ThirdNDK/app/src/main$ make -version
GNU Make 4.0
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
sansari@ubuntu:~/AndroidStudioProjects/ThirdNDK/app/src/main$ ~/ndk/android-ndk-r10d/ndk-build --trace  -I /home/sansari/mytree2/TBT  --just-print 
/home/sansari/ndk/android-ndk-r10d/prebuilt/linux-x86_64/bin/make: unrecognized option '--trace'
Usage: make [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -B, --always-make           Unconditionally make all targets.
  -C DIRECTORY, --directory=DIRECTORY
                              Change to DIRECTORY before doing anything.
  -d                          Print lots of debugging information.
  --debug[=FLAGS]             Print various types of debugging information.
  -e, --environment-overrides
                              Environment variables override makefiles.
  -f FILE, --file=FILE, --makefile=FILE
                              Read FILE as a makefile.
  -h, --help                  Print this message and exit.
  -i, --ignore-errors         Ignore errors from commands.
  -I DIRECTORY, --include-dir=DIRECTORY
                              Search DIRECTORY for included makefiles.
  -j [N], --jobs[=N]          Allow N jobs at once; infinite jobs with no arg.
  -k, --keep-going            Keep going when some targets can't be made.
  -l [N], --load-average[=N], --max-load[=N]
                              Don't start multiple jobs unless load is below N.
  -L, --check-symlink-times   Use the latest mtime between symlinks and target.
  -n, --just-print, --dry-run, --recon
                              Don't actually run any commands; just print them.
  -o FILE, --old-file=FILE, --assume-old=FILE
                              Consider FILE to be very old and don't remake it.
  -p, --print-data-base       Print make's internal database.
  -q, --question              Run no commands; exit status says if up to date.
  -r, --no-builtin-rules      Disable the built-in implicit rules.
  -R, --no-builtin-variables  Disable the built-in variable settings.
  -s, --silent, --quiet       Don't echo commands.
  -S, --no-keep-going, --stop
                              Turns off -k.
  -t, --touch                 Touch targets instead of remaking them.
  -v, --version               Print the version number of make and exit.
  -w, --print-directory       Print the current directory.
  --no-print-directory        Turn off -w, even if it was turned on implicitly.
  -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
                              Consider FILE to be infinitely new.
  --warn-undefined-variables  Warn when an undefined variable is referenced.

This program built for x86_64-pc-linux-gnu
Report bugs to <bug-make@gnu.org>
sansari@ubuntu:~/AndroidStudioProjects/ThirdNDK/app/src/main$ 

@亚历克斯·科恩-再次感谢。这解释了很多。我将首先研究获得最新的ndk,然后尝试使用最新版本的make。对我来说,一个突出的问题是,我的本地C项目(我正试图移植到jni中)使用早期版本的ndk中的一个工具链进行编译。因此,对于我来说,获得"::“错误消息现在似乎表明它是由其他原因引起的。我怀疑这与我试图将C项目的make文件包含到我的Android.mk中有关。虽然我的Android.mk没有一个全部的目标,但是否有一个暗示呢?我只是像报纸一样读了一次“制作手册”,我不记得是否是这样。但是有很多隐含的规则。你对此有什么想法吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-03-28 22:11:39

谷歌在ndk包中使用了GNU的自定义版本。您可以尝试使用下载的make启动ndk-build

代码语言:javascript
复制
GNUMAKE=`which make` ndk-build

但是,.mk文件(构成ndk的核心)和路径上的make之间可能存在一些微小的不一致。

票数 0
EN

Stack Overflow用户

发布于 2015-03-28 18:09:00

很可能您使用的是GNU的旧版本。GNU中的--trace标志加进使版本为4.0。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29320349

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档