对于Android的目标压倒一切的Makefile命令 [英] Overriding commands for target Android Makefile
问题描述
我试图编译模块之一在我的Android NDK的项目使用g ++虽然来源都在C.
我的眼睛是由make系统警告激怒了:
I am trying to compile one of the modules in my Android ndk project with g++ although the sources are all in C. My eyes are irritated by the make system warnings:
`C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:348: warning: overriding commands for target 'obj/local/armeabi/objs/xxx/yyy.o'`
`C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:345: warning: ignoring old commands for target 'obj/local/armeabi/objs/xxx/yyy.o'`
和这些警告对将被打印之多会有源文件,因此,对象
And these warning pairs will be printed as much as there will be the source files and therefore the objects.
我已经试过所有不同的口味来声明LOCAL_SRC_FILES。
I've tried to declare LOCAL_SRC_FILES with all the different flavors.
`LOCAL_SRC_FILES :=
$(LOCAL_PATH)/Directory/source.c
$(notdir $(wildcard $(LOCAL_PATH)/*.c))
$(notdir $(wildcard $(LOCAL_PATH)/Directory/*.c))
$(addprefix DirectoryPrefix/,$(notdir $(wildcard $(LOCAL_PATH)/Directory/*.c)))`
和仍然警告仍然存在。结果
制作文件说:结果
警告:对目标压倒一切的XXX命令''
警告:无视旧命令为目标XXX''
使用GNU make允许命令每个目标只有一次被指定(除了双冒号规则)。如果你给的命令对于已经被定义为具有命令的目标,这发出警告,第二组命令将覆盖第一盘。
And still the warning persists.
Make document says:
warning: overriding commands for target xxx''
warning: ignoring old commands for target xxx''
GNU make allows commands to be specified only once per target (except for double-colon rules). If you give commands for a target which already has been defined to have commands, this warning is issued and the second set of commands will overwrite the first set.
但我不明白这是如何在所有有关。
处理后似乎作出的g ++编译论文C文件,使这一警告出现。结果
因此,指定此声明:结果
LOCAL_CPP_EXTENSION:= .C
结果
这使得C文件建立与g ++的原因造成的。因为用gcc编译时没有警告被打印出来。
But I cannot understand how this is related at all.
After dealing with it seems like making a g++ compile theses C files makes this warning appear.
Therefore specifying this statement:
LOCAL_CPP_EXTENSION := .c
Which makes C files build with g++ is causing it. Because when compiling with gcc no warnings are printed.
推荐答案
请确保您已明确包括瓦尔:
Make sure that you have included clear vars:
include $(CLEAR_VARS)
如果构建一个包含正确的宏观构建像
And if building any other libraries that you include the correct build macro like
include $(BUILD_SHARED_LIBRARY)
我碰上这种一两天以前,同时加入我忘了包括一个或另一个(我觉得CLEAR_VARS最有意义。)一个新的图书馆是因此被重新追加从一些值主库的小孩图书馆,反之亦然。
I had run into this a day or two ago and it was while adding a new library I had forgotten to include one or the other (I think the CLEAR_VARS makes most sense.) So it was re-appending some values from the main library to the child library or vice versa.
这篇关于对于Android的目标压倒一切的Makefile命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!