Android.mk revision 4481c325b16d4a42fd0ebf4c8a2bb5bcc09daf5e
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 hashmap.c \ 28 atomic.c.arm \ 29 native_handle.c \ 30 socket_inaddr_any_server.c \ 31 socket_local_client.c \ 32 socket_local_server.c \ 33 socket_loopback_client.c \ 34 socket_loopback_server.c \ 35 socket_network_client.c \ 36 sockets.c \ 37 config_utils.c \ 38 cpu_info.c \ 39 load_file.c \ 40 list.c \ 41 open_memstream.c \ 42 strdup16to8.c \ 43 strdup8to16.c \ 44 record_stream.c \ 45 process_name.c \ 46 threads.c \ 47 sched_policy.c \ 48 iosched_policy.c \ 49 str_parms.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 68 69# Static library for host 70# ======================================================== 71LOCAL_MODULE := libcutils 72LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c 73LOCAL_LDLIBS := -lpthread 74LOCAL_STATIC_LIBRARIES := liblog 75LOCAL_CFLAGS += $(hostSmpFlag) 76include $(BUILD_HOST_STATIC_LIBRARY) 77 78 79# Static library for host, 64-bit 80# ======================================================== 81include $(CLEAR_VARS) 82LOCAL_MODULE := lib64cutils 83LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c 84LOCAL_LDLIBS := -lpthread 85LOCAL_STATIC_LIBRARIES := lib64log 86LOCAL_CFLAGS += $(hostSmpFlag) -m64 87include $(BUILD_HOST_STATIC_LIBRARY) 88 89 90# Shared and static library for target 91# ======================================================== 92 93# This is needed in LOCAL_C_INCLUDES to access the C library's private 94# header named <bionic_time.h> 95# 96libcutils_c_includes := bionic/libc/private 97 98include $(CLEAR_VARS) 99LOCAL_MODULE := libcutils 100LOCAL_SRC_FILES := $(commonSources) \ 101 android_reboot.c \ 102 ashmem-dev.c \ 103 debugger.c \ 104 fs.c \ 105 klog.c \ 106 multiuser.c \ 107 partition_utils.c \ 108 properties.c \ 109 qtaguid.c \ 110 trace.c \ 111 uevent.c 112 113ifeq ($(TARGET_ARCH),arm) 114LOCAL_SRC_FILES += arch-arm/memset32.S 115else # !arm 116ifeq ($(TARGET_ARCH_VARIANT),x86-atom) 117LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 118LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c 119else # !x86-atom 120ifeq ($(TARGET_ARCH),mips) 121LOCAL_SRC_FILES += arch-mips/android_memset.c 122else # !mips 123LOCAL_SRC_FILES += memory.c 124endif # !mips 125endif # !x86-atom 126endif # !arm 127 128LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS) 129LOCAL_STATIC_LIBRARIES := liblog 130LOCAL_CFLAGS += $(targetSmpFlag) 131include $(BUILD_STATIC_LIBRARY) 132 133include $(CLEAR_VARS) 134LOCAL_MODULE := libcutils 135# TODO: remove liblog as whole static library, once we don't have prebuilt that requires 136# liblog symbols present in libcutils. 137LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog 138LOCAL_SHARED_LIBRARIES := liblog 139LOCAL_CFLAGS += $(targetSmpFlag) 140LOCAL_C_INCLUDES := $(libcutils_c_includes) 141include $(BUILD_SHARED_LIBRARY) 142 143include $(CLEAR_VARS) 144LOCAL_MODULE := tst_str_parms 145LOCAL_CFLAGS += -DTEST_STR_PARMS 146LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c 147LOCAL_SHARED_LIBRARIES := liblog 148LOCAL_MODULE_TAGS := optional 149include $(BUILD_EXECUTABLE) 150 151include $(call all-makefiles-under,$(LOCAL_PATH)) 152