c++ - android.mk sdl building errors -
i've looked around @ questions writing android.mk files , "make: * no rule make target .c needed .o"** center around typos don't think have.
this sdl project builds fine cmake build scripts can't android.mk work me.
here's project setup in cmake
cmake_minimum_required(version 2.8) project(blp) #set(cmake_macosx_rpath 1) set(cmake_archive_output_directory ${cmake_binary_dir}/lib) set(cmake_library_output_directory ${cmake_binary_dir}/lib) set(cmake_runtime_output_directory ${cmake_binary_dir}/bin) set(cmake_module_path ${project_source_dir}/cmake_modules) find_package(sdl2 required) include_directories(${sdl2_include_dir}) include_directories("${project_source_dir}/source/core_math") include_directories("${project_source_dir}/source/utils/time_utils") include_directories("${project_source_dir}/source/utils/resource_utils") include_directories("${project_source_dir}/source/ren_opengl") include_directories("${project_source_dir}/source/core_engine") include_directories("${project_source_dir}/source/components/renderable2d") include_directories("${project_source_dir}/source/glm/vec3.hpp") find_package(sdl2 required) include_directories(${sdl2_include_dir}) find_package(sdl2_image) include_directories(${sdl2_image_include_dir}) add_subdirectory(source) add_subdirectory(project) set(src_files main.c) set(external_target_libs ${sdl2_library} ${sdl2_image_library}) set(components renderable2d) set(internal_target_libs core_math time_utils resource_utils ren_opengl) set(target_libs ${internal_target_libs} ${external_target_libs} ${components}) file(copy ${cmake_current_source_dir}/resources/ destination ${cmake_current_binary_dir}/bin/resources/)
the project subfolder can create different projects , reuse source dynamic libs create.
inside source, can see have bunch of dynamic libs created. @ end there's dynamic libs , 1 .h , .c class imports of them, import 1 .h file inside project use libs.
now onto android.mk file, it's not complete yet running trouble.
local_path := $(call my-dir) include $(clear_vars) local_module := main sdl_path := ../sdl local_c_includes := $(local_path)/$(sdl_path)/include/ local_c_includes += $(local_path)/src/utils/time_utils/ # add application source files here... local_src_files := $(sdl_path)/src/main/android/sdl_android_main.c \ utils/time_utils.c \ //removing above line, core_engine.c throws import error //adding above line error listed @ bottom core_engine/core_engine.c \ project.c local_shared_libraries := sdl2 local_ldlibs := -lglesv1_cm -lglesv2 -llog include $(build_shared_library) make: *** no rule make target `/users/blubee/sdl/android-project/jni/src/time_utils/time_utils.c', needed `/users/blubee/sdl/android-project/obj/local/armeabi/objs/main/time_utils/time_utils.o'. stop.
each lib under it's own folder int project source tree this
source/components/renderable2d/renderable2d.c /.h source/core_engine/core_engine.c /.h source/core_math/mat4_scalar/mat4_scalar.c /.h source/core_math/vec3_scalar/vec3_scalar.c /.h source/.. etc...
it build oder or order in defining sources files in android.mk folder, not sure. suggestions? made sure there's no typos or spaces in environment variables or source file android.mk
it seems android.mk lot more sensitive header include order more cmake.
i simplified project main.c #include "sdl.h" , builds fine.
i go there , learn android.mk, while it's similar cmake it's lot more picky.
Comments
Post a Comment