首页 > 代码库 > 如何输出 android.mk 及 Application.mk 中个变量的值

如何输出 android.mk 及 Application.mk 中个变量的值

想知道 android.mk 及 Application.mk 中各变量的值可以通过新建如下两个.mk文件:

  • PRINT_ANDROID_VARIABLE.mk
  • PRINT_APPLICATION_VARIABLE.mk

 包含到android.mk文件中某位置:

1 include $(LOCAL_PATH)\PRINT_ANDROID_VARIABLE.mk2 include $(LOCAL_PATH)\PRINT_APPLICATION_VARIABLE.mk
View Code

 

文件PRINT_ANDROID_VARIABLE.mk内容如下:

 1 $(warning  CLEAR_VARS = $(CLEAR_VARS)) 2 $(warning  BUILD_SHARED_LIBRARY = $(BUILD_SHARED_LIBRARY)) 3 $(warning  BUILD_STATIC_LIBRARY = $(BUILD_STATIC_LIBRARY)) 4 $(warning  PREBUILT_SHARED_LIBRARY = $(PREBUILT_SHARED_LIBRARY)) 5 $(warning  TARGET_ARCH = $(TARGET_ARCH)) 6 $(warning  TARGET_PLATFORM = $(TARGET_PLATFORM)) 7 $(warning  TARGET_ARCH_ABI = $(TARGET_ARCH_ABI)) 8 $(warning  TARGET_ABI = $(TARGET_ABI)) 9 $(warning  LOCAL_PATH = $(LOCAL_PATH))10 $(warning  LOCAL_MODULE = $(LOCAL_MODULE))11 $(warning  LOCAL_MODULE_FILENAME = $(LOCAL_MODULE_FILENAME))12 $(warning  LOCAL_SRC_FILES = $(LOCAL_SRC_FILES))13 $(warning  LOCAL_CPP_EXTENSION = $(LOCAL_CPP_EXTENSION))14 $(warning  LOCAL_C_INCLUDES = $(LOCAL_C_INCLUDES))15 $(warning  LOCAL_CFLAGS = $(LOCAL_CFLAGS))16 $(warning  LOCAL_CXXFLAGS = $(LOCAL_CXXFLAGS))17 $(warning  LOCAL_CPPFLAGS = $(LOCAL_CPPFLAGS))18 $(warning  LOCAL_STATIC_LIBRARIES = $(LOCAL_STATIC_LIBRARIES))19 $(warning  LOCAL_SHARED_LIBRARIES = $(LOCAL_SHARED_LIBRARIES))20 $(warning  LOCAL_WHOLE_STATIC_LIBRARIES = $(LOCAL_WHOLE_STATIC_LIBRARIES))21 $(warning  LOCAL_LDLIBS = $(LOCAL_LDLIBS))22 $(warning  LOCAL_LDFLAGS = $(LOCAL_LDFLAGS))23 $(warning  LOCAL_ALLOW_UNDEFINED_SYMBOLS = $(LOCAL_ALLOW_UNDEFINED_SYMBOLS))24 $(warning  LOCAL_ARM_MODE = $(LOCAL_ARM_MODE))25 $(warning  LOCAL_ARM_NEON = $(LOCAL_ARM_NEON))26 $(warning  LOCAL_DISABLE_NO_EXECUTE = $(LOCAL_DISABLE_NO_EXECUTE))27 $(warning  LOCAL_DISABLE_RELRO = $(LOCAL_DISABLE_RELRO))28 $(warning  LOCAL_DISABLE_FORMAT_STRING_CHECKS = $(LOCAL_DISABLE_FORMAT_STRING_CHECKS))29 $(warning  LOCAL_EXPORT_CFLAGS = $(LOCAL_EXPORT_CFLAGS))30 $(warning  LOCAL_EXPORT_CPPFLAGS = $(LOCAL_EXPORT_CPPFLAGS))31 $(warning  LOCAL_EXPORT_C_INCLUDES = $(LOCAL_EXPORT_C_INCLUDES))32 $(warning  LOCAL_EXPORT_LDFLAGS = $(LOCAL_EXPORT_LDFLAGS))33 $(warning  LOCAL_EXPORT_LDLIBS = $(LOCAL_EXPORT_LDLIBS))34 $(warning  LOCAL_SHORT_COMMANDS = $(LOCAL_SHORT_COMMANDS))35 $(warning  LOCAL_THIN_ARCHIVE = $(LOCAL_THIN_ARCHIVE))36 $(warning  LOCAL_FILTER_ASM = $(LOCAL_FILTER_ASM))
View Code

 

文件PRINT_APPLICATION_VARIABLE.mk内容如下:

 1 $(warning  APP_PROJECT_PATH = $(APP_PROJECT_PATH)) 2 $(warning  APP_MODULES = $(APP_MODULES)) 3 $(warning  APP_OPTIM = $(APP_OPTIM)) 4 $(warning  APP_CFLAGS = $(APP_CFLAGS)) 5 $(warning  APP_CXXFLAGS = $(APP_CXXFLAGS)) 6 $(warning  APP_CPPFLAGS = $(APP_CPPFLAGS)) 7 $(warning  APP_LDFLAGS = $(APP_LDFLAGS)) 8 $(warning  APP_BUILD_SCRIPT = $(APP_BUILD_SCRIPT)) 9 $(warning  APP_ABI = $(APP_ABI))10 $(warning  APP_PLATFORM = $(APP_PLATFORM))11 $(warning  APP_STL = $(APP_STL))12 $(warning  APP_GNUSTL_FORCE_CPP_FEATURES = $(APP_GNUSTL_FORCE_CPP_FEATURES))13 $(warning  APP_SHORT_COMMANDS = $(APP_SHORT_COMMANDS))14 $(warning  NDK_TOOLCHAIN_VERSION = $(NDK_TOOLCHAIN_VERSION))15 $(warning  APP_PIE = $(APP_PIE))16 $(warning  APP_THIN_ARCHIVE = $(APP_THIN_ARCHIVE))
View Code

 

如何输出 android.mk 及 Application.mk 中个变量的值