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