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