1# Copyright (C) 2009 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15 16# this file is included repeatedly from build/core/main.mk and is used 17# to setup the target toolchain for a given platform/abi combination. 18# 19 20$(call assert-defined,TARGET_TOOLCHAIN TARGET_PLATFORM TARGET_ARCH TARGET_ARCH_ABI) 21$(call assert-defined,NDK_APPS) 22 23TARGET_ABI := $(TARGET_PLATFORM)-$(TARGET_ARCH_ABI) 24 25# setup sysroot-related variables. The SYSROOT point to a directory 26# that contains all public header files for a given platform, plus 27# some libraries and object files used for linking the generated 28# target files properly. 29# 30SYSROOT := build/platforms/$(TARGET_PLATFORM)/arch-$(TARGET_ARCH_ABI) 31 32TARGET_CRTBEGIN_STATIC_O := $(SYSROOT)/usr/lib/crtbegin_static.o 33TARGET_CRTBEGIN_DYNAMIC_O := $(SYSROOT)/usr/lib/crtbegin_dynamic.o 34TARGET_CRTEND_O := $(SYSROOT)/usr/lib/crtend_android.o 35 36TARGET_PREBUILT_SHARED_LIBRARIES := libc libstdc++ libm 37TARGET_PREBUILT_SHARED_LIBRARIES := $(TARGET_PREBUILT_SHARED_LIBRARIES:%=$(SYSROOT)/usr/lib/%.so) 38 39# now call the toolchain-specific setup script 40include $(NDK_TOOLCHAIN.$(TARGET_TOOLCHAIN).setup) 41 42# compute NDK_APP_DEST as the destination directory for the generated files 43NDK_APP_DEST := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ABI_SUBDIR) 44 45# free the dictionary of LOCAL_MODULE definitions 46$(call modules-clear) 47 48# now parse the Android.mk for the application 49include $(NDK_APP_BUILD_SCRIPT) 50