The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # This is included by the top-level Makefile. |
| 2 | # It sets up standard variables based on the |
| 3 | # current configuration and platform, which |
| 4 | # are not specific to what is being built. |
| 5 | |
Ying Wang | 6714dbc | 2010-03-30 16:42:15 -0700 | [diff] [blame] | 6 | # Only use ANDROID_BUILD_SHELL to wrap around bash. |
| 7 | # DO NOT use other shells such as zsh. |
Ying Wang | 2ce495a | 2010-03-30 12:55:13 -0700 | [diff] [blame] | 8 | ifdef ANDROID_BUILD_SHELL |
| 9 | SHELL := $(ANDROID_BUILD_SHELL) |
| 10 | else |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 11 | # Use bash, not whatever shell somebody has installed as /bin/sh |
| 12 | # This is repeated from main.mk, since envsetup.sh runs this file |
| 13 | # directly. |
| 14 | SHELL := /bin/bash |
Ying Wang | 2ce495a | 2010-03-30 12:55:13 -0700 | [diff] [blame] | 15 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 16 | |
Joe Onorato | bc8abb6 | 2010-01-04 12:57:38 -0800 | [diff] [blame] | 17 | # Tell python not to spam the source tree with .pyc files. This |
| 18 | # only has an effect on python 2.6 and above. |
| 19 | export PYTHONDONTWRITEBYTECODE := 1 |
| 20 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 21 | # Standard source directories. |
| 22 | SRC_DOCS:= $(TOPDIR)docs |
| 23 | # TODO: Enforce some kind of layering; only add include paths |
| 24 | # when a module links against a particular library. |
| 25 | # TODO: See if we can remove most of these from the global list. |
| 26 | SRC_HEADERS := \ |
| 27 | $(TOPDIR)system/core/include \ |
| 28 | $(TOPDIR)hardware/libhardware/include \ |
| 29 | $(TOPDIR)hardware/libhardware_legacy/include \ |
| 30 | $(TOPDIR)hardware/ril/include \ |
| 31 | $(TOPDIR)dalvik/libnativehelper/include \ |
| 32 | $(TOPDIR)frameworks/base/include \ |
| 33 | $(TOPDIR)frameworks/base/opengl/include \ |
Dianne Hackborn | 93b0160 | 2010-05-04 11:31:59 -0700 | [diff] [blame] | 34 | $(TOPDIR)frameworks/base/native/include \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 35 | $(TOPDIR)external/skia/include |
| 36 | SRC_HOST_HEADERS:=$(TOPDIR)tools/include |
| 37 | SRC_LIBRARIES:= $(TOPDIR)libs |
| 38 | SRC_SERVERS:= $(TOPDIR)servers |
| 39 | SRC_TARGET_DIR := $(TOPDIR)build/target |
| 40 | SRC_API_DIR := $(TOPDIR)frameworks/base/api |
| 41 | |
| 42 | # Some specific paths to tools |
| 43 | SRC_DROIDDOC_DIR := $(TOPDIR)build/tools/droiddoc |
| 44 | |
| 45 | # Various mappings to avoid hard-coding paths all over the place |
| 46 | include $(BUILD_SYSTEM)/pathmap.mk |
| 47 | |
| 48 | # ############################################################### |
| 49 | # Build system internal files |
| 50 | # ############################################################### |
| 51 | |
| 52 | BUILD_COMBOS:= $(BUILD_SYSTEM)/combo |
| 53 | |
| 54 | CLEAR_VARS:= $(BUILD_SYSTEM)/clear_vars.mk |
| 55 | BUILD_HOST_STATIC_LIBRARY:= $(BUILD_SYSTEM)/host_static_library.mk |
| 56 | BUILD_HOST_SHARED_LIBRARY:= $(BUILD_SYSTEM)/host_shared_library.mk |
| 57 | BUILD_STATIC_LIBRARY:= $(BUILD_SYSTEM)/static_library.mk |
| 58 | BUILD_RAW_STATIC_LIBRARY := $(BUILD_SYSTEM)/raw_static_library.mk |
| 59 | BUILD_SHARED_LIBRARY:= $(BUILD_SYSTEM)/shared_library.mk |
| 60 | BUILD_EXECUTABLE:= $(BUILD_SYSTEM)/executable.mk |
| 61 | BUILD_RAW_EXECUTABLE:= $(BUILD_SYSTEM)/raw_executable.mk |
| 62 | BUILD_HOST_EXECUTABLE:= $(BUILD_SYSTEM)/host_executable.mk |
| 63 | BUILD_PACKAGE:= $(BUILD_SYSTEM)/package.mk |
| 64 | BUILD_HOST_PREBUILT:= $(BUILD_SYSTEM)/host_prebuilt.mk |
| 65 | BUILD_PREBUILT:= $(BUILD_SYSTEM)/prebuilt.mk |
| 66 | BUILD_MULTI_PREBUILT:= $(BUILD_SYSTEM)/multi_prebuilt.mk |
| 67 | BUILD_JAVA_LIBRARY:= $(BUILD_SYSTEM)/java_library.mk |
| 68 | BUILD_STATIC_JAVA_LIBRARY:= $(BUILD_SYSTEM)/static_java_library.mk |
| 69 | BUILD_HOST_JAVA_LIBRARY:= $(BUILD_SYSTEM)/host_java_library.mk |
| 70 | BUILD_DROIDDOC:= $(BUILD_SYSTEM)/droiddoc.mk |
| 71 | BUILD_COPY_HEADERS := $(BUILD_SYSTEM)/copy_headers.mk |
| 72 | BUILD_KEY_CHAR_MAP := $(BUILD_SYSTEM)/key_char_map.mk |
Ying Wang | 4c68174 | 2010-07-20 11:08:47 -0700 | [diff] [blame] | 73 | BUILD_NATIVE_TEST := $(BUILD_SYSTEM)/native_test.mk |
| 74 | BUILD_HOST_NATIVE_TEST := $(BUILD_SYSTEM)/host_native_test.mk |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 75 | |
| 76 | # ############################################################### |
| 77 | # Parse out any modifier targets. |
| 78 | # ############################################################### |
| 79 | |
| 80 | # The 'showcommands' goal says to show the full command |
| 81 | # lines being executed, instead of a short message about |
| 82 | # the kind of operation being done. |
| 83 | SHOW_COMMANDS:= $(filter showcommands,$(MAKECMDGOALS)) |
| 84 | |
| 85 | |
| 86 | # ############################################################### |
| 87 | # Set common values |
| 88 | # ############################################################### |
| 89 | |
| 90 | # These can be changed to modify both host and device modules. |
Marco Nelissen | e4aaa36 | 2009-07-13 20:42:49 -0700 | [diff] [blame] | 91 | COMMON_GLOBAL_CFLAGS:= -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 92 | COMMON_RELEASE_CFLAGS:= -DNDEBUG -UDEBUG |
| 93 | |
Marco Nelissen | 7f0a18f | 2009-08-13 11:13:21 -0700 | [diff] [blame] | 94 | COMMON_GLOBAL_CPPFLAGS:= $(COMMON_GLOBAL_CFLAGS) -Wsign-promo |
Marco Nelissen | 73a075d | 2009-07-08 17:51:18 -0700 | [diff] [blame] | 95 | COMMON_RELEASE_CPPFLAGS:= $(COMMON_RELEASE_CFLAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 96 | |
| 97 | # Set the extensions used for various packages |
| 98 | COMMON_PACKAGE_SUFFIX := .zip |
| 99 | COMMON_JAVA_PACKAGE_SUFFIX := .jar |
| 100 | COMMON_ANDROID_PACKAGE_SUFFIX := .apk |
| 101 | |
| 102 | # list of flags to turn specific warnings in to errors |
Marco Nelissen | bac9a7f | 2009-07-13 17:51:59 -0700 | [diff] [blame] | 103 | TARGET_ERROR_FLAGS := -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 104 | |
Patrick Scott | f4f85a2 | 2009-06-25 10:38:26 -0400 | [diff] [blame] | 105 | # TODO: do symbol compression |
| 106 | TARGET_COMPRESS_MODULE_SYMBOLS := false |
| 107 | |
| 108 | # Default is to prelink modules. |
| 109 | TARGET_PRELINK_MODULE := true |
| 110 | |
Thorsten Glaser | 2213aab | 2010-06-03 19:57:02 +0200 | [diff] [blame] | 111 | # Default shell is ash. Other possible value is mksh. |
| 112 | TARGET_SHELL := ash |
| 113 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 114 | # ############################################################### |
| 115 | # Include sub-configuration files |
| 116 | # ############################################################### |
| 117 | |
| 118 | # --------------------------------------------------------------- |
| 119 | # Try to include buildspec.mk, which will try to set stuff up. |
| 120 | # If this file doesn't exist, the environemnt variables will |
| 121 | # be used, and if that doesn't work, then the default is an |
| 122 | # arm build |
| 123 | -include $(TOPDIR)buildspec.mk |
| 124 | |
| 125 | # --------------------------------------------------------------- |
| 126 | # Define most of the global variables. These are the ones that |
| 127 | # are specific to the user's build configuration. |
| 128 | include $(BUILD_SYSTEM)/envsetup.mk |
| 129 | |
Patrick Scott | 87c8657 | 2009-06-23 15:25:06 -0400 | [diff] [blame] | 130 | # Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE) |
| 131 | # or under vendor/*/$(TARGET_DEVICE). Search in both places, but |
| 132 | # make sure only one exists. |
| 133 | # Real boards should always be associated with an OEM vendor. |
| 134 | board_config_mk := \ |
| 135 | $(strip $(wildcard \ |
| 136 | $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \ |
Jean-Baptiste Queru | 8d05416 | 2010-01-22 13:25:24 -0800 | [diff] [blame] | 137 | device/*/$(TARGET_DEVICE)/BoardConfig.mk \ |
Patrick Scott | 87c8657 | 2009-06-23 15:25:06 -0400 | [diff] [blame] | 138 | vendor/*/$(TARGET_DEVICE)/BoardConfig.mk \ |
| 139 | )) |
| 140 | ifeq ($(board_config_mk),) |
| 141 | $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE)) |
| 142 | endif |
| 143 | ifneq ($(words $(board_config_mk)),1) |
| 144 | $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk)) |
| 145 | endif |
| 146 | include $(board_config_mk) |
| 147 | TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk))) |
| 148 | board_config_mk := |
| 149 | |
| 150 | # Clean up/verify variables defined by the board config file. |
| 151 | TARGET_BOOTLOADER_BOARD_NAME := $(strip $(TARGET_BOOTLOADER_BOARD_NAME)) |
| 152 | TARGET_CPU_ABI := $(strip $(TARGET_CPU_ABI)) |
| 153 | ifeq ($(TARGET_CPU_ABI),) |
| 154 | $(error No TARGET_CPU_ABI defined by board config: $(board_config_mk)) |
| 155 | endif |
David 'Digit' Turner | 2edfb71 | 2009-11-06 15:12:00 -0800 | [diff] [blame] | 156 | TARGET_CPU_ABI2 := $(strip $(TARGET_CPU_ABI2)) |
Patrick Scott | 87c8657 | 2009-06-23 15:25:06 -0400 | [diff] [blame] | 157 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 158 | # $(1): os/arch |
| 159 | define select-android-config-h |
| 160 | system/core/include/arch/$(1)/AndroidConfig.h |
| 161 | endef |
| 162 | |
| 163 | combo_target := HOST_ |
| 164 | include $(BUILD_SYSTEM)/combo/select.mk |
| 165 | |
| 166 | # on windows, the tools have .exe at the end, and we depend on the |
| 167 | # host config stuff being done first |
| 168 | |
| 169 | combo_target := TARGET_ |
| 170 | include $(BUILD_SYSTEM)/combo/select.mk |
| 171 | |
| 172 | # Pick a Java compiler. |
| 173 | include $(BUILD_SYSTEM)/combo/javac.mk |
| 174 | |
| 175 | # --------------------------------------------------------------- |
| 176 | # Check that the configuration is current. We check that |
| 177 | # BUILD_ENV_SEQUENCE_NUMBER is current against this value. |
| 178 | # Don't fail if we're called from envsetup, so they have a |
| 179 | # chance to update their environment. |
| 180 | |
| 181 | ifeq (,$(strip $(CALLED_FROM_SETUP))) |
| 182 | ifneq (,$(strip $(BUILD_ENV_SEQUENCE_NUMBER))) |
| 183 | ifneq ($(BUILD_ENV_SEQUENCE_NUMBER),$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER)) |
| 184 | $(warning BUILD_ENV_SEQUENCE_NUMBER is set incorrectly.) |
| 185 | $(info *** If you use envsetup/lunch/choosecombo:) |
| 186 | $(info *** - Re-execute envsetup (". envsetup.sh")) |
| 187 | $(info *** - Re-run lunch or choosecombo) |
| 188 | $(info *** If you use buildspec.mk:) |
| 189 | $(info *** - Look at buildspec.mk.default to see what has changed) |
| 190 | $(info *** - Update BUILD_ENV_SEQUENCE_NUMBER to "$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER)") |
| 191 | $(error bailing..) |
| 192 | endif |
| 193 | endif |
| 194 | endif |
| 195 | |
| 196 | |
| 197 | # --------------------------------------------------------------- |
| 198 | # Generic tools. |
| 199 | |
| 200 | LEX:= flex |
| 201 | YACC:= bison -d |
| 202 | DOXYGEN:= doxygen |
| 203 | AAPT := $(HOST_OUT_EXECUTABLES)/aapt$(HOST_EXECUTABLE_SUFFIX) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 204 | AIDL := $(HOST_OUT_EXECUTABLES)/aidl$(HOST_EXECUTABLE_SUFFIX) |
| 205 | ICUDATA := $(HOST_OUT_EXECUTABLES)/icudata$(HOST_EXECUTABLE_SUFFIX) |
| 206 | SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) |
| 207 | MKBOOTFS := $(HOST_OUT_EXECUTABLES)/mkbootfs$(HOST_EXECUTABLE_SUFFIX) |
Doug Zongker | 8b70e8c | 2009-05-27 09:14:25 -0700 | [diff] [blame] | 208 | MINIGZIP := $(HOST_OUT_EXECUTABLES)/minigzip$(HOST_EXECUTABLE_SUFFIX) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 209 | MKBOOTIMG := $(HOST_OUT_EXECUTABLES)/mkbootimg$(HOST_EXECUTABLE_SUFFIX) |
| 210 | MKYAFFS2 := $(HOST_OUT_EXECUTABLES)/mkyaffs2image$(HOST_EXECUTABLE_SUFFIX) |
| 211 | APICHECK := $(HOST_OUT_EXECUTABLES)/apicheck$(HOST_EXECUTABLE_SUFFIX) |
| 212 | FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX) |
| 213 | MKEXT2IMG := $(HOST_OUT_EXECUTABLES)/genext2fs$(HOST_EXECUTABLE_SUFFIX) |
Colin Cross | 9dd4ba8 | 2010-08-03 14:43:15 -0700 | [diff] [blame] | 214 | MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/make_ext4fs$(HOST_EXECUTABLE_SUFFIX) |
Ying Wang | c79f4da | 2010-06-16 14:58:50 -0700 | [diff] [blame] | 215 | MKEXT2USERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg.sh |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 216 | MKEXT2BOOTIMG := external/genext2fs/mkbootimg_ext2.sh |
| 217 | MKTARBALL := build/tools/mktarball.sh |
Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 218 | TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX) |
| 219 | E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX) |
Steve Howard | ef5c640 | 2010-05-03 15:01:38 -0700 | [diff] [blame] | 220 | JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar |
Joe Onorato | 2daa2b3 | 2009-08-30 13:39:24 -0700 | [diff] [blame] | 221 | PROGUARD := external/proguard/bin/proguard.sh |
Doug Zongker | 9bd4962 | 2009-11-30 14:28:59 -0800 | [diff] [blame] | 222 | JAVATAGS := build/tools/java-event-log-tags.py |
Ying Wang | 0bd59a0 | 2010-07-15 17:17:52 -0700 | [diff] [blame] | 223 | SLANG := $(HOST_OUT_EXECUTABLES)/slang$(HOST_EXECUTABLE_SUFFIX) |
Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 224 | DEXOPT := $(HOST_OUT_EXECUTABLES)/dexopt$(HOST_EXECUTABLE_SUFFIX) |
| 225 | DEXPREOPT := dalvik/tools/dex-preopt |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 226 | |
Raphael | 9ca1628 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 227 | # ACP is always for the build OS, not for the host OS |
| 228 | ACP := $(BUILD_OUT_EXECUTABLES)/acp$(BUILD_EXECUTABLE_SUFFIX) |
| 229 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 230 | # dx is java behind a shell script; no .exe necessary. |
| 231 | DX := $(HOST_OUT_EXECUTABLES)/dx |
| 232 | KCM := $(HOST_OUT_EXECUTABLES)/kcm$(HOST_EXECUTABLE_SUFFIX) |
| 233 | ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign$(HOST_EXECUTABLE_SUFFIX) |
| 234 | FINDBUGS := prebuilt/common/findbugs/bin/findbugs |
| 235 | LOCALIZE := $(HOST_OUT_EXECUTABLES)/localize$(HOST_EXECUTABLE_SUFFIX) |
| 236 | EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX) |
| 237 | |
| 238 | # Binary prelinker/compressor tools |
| 239 | APRIORI := $(HOST_OUT_EXECUTABLES)/apriori$(HOST_EXECUTABLE_SUFFIX) |
| 240 | LSD := $(HOST_OUT_EXECUTABLES)/lsd$(HOST_EXECUTABLE_SUFFIX) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 241 | |
| 242 | # Deal with archaic version of bison on Mac OS X. |
| 243 | ifeq ($(filter 1.28,$(shell $(YACC) -V)),) |
| 244 | YACC_HEADER_SUFFIX:= .hpp |
| 245 | else |
| 246 | YACC_HEADER_SUFFIX:= .cpp.h |
| 247 | endif |
| 248 | |
| 249 | # Don't use column under Windows, cygwin or not |
| 250 | ifeq ($(HOST_OS),windows) |
| 251 | COLUMN:= cat |
| 252 | else |
| 253 | COLUMN:= column |
| 254 | endif |
| 255 | |
| 256 | dir := $(shell uname) |
| 257 | ifeq ($(HOST_OS),windows) |
| 258 | dir := $(HOST_OS) |
| 259 | endif |
| 260 | ifeq ($(HOST_OS),darwin) |
| 261 | dir := $(HOST_OS)-$(HOST_ARCH) |
| 262 | endif |
| 263 | OLD_FLEX := prebuilt/$(HOST_PREBUILT_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX) |
| 264 | |
| 265 | ifeq ($(HOST_OS),darwin) |
| 266 | # Mac OS' screwy version of java uses a non-standard directory layout |
| 267 | # and doesn't even seem to have tools.jar. On the other hand, javac seems |
| 268 | # to be able to magically find the classes in there, wherever they are, so |
| 269 | # leave this blank |
| 270 | HOST_JDK_TOOLS_JAR := |
| 271 | else |
| 272 | HOST_JDK_TOOLS_JAR:= $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh) |
Ying Wang | ec5e729 | 2010-04-26 18:36:52 -0700 | [diff] [blame] | 273 | ifeq ($(wildcard $(HOST_JDK_TOOLS_JAR)),) |
Ying Wang | 31a9570 | 2010-09-22 17:45:35 -0700 | [diff] [blame^] | 274 | $(error Error: could not find jdk tools.jar, please install JDK6, \ |
Ying Wang | 1613f4f | 2010-09-22 14:11:49 -0700 | [diff] [blame] | 275 | which you can download from java.sun.com) |
Ying Wang | ec5e729 | 2010-04-26 18:36:52 -0700 | [diff] [blame] | 276 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 277 | endif |
| 278 | |
| 279 | # It's called md5 on Mac OS and md5sum on Linux |
| 280 | ifeq ($(HOST_OS),darwin) |
| 281 | MD5SUM:=md5 -q |
| 282 | else |
| 283 | MD5SUM:=md5sum |
| 284 | endif |
| 285 | |
| 286 | # ############################################################### |
| 287 | # Set up final options. |
| 288 | # ############################################################### |
| 289 | |
| 290 | HOST_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 291 | HOST_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS) |
| 292 | |
| 293 | HOST_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 294 | HOST_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS) |
| 295 | |
| 296 | TARGET_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 297 | TARGET_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS) |
| 298 | |
| 299 | TARGET_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 300 | TARGET_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS) |
| 301 | |
| 302 | HOST_GLOBAL_LD_DIRS += -L$(HOST_OUT_INTERMEDIATE_LIBRARIES) |
| 303 | TARGET_GLOBAL_LD_DIRS += -L$(TARGET_OUT_INTERMEDIATE_LIBRARIES) |
| 304 | |
| 305 | HOST_PROJECT_INCLUDES:= $(SRC_HEADERS) $(SRC_HOST_HEADERS) $(HOST_OUT_HEADERS) |
| 306 | TARGET_PROJECT_INCLUDES:= $(SRC_HEADERS) $(TARGET_OUT_HEADERS) |
| 307 | |
| 308 | # Many host compilers don't support these flags, so we have to make |
| 309 | # sure to only specify them for the target compilers checked in to |
Dave Bort | 9528248 | 2009-04-23 18:44:55 -0700 | [diff] [blame] | 310 | # the source tree. The simulator passes the target flags to the |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 311 | # host compiler, so only set them for the target when the target |
| 312 | # is not the simulator. |
| 313 | ifneq ($(TARGET_SIMULATOR),true) |
| 314 | TARGET_GLOBAL_CFLAGS += $(TARGET_ERROR_FLAGS) |
| 315 | TARGET_GLOBAL_CPPFLAGS += $(TARGET_ERROR_FLAGS) |
| 316 | endif |
| 317 | |
Dave Bort | 9528248 | 2009-04-23 18:44:55 -0700 | [diff] [blame] | 318 | HOST_GLOBAL_CFLAGS += $(HOST_RELEASE_CFLAGS) |
| 319 | HOST_GLOBAL_CPPFLAGS += $(HOST_RELEASE_CPPFLAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 320 | |
Dave Bort | 9528248 | 2009-04-23 18:44:55 -0700 | [diff] [blame] | 321 | TARGET_GLOBAL_CFLAGS += $(TARGET_RELEASE_CFLAGS) |
| 322 | TARGET_GLOBAL_CPPFLAGS += $(TARGET_RELEASE_CPPFLAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 323 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 324 | PREBUILT_IS_PRESENT := $(if $(wildcard prebuilt/Android.mk),true) |
| 325 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 326 | # ############################################################### |
| 327 | # Collect a list of the SDK versions that we could compile against |
| 328 | # For use with the LOCAL_SDK_VERSION variable for include $(BUILD_PACKAGE) |
| 329 | # ############################################################### |
| 330 | |
Ying Wang | 0f6f4ca | 2010-06-09 10:26:26 -0700 | [diff] [blame] | 331 | HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilt/sdk |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 332 | HISTORICAL_NDK_VERSIONS_ROOT := $(TOPDIR)prebuilt/ndk |
Ying Wang | 0f6f4ca | 2010-06-09 10:26:26 -0700 | [diff] [blame] | 333 | |
| 334 | # Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N. |
| 335 | # The 'current' version is whatever this source tree is. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 336 | # |
| 337 | # sgrax is the opposite of xargs. It takes the list of args and puts them |
| 338 | # on each line for sort to process. |
| 339 | # sort -g is a numeric sort, so 1 2 3 10 instead of 1 10 2 3. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 340 | |
Ying Wang | 0f6f4ca | 2010-06-09 10:26:26 -0700 | [diff] [blame] | 341 | # Numerically sort a list of numbers |
| 342 | # $(1): the list of numbers to be sorted |
| 343 | define numerically_sort |
| 344 | $(shell function sgrax() { \ |
| 345 | while [ -n "$$1" ] ; do echo $$1 ; shift ; done \ |
| 346 | } ; \ |
| 347 | ( sgrax $(1) | sort -g ) ) |
| 348 | endef |
| 349 | |
| 350 | TARGET_AVAILABLE_SDK_VERSIONS := current $(call numerically_sort,\ |
| 351 | $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%, \ |
| 352 | $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android.jar))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 353 | |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 354 | TARGET_AVAILABLE_NDK_VERSIONS := $(call numerically_sort,\ |
| 355 | $(patsubst $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r%,%, \ |
| 356 | $(wildcard $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r*))) |
| 357 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 358 | INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.xml |
Gary King | 1e80c29 | 2010-03-08 17:16:57 -0800 | [diff] [blame] | 359 | |
| 360 | include $(BUILD_SYSTEM)/dumpvar.mk |