Put a sample first, and then explain:
1Local_path:= $ (Call my-dir)2 include $ (clear_vars)3Local_module: =Mydjvuapi4Src_file_of_mine: =5 Classify.cpp6 cuts.cpp \7includes_file_of_mine:= \8 $ (Local_path)/.. /Myjpeginterface9 $ (Local_path)/.. /MytiffinterfaceTen static_libraries_of_mine:=mupdf djvudroidOne local_cflags: =-dhave_config_h Local_c_includes: =$ (includes_file_of_mine)Local_cxx_includes: =$ (includes_file_of_mine)Local_src_files: =$ (src_file_of_mine)Local_static_libraries: =$ (static_libraries_of_mine)Include $ (build_static_library)
First introduce two small common sense: $ means reference, for example, the above-written $ (local_path) means to use the value of Local_path; /represents the top level directory of the current directory; the character \ denotes the meaning of the newline; the ones that follow the of_mine are the variables that are defined by the programmer, and most people like to start with My_, which is a personal preference.
local_path:=$ (call My-dir) This is to determine the current directory. My-dir is a system-defined, obtains the current your android.mk file is the path, of course, you can also specify;
Include $ (clear_vars): Guess you can guess what he meant clear variables, clear variables, but note that he cleared the variables except Local_path;
Src_fileof_mine: As mentioned above, this is a variable of your own definition.
Local_cflags: This thing, if just write a simple program to create a library, generally do not use him. His role is to decide which part of the library compiles the code at compile time, and the real implementation code chooses the correct code to compile on different platforms. For example, to join me with a code like this #ifdef use #include "amethod.h" #endif, then I just write a local_cflags:=-duse in the Mk file so that when the library is built it will execute # include " Amethod.h "This piece of code;
Loca_c_cinclude: This indicates your compile time if you encounter a header file that you do not know, you should look under what path
Cocal_cxx_include: This I do not play clearly, it seems to be to your change file, but what is the difference? Personal feeling should be the top one looking for C header file, below this look for C + + header file. I don't know about that.
Local_src_files: This fatal source file to compile;
Local_static_libraries: This indicates that the library to be generated needs to rely on other static libraries; changing the middle static to shared is a dynamic library;
Include (build_static_library): Generate static library, change static to shared is dynamic library.
======================================================
===== beginners, not in-depth research, personal understanding, if there are errors, look, MO offense! =============
======================================================
A brief introduction to the Android.mk file in the NDK