blob: 84cccd9898873c8fb65fbfcc39b37ea40a1985e9 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001#
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
Andy McFaddenac322da2010-05-19 22:33:28 -070019ifeq ($(TARGET_CPU_SMP),true)
20 targetSmpFlag := -DANDROID_SMP=1
21else
22 targetSmpFlag := -DANDROID_SMP=0
23endif
24hostSmpFlag := -DANDROID_SMP=0
25
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080026commonSources := \
27 array.c \
28 hashmap.c \
Carl Shapiro93b0cb42010-06-03 17:05:15 -070029 atomic.c.arm \
Mathias Agopian1d3faaf2009-04-10 14:24:31 -070030 native_handle.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080031 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 \
Andy McFaddencf63d5d2010-01-22 16:37:25 -080041 open_memstream.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080042 strdup16to8.c \
43 strdup8to16.c \
44 record_stream.c \
45 process_name.c \
46 properties.c \
San Mehat493dad92009-09-12 10:06:57 -070047 threads.c \
San Mehat10d469b2010-02-25 14:02:55 -080048 sched_policy.c \
Jean-Baptiste Queru89790b82011-06-18 11:53:34 -070049 iosched_policy.c \
50 str_parms.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080051
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070052commonHostSources := \
53 ashmem-host.c
54
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080055# 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
Raphaelf3cdf372009-05-26 13:23:23 -070058WINDOWS_HOST_ONLY :=
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080059ifeq ($(HOST_OS),windows)
60 ifeq ($(strip $(USE_CYGWIN)),)
Raphaelf3cdf372009-05-26 13:23:23 -070061 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080062 endif
63endif
64# USE_MINGW is defined when we build against Mingw on Linux
65ifneq ($(strip $(USE_MINGW)),)
Raphaelf3cdf372009-05-26 13:23:23 -070066 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080067endif
68
Raphaelf3cdf372009-05-26 13:23:23 -070069ifeq ($(WINDOWS_HOST_ONLY),1)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080070 commonSources += \
71 uio.c
72else
73 commonSources += \
Raphaelf3cdf372009-05-26 13:23:23 -070074 abort_socket.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080075 mspace.c \
76 selector.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077 tztime.c \
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070078 zygote.c
79
80 commonHostSources += \
81 tzstrftime.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080082endif
83
84
85# Static library for host
86# ========================================================
87LOCAL_MODULE := libcutils
Jesse Wilson7ab237f2010-08-18 18:17:55 -070088LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080089LOCAL_LDLIBS := -lpthread
90LOCAL_STATIC_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -070091LOCAL_CFLAGS += $(hostSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080092include $(BUILD_HOST_STATIC_LIBRARY)
93
94
95ifeq ($(TARGET_SIMULATOR),true)
96
97# Shared library for simulator
98# ========================================================
99include $(CLEAR_VARS)
100LOCAL_MODULE := libcutils
The Android Open Source Projectb1487e42009-03-18 22:20:28 -0700101LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) memory.c dlmalloc_stubs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800102LOCAL_LDLIBS := -lpthread
103LOCAL_SHARED_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -0700104LOCAL_CFLAGS += $(targetSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800105include $(BUILD_SHARED_LIBRARY)
106
107else #!sim
108
109# Shared and static library for target
110# ========================================================
111include $(CLEAR_VARS)
112LOCAL_MODULE := libcutils
Vernon Tang3f582e92011-04-25 13:08:17 +1000113LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c uevent.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800114
115ifeq ($(TARGET_ARCH),arm)
Bruce Beared7a29522010-12-27 16:53:58 -0800116LOCAL_SRC_FILES += arch-arm/memset32.S
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800117else # !arm
Shin-ichiro KAWASAKIc6af9112009-08-04 19:14:22 +0900118ifeq ($(TARGET_ARCH),sh)
119LOCAL_SRC_FILES += memory.c atomic-android-sh.c
120else # !sh
Bruce Beared7a29522010-12-27 16:53:58 -0800121ifeq ($(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
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800125LOCAL_SRC_FILES += memory.c
Bruce Beared7a29522010-12-27 16:53:58 -0800126endif # !x86-atom
Shin-ichiro KAWASAKIc6af9112009-08-04 19:14:22 +0900127endif # !sh
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800128endif # !arm
129
130LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
131LOCAL_STATIC_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -0700132LOCAL_CFLAGS += $(targetSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800133include $(BUILD_STATIC_LIBRARY)
134
135include $(CLEAR_VARS)
136LOCAL_MODULE := libcutils
137LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
138LOCAL_SHARED_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -0700139LOCAL_CFLAGS += $(targetSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800140include $(BUILD_SHARED_LIBRARY)
141
142endif #!sim