Android.mk revision 29e1e7393d1742f9dd5663c63026f50981e5bd89
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 96# Shared and static library for target 97# ======================================================== 98include $(CLEAR_VARS) 99LOCAL_MODULE := libcutils 100LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c android_reboot.c partition_utils.c uevent.c qtaguid.c 101 102ifeq ($(TARGET_ARCH),arm) 103LOCAL_SRC_FILES += arch-arm/memset32.S 104else # !arm 105ifeq ($(TARGET_ARCH),sh) 106LOCAL_SRC_FILES += memory.c atomic-android-sh.c 107else # !sh 108ifeq ($(TARGET_ARCH_VARIANT),x86-atom) 109LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 110LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c 111else # !x86-atom 112LOCAL_SRC_FILES += memory.c 113endif # !x86-atom 114endif # !sh 115endif # !arm 116 117LOCAL_C_INCLUDES := $(KERNEL_HEADERS) 118LOCAL_STATIC_LIBRARIES := liblog 119LOCAL_CFLAGS += $(targetSmpFlag) 120include $(BUILD_STATIC_LIBRARY) 121 122include $(CLEAR_VARS) 123LOCAL_MODULE := libcutils 124LOCAL_WHOLE_STATIC_LIBRARIES := libcutils 125LOCAL_SHARED_LIBRARIES := liblog 126LOCAL_CFLAGS += $(targetSmpFlag) 127include $(BUILD_SHARED_LIBRARY) 128 129include $(CLEAR_VARS) 130LOCAL_MODULE := tst_str_parms 131LOCAL_CFLAGS += -DTEST_STR_PARMS 132LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c 133LOCAL_SHARED_LIBRARIES := liblog 134LOCAL_MODULE_TAGS := optional 135include $(BUILD_EXECUTABLE) 136