title: Android.mk - build all source file in a directory
body: <p>I am using Android NDK to build my cocos2dx project, within the Android.mk, there is a definition for LOCAL_SRC_FILES where each of the cpp file are listed. Whenever I added a new source file, I'd need to add it there as well... it looks like this:</p>
  
  <pre><code>LOCAL_SRC_FILES := hellocpp/main.cpp \
                     hellocpp/myclass.cpp \
                     hellocpp/mynextclass.cpp \
                     ../../Classes/Screens/LaunchScreen.cpp \
  </code></pre>
  
  <p>the header file, however, can specify the entire directory to include, it looks like this:</p>
  
  <pre><code>LOCAL_C_INCLUDES := $(LOCAL_PATH)/hellocpp
  LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes/Screens
  </code></pre>
  
  <p>I have tried various ways to include the whole directory instead of single file for the <code>LOCAL_SRC_FILES</code> so that I don't need to modify the Android.mk build script whenever I add a new file, however, so far all my attempts failed.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>#SRC_PATH_HELLOCPP := $(wildcard hellocpp/*.cpp)
  #SRC_PATH_CLASSES += $(wildcard ../../Classes/*.cpp)
  
  #LOCAL_SRC_FILES := $(SRC_PATH_HELLOCPP:$(LOCAL_PATH/%=%)
  #LOCAL_SRC_FILES += $(SRC_PATH_CLASSES:$(LOCAL_PATH/%=%)
  </code></pre>
  
  <p>as well as this:</p>
  
  <pre><code>#LOCAL_SRC_FILES += hellocpp/*.cpp
  #LOCAL_SRC_FILES += ../../Classes/*.cpp
  </code></pre>
  
  <p>both are not working...</p>
  
  <p>I have another project that works well with the first option though, I really do not understand why it doesn't work in the cocos2dx project... does anybody know why or know the solution? Or maybe I should just leave it as is and take the trouble, since everybody is doing that., but it is really troublesome, hope somebody can help so that all of us can be more productive..</p>
  
  <p>Thanks!</p>