Android.mk revision c6af9114fc63accef839c2a413e18ab058f0beff
1# 2# Copyright (C) 2008 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16LOCAL_PATH := $(my-dir) 17include $(CLEAR_VARS) 18 19commonSources := \ 20 abort_socket.c \ 21 array.c \ 22 hashmap.c \ 23 atomic.c \ 24 native_handle.c \ 25 buffer.c \ 26 socket_inaddr_any_server.c \ 27 socket_local_client.c \ 28 socket_local_server.c \ 29 socket_loopback_client.c \ 30 socket_loopback_server.c \ 31 socket_network_client.c \ 32 config_utils.c \ 33 cpu_info.c \ 34 load_file.c \ 35 strdup16to8.c \ 36 strdup8to16.c \ 37 record_stream.c \ 38 process_name.c \ 39 properties.c \ 40 threads.c 41 42# some files must not be compiled when building against Mingw 43# they correspond to features not used by our host development tools 44# which are also hard or even impossible to port to native Win32 45WITH_MINGW := 46ifeq ($(HOST_OS),windows) 47 ifeq ($(strip $(USE_CYGWIN)),) 48 WITH_MINGW := 1 49 endif 50endif 51# USE_MINGW is defined when we build against Mingw on Linux 52ifneq ($(strip $(USE_MINGW)),) 53 WITH_MINGW := 1 54endif 55 56ifeq ($(WITH_MINGW),1) 57 commonSources += \ 58 uio.c 59else 60 commonSources += \ 61 mspace.c \ 62 selector.c \ 63 tztime.c \ 64 tzstrftime.c \ 65 adb_networking.c \ 66 zygote.c 67endif 68 69 70# Static library for host 71# ======================================================== 72LOCAL_MODULE := libcutils 73LOCAL_SRC_FILES := $(commonSources) ashmem-host.c 74LOCAL_LDLIBS := -lpthread 75LOCAL_STATIC_LIBRARIES := liblog 76include $(BUILD_HOST_STATIC_LIBRARY) 77 78 79ifeq ($(TARGET_SIMULATOR),true) 80 81# Shared library for simulator 82# ======================================================== 83include $(CLEAR_VARS) 84LOCAL_MODULE := libcutils 85LOCAL_SRC_FILES := $(commonSources) memory.c dlmalloc_stubs.c ashmem-host.c 86LOCAL_LDLIBS := -lpthread 87LOCAL_SHARED_LIBRARIES := liblog 88include $(BUILD_SHARED_LIBRARY) 89 90else #!sim 91 92# Shared and static library for target 93# ======================================================== 94include $(CLEAR_VARS) 95LOCAL_MODULE := libcutils 96LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c 97 98ifeq ($(TARGET_ARCH),arm) 99LOCAL_SRC_FILES += memset32.S atomic-android-arm.S 100else # !arm 101ifeq ($(TARGET_ARCH),sh) 102LOCAL_SRC_FILES += memory.c atomic-android-sh.c 103else # !sh 104LOCAL_SRC_FILES += memory.c 105endif # !sh 106endif # !arm 107 108LOCAL_C_INCLUDES := $(KERNEL_HEADERS) 109LOCAL_STATIC_LIBRARIES := liblog 110include $(BUILD_STATIC_LIBRARY) 111 112include $(CLEAR_VARS) 113LOCAL_MODULE := libcutils 114LOCAL_WHOLE_STATIC_LIBRARIES := libcutils 115LOCAL_SHARED_LIBRARIES := liblog 116include $(BUILD_SHARED_LIBRARY) 117 118endif #!sim 119