Android.mk revision 2d13791ce7ff61221ca047553891f31a23b2e943
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 sockets.c \ 39 config_utils.c \ 40 cpu_info.c \ 41 load_file.c \ 42 list.c \ 43 open_memstream.c \ 44 strdup16to8.c \ 45 strdup8to16.c \ 46 record_stream.c \ 47 process_name.c \ 48 properties.c \ 49 qsort_r_compat.c \ 50 threads.c \ 51 sched_policy.c \ 52 iosched_policy.c \ 53 str_parms.c 54 55commonHostSources := \ 56 ashmem-host.c 57 58# some files must not be compiled when building against Mingw 59# they correspond to features not used by our host development tools 60# which are also hard or even impossible to port to native Win32 61WINDOWS_HOST_ONLY := 62ifeq ($(HOST_OS),windows) 63 ifeq ($(strip $(USE_CYGWIN)),) 64 WINDOWS_HOST_ONLY := 1 65 endif 66endif 67# USE_MINGW is defined when we build against Mingw on Linux 68ifneq ($(strip $(USE_MINGW)),) 69 WINDOWS_HOST_ONLY := 1 70endif 71 72ifeq ($(WINDOWS_HOST_ONLY),1) 73 commonSources += \ 74 uio.c 75else 76 commonSources += \ 77 abort_socket.c \ 78 selector.c \ 79 tztime.c \ 80 zygote.c 81 82 commonHostSources += \ 83 tzstrftime.c 84endif 85 86 87# Static library for host 88# ======================================================== 89LOCAL_MODULE := libcutils 90LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c 91LOCAL_LDLIBS := -lpthread 92LOCAL_STATIC_LIBRARIES := liblog 93LOCAL_CFLAGS += $(hostSmpFlag) 94include $(BUILD_HOST_STATIC_LIBRARY) 95 96 97# Static library for host, 64-bit 98# ======================================================== 99include $(CLEAR_VARS) 100LOCAL_MODULE := lib64cutils 101LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c 102LOCAL_LDLIBS := -lpthread 103LOCAL_STATIC_LIBRARIES := lib64log 104LOCAL_CFLAGS += $(hostSmpFlag) -m64 105include $(BUILD_HOST_STATIC_LIBRARY) 106 107 108# Shared and static library for target 109# ======================================================== 110 111# This is needed in LOCAL_C_INCLUDES to access the C library's private 112# header named <bionic_time.h> 113# 114libcutils_c_includes := bionic/libc/private 115 116include $(CLEAR_VARS) 117LOCAL_MODULE := libcutils 118LOCAL_SRC_FILES := $(commonSources) \ 119 android_reboot.c \ 120 ashmem-dev.c \ 121 debugger.c \ 122 klog.c \ 123 mq.c \ 124 partition_utils.c \ 125 qtaguid.c \ 126 uevent.c 127 128ifeq ($(TARGET_ARCH),arm) 129LOCAL_SRC_FILES += arch-arm/memset32.S 130else # !arm 131ifeq ($(TARGET_ARCH_VARIANT),x86-atom) 132LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 133LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c 134else # !x86-atom 135LOCAL_SRC_FILES += memory.c 136endif # !x86-atom 137endif # !arm 138 139LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS) 140LOCAL_STATIC_LIBRARIES := liblog 141LOCAL_CFLAGS += $(targetSmpFlag) 142include $(BUILD_STATIC_LIBRARY) 143 144include $(CLEAR_VARS) 145LOCAL_MODULE := libcutils 146LOCAL_WHOLE_STATIC_LIBRARIES := libcutils 147LOCAL_SHARED_LIBRARIES := liblog 148LOCAL_CFLAGS += $(targetSmpFlag) 149LOCAL_C_INCLUDES := $(libcutils_c_includes) 150include $(BUILD_SHARED_LIBRARY) 151 152include $(CLEAR_VARS) 153LOCAL_MODULE := tst_str_parms 154LOCAL_CFLAGS += -DTEST_STR_PARMS 155LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c 156LOCAL_SHARED_LIBRARIES := liblog 157LOCAL_MODULE_TAGS := optional 158include $(BUILD_EXECUTABLE) 159