Android.mk revision d7a295221a96b02ebe50b65799da323770e67915
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 19ifeq ($(TARGET_CPU_SMP),true) 20 targetSmpFlag := -DANDROID_SMP=1 21else 22 targetSmpFlag := -DANDROID_SMP=0 23endif 24hostSmpFlag := -DANDROID_SMP=0 25 26commonSources := \ 27 array.c \ 28 hashmap.c \ 29 atomic.c.arm \ 30 native_handle.c \ 31 buffer.c \ 32 socket_inaddr_any_server.c \ 33 socket_local_client.c \ 34 socket_local_server.c \ 35 socket_loopback_client.c \ 36 socket_loopback_server.c \ 37 socket_network_client.c \ 38 config_utils.c \ 39 cpu_info.c \ 40 load_file.c \ 41 open_memstream.c \ 42 strdup16to8.c \ 43 strdup8to16.c \ 44 record_stream.c \ 45 process_name.c \ 46 properties.c \ 47 threads.c \ 48 sched_policy.c \ 49 iosched_policy.c 50 51commonHostSources := \ 52 ashmem-host.c 53 54# some files must not be compiled when building against Mingw 55# they correspond to features not used by our host development tools 56# which are also hard or even impossible to port to native Win32 57WINDOWS_HOST_ONLY := 58ifeq ($(HOST_OS),windows) 59 ifeq ($(strip $(USE_CYGWIN)),) 60 WINDOWS_HOST_ONLY := 1 61 endif 62endif 63# USE_MINGW is defined when we build against Mingw on Linux 64ifneq ($(strip $(USE_MINGW)),) 65 WINDOWS_HOST_ONLY := 1 66endif 67 68ifeq ($(WINDOWS_HOST_ONLY),1) 69 commonSources += \ 70 uio.c 71else 72 commonSources += \ 73 abort_socket.c \ 74 mspace.c \ 75 selector.c \ 76 tztime.c \ 77 zygote.c 78 79 commonHostSources += \ 80 tzstrftime.c 81endif 82 83 84# Static library for host 85# ======================================================== 86LOCAL_MODULE := libcutils 87LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c 88LOCAL_LDLIBS := -lpthread 89LOCAL_STATIC_LIBRARIES := liblog 90LOCAL_CFLAGS += $(hostSmpFlag) 91include $(BUILD_HOST_STATIC_LIBRARY) 92 93 94ifeq ($(TARGET_SIMULATOR),true) 95 96# Shared library for simulator 97# ======================================================== 98include $(CLEAR_VARS) 99LOCAL_MODULE := libcutils 100LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) memory.c dlmalloc_stubs.c 101LOCAL_LDLIBS := -lpthread 102LOCAL_SHARED_LIBRARIES := liblog 103LOCAL_CFLAGS += $(targetSmpFlag) 104include $(BUILD_SHARED_LIBRARY) 105 106else #!sim 107 108# Shared and static library for target 109# ======================================================== 110include $(CLEAR_VARS) 111LOCAL_MODULE := libcutils 112LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c 113 114ifeq ($(TARGET_ARCH),arm) 115LOCAL_SRC_FILES += arch-arm/memset32.S 116else # !arm 117ifeq ($(TARGET_ARCH),sh) 118LOCAL_SRC_FILES += memory.c atomic-android-sh.c 119else # !sh 120ifeq ($(TARGET_ARCH_VARIANT),x86-atom) 121LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 122LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c 123else # !x86-atom 124LOCAL_SRC_FILES += memory.c 125endif # !x86-atom 126endif # !sh 127endif # !arm 128 129LOCAL_C_INCLUDES := $(KERNEL_HEADERS) 130LOCAL_STATIC_LIBRARIES := liblog 131LOCAL_CFLAGS += $(targetSmpFlag) 132include $(BUILD_STATIC_LIBRARY) 133 134include $(CLEAR_VARS) 135LOCAL_MODULE := libcutils 136LOCAL_WHOLE_STATIC_LIBRARIES := libcutils 137LOCAL_SHARED_LIBRARIES := liblog 138LOCAL_CFLAGS += $(targetSmpFlag) 139include $(BUILD_SHARED_LIBRARY) 140 141endif #!sim 142