如何使用 ndk 的 make trace 选项
How to use make trace option from ndk
****这个问题是关于从 ndk-build 调用 make trace 选项*********
我正在尝试跟踪 make 文件,但出现错误。我的理解是ndk是shell,调用make。所以我应该能够调用 make 开关;我可以做其中的一些。但是跟踪选项不起作用:-(请看下面的输出;请问我做错了什么?
@MadScientist - 我下载并安装了 4.0 版。但我仍然看到同样的错误。任何人都可以在他们的系统上 运行 它,并且 post 他们使用的命令吗?我想我可能会无序触发开关或其他什么。如果我能看到一个工作实例,我可以从那里微调命令。还;我查看了您 post 为 make-4.0 更新编写的 link;调试也列在那里。 Sooo 我不确定为什么或如何调试 3.81;也许是它的早期版本。我也不确定为什么调试有效但不能跟踪。我认为这是一个ndk问题。我所做的是直接发出 make,不仅我看到 trace 工作;我没有看到提示我 post 这个问题的错误。这是对 all 与“:”和“::”一起使用的抱怨。我打算在这个 post 上加上一个 ndk 标签,希望有 ndk 专业知识的人能插话。我非常感谢你的帮助。
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。对我来说,一个悬而未决的问题是,我的本机 C 项目(我试图移植到 jni 中的那个项目)使用早期版本的 ndk 中的工具链之一进行编译。所以对我来说,现在得到“::”错误信息似乎表明它是由其他原因引起的。我怀疑这与我试图将 C 项目的 make 文件包含到我的 Android.mk 中有关。虽然我的 Android.mk 没有 all 目标,但是否有隐含的目标?我只是像看报纸一样读了一遍制作手册;我不记得是不是这样。但是有很多隐含的规则。你对此有什么想法吗?
很可能您使用的是旧版本的 GNU make。 GNU make 版本 4.0.
中的 --trace
标志 was added
Google 在 ndk 包中使用自定义版本的 GNU Make。您可以尝试使用下载的 make
启动 ndk-build
GNUMAKE=`which make` ndk-build
但构成 ndk 核心的 .mk
文件与 make你的道路。
****这个问题是关于从 ndk-build 调用 make trace 选项*********
我正在尝试跟踪 make 文件,但出现错误。我的理解是ndk是shell,调用make。所以我应该能够调用 make 开关;我可以做其中的一些。但是跟踪选项不起作用:-(请看下面的输出;请问我做错了什么?
@MadScientist - 我下载并安装了 4.0 版。但我仍然看到同样的错误。任何人都可以在他们的系统上 运行 它,并且 post 他们使用的命令吗?我想我可能会无序触发开关或其他什么。如果我能看到一个工作实例,我可以从那里微调命令。还;我查看了您 post 为 make-4.0 更新编写的 link;调试也列在那里。 Sooo 我不确定为什么或如何调试 3.81;也许是它的早期版本。我也不确定为什么调试有效但不能跟踪。我认为这是一个ndk问题。我所做的是直接发出 make,不仅我看到 trace 工作;我没有看到提示我 post 这个问题的错误。这是对 all 与“:”和“::”一起使用的抱怨。我打算在这个 post 上加上一个 ndk 标签,希望有 ndk 专业知识的人能插话。我非常感谢你的帮助。
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。对我来说,一个悬而未决的问题是,我的本机 C 项目(我试图移植到 jni 中的那个项目)使用早期版本的 ndk 中的工具链之一进行编译。所以对我来说,现在得到“::”错误信息似乎表明它是由其他原因引起的。我怀疑这与我试图将 C 项目的 make 文件包含到我的 Android.mk 中有关。虽然我的 Android.mk 没有 all 目标,但是否有隐含的目标?我只是像看报纸一样读了一遍制作手册;我不记得是不是这样。但是有很多隐含的规则。你对此有什么想法吗?
很可能您使用的是旧版本的 GNU make。 GNU make 版本 4.0.
中的--trace
标志 was added
Google 在 ndk 包中使用自定义版本的 GNU Make。您可以尝试使用下载的 make
启动ndk-build
GNUMAKE=`which make` ndk-build
但构成 ndk 核心的 .mk
文件与 make你的道路。