1

****这个问题是关于从 ndk-build 调用 make trace 选项*********

我正在尝试通过 make 文件进行跟踪,但出现错误。我的理解是ndk是shell,它调用make。所以我应该能够调用 make 开关;我可以做其中的一些。但是跟踪选项不起作用:-(请参阅下面的输出;我做错了什么?

@MadScientist - 我下载并安装了 4.0 版。但我仍然看到同样的错误。任何人都可以在他们的系统上运行它,并发布他们使用的命令吗?我想我可能会触发开关故障或其他什么。如果我能看到一个工作实例,我可以从那里微调命令。还; 我查看了您发布的 make-4.0 更新链接;那里也列出了调试。Sooo 我不确定为什么或如何调试 3.81;也许它的早期版本。另外我不确定为什么调试有效但不跟踪。我认为这是一个ndk问题。我所做的是直接发出 make ,不仅我看到跟踪工作;我没有看到促使我发布此问题的错误。这是所有与“:”和“::”一起使用的抱怨。

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$ 

@Alex Cohn - 再次感谢。这解释了很多。我将首先考虑获取最新的ndk;然后尝试使用最新版本的make。对我来说,一个悬而未决的问题是,我试图移植到 jni 中的本机 C 项目使用 ndk 早期版本中的工具链之一进行编译。因此,对我来说,现在收到“::”错误消息似乎表明它是由其他原因引起的。我怀疑这与我试图将 C 项目的 make 文件包含到我的 Android.mk 中有关。虽然我的 Android.mk 没有一个 all 目标,但也许有一个暗示?我只是像报纸一样阅读了一次制作手册;我不记得是不是这样。但是有很多隐含的规则。你对此有什么想法吗?

4

2 回答 2

0

您很可能使用的是旧版本的 GNU make。该--trace标志在 GNU make 4.0 版中添加的。

于 2015-03-28T18:09:00.617 回答
0

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

GNUMAKE=`which make` ndk-build

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

于 2015-03-28T22:11:39.610 回答