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