|-test
|---Android.mk
|---Application.mk
|---sub1
|------Android.mk
|------main.c
|---sub2
|------Android.mk
|------main.c

拿上边的文件结构为例

test/Android.mk

include $(call all-subdir-makefiles)

test/sub1/Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -pie -fPIE  
LOCAL_LDFLAGS += -pie -fPIE -llog
TARGET_PLATFORM := android-22 
LOCAL_MODULE := module1
LOCAL_SRC_FILES := main.c
include $(BUILD_EXECUTABLE)

test/sub2/Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
ARGET_PLATFORM := android-22
LOCAL_MODULE := module2
LOCAL_SRC_FILES := main.c
include $(BUILD_SHARED_LIBRARY) 

原理就是 all-subdir-makefiles 这个宏会返子文件夹下所有Android.mk文件的路径

相关文章:

  • 2021-04-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-02-13
  • 2021-11-08
猜你喜欢
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2021-07-31
  • 2022-03-03
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案