i want to build my android project with ndk so i created my make file like this :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := game_logic
LOCAL_SRC_FILES := AppDelegate.cpp\
MainMenuScene.cpp\
ArtTestScene.cpp\
AppDelegate.cpp\
objb/Config.cpp\
objb/ExtendedString.cpp\
objb/json.cpp\
objb/TimeStamper.cpp \
Objects/Actor.cpp \
Objects/BackGround.cpp \
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../cocos2dx \
$(LOCAL_PATH)/../../cocos2dx/platform \
$(LOCAL_PATH)/../../cocos2dx/include \
$(LOCAL_PATH)/../../CocosDenshion/include \
$(LOCAL_PATH)/../../cocos2dx/lua_support \
objb \
LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../android/libs/$(TARGET_ARCH_ABI)) \
-lcocos2d -lcocosdenshion \
-L$(call host-path, $(LOCAL_PATH)/../../cocos2dx/platform/third_party/android/libraries/$(TARGET_ARCH_ABI)) -lcurl
include $(BUILD_SHARED_LIBRARY)
problom is i get this error :
jni/../../Classes/Android.mk:12: *** recipe commences before first target. Stop.
but when i reduce source file (any source file) i did not get this error! but my project never built because required source files not built
What this error means is that (a) there is a line that starts with a TAB character, and (b) it’s not any other kind of line make knows about (such as a variable assignment etc.)
In this case make assumes that the line is intended to be part of the recipe for a rule, but there is no rule (no target) before it.
The problem is that your line:
has a space after the backslash. Because of that, the backslash is not escaping the newline and so make doesn’t think that the next line is part of the variable assignment. Since it begins with a TAB…
It’s critical in makefiles to ensure you don’t have any extraneous trailing whitespace. Many modern editors have modes which will show this: enable them when editing makefiles.