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