blob: 1c3185e9d020081725993234062bcba66ad8d911 [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 := \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080027 hashmap.c \
Carl Shapiro93b0cb42010-06-03 17:05:15 -070028 atomic.c.arm \
Mathias Agopian1d3faaf2009-04-10 14:24:31 -070029 native_handle.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080030 socket_inaddr_any_server.c \
31 socket_local_client.c \
32 socket_local_server.c \
33 socket_loopback_client.c \
34 socket_loopback_server.c \
35 socket_network_client.c \
jeffhao2b8f76c2011-05-05 14:25:36 -070036 sockets.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080037 config_utils.c \
38 cpu_info.c \
39 load_file.c \
Dima Zavinda04c522011-09-01 17:09:44 -070040 list.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 \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080044 process_name.c \
San Mehat493dad92009-09-12 10:06:57 -070045 threads.c \
San Mehat10d469b2010-02-25 14:02:55 -080046 sched_policy.c \
Dima Zavin0fad7d02011-03-24 11:11:06 -070047 iosched_policy.c \
Jeff Sharkey885342a2012-08-14 21:00:22 -070048 str_parms.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080049
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070050commonHostSources := \
51 ashmem-host.c
52
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080053# some files must not be compiled when building against Mingw
54# they correspond to features not used by our host development tools
55# which are also hard or even impossible to port to native Win32
Raphaelf3cdf372009-05-26 13:23:23 -070056WINDOWS_HOST_ONLY :=
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080057ifeq ($(HOST_OS),windows)
58 ifeq ($(strip $(USE_CYGWIN)),)
Raphaelf3cdf372009-05-26 13:23:23 -070059 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080060 endif
61endif
62# USE_MINGW is defined when we build against Mingw on Linux
63ifneq ($(strip $(USE_MINGW)),)
Raphaelf3cdf372009-05-26 13:23:23 -070064 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080065endif
66
Raphaelf3cdf372009-05-26 13:23:23 -070067ifeq ($(WINDOWS_HOST_ONLY),1)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080068 commonSources += \
69 uio.c
70else
71 commonSources += \
Jeff Sharkey96851942012-08-27 15:03:37 -070072 fs.c \
Dima Zavine00a12b2013-05-07 00:05:53 -070073 multiuser.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080074endif
75
76
77# Static library for host
78# ========================================================
79LOCAL_MODULE := libcutils
Jesse Wilson7ab237f2010-08-18 18:17:55 -070080LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080081LOCAL_LDLIBS := -lpthread
82LOCAL_STATIC_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -070083LOCAL_CFLAGS += $(hostSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080084include $(BUILD_HOST_STATIC_LIBRARY)
85
86
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080087# Static library for host, 64-bit
88# ========================================================
89include $(CLEAR_VARS)
90LOCAL_MODULE := lib64cutils
91LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
92LOCAL_LDLIBS := -lpthread
93LOCAL_STATIC_LIBRARIES := lib64log
94LOCAL_CFLAGS += $(hostSmpFlag) -m64
95include $(BUILD_HOST_STATIC_LIBRARY)
96
97
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080098# Shared and static library for target
99# ========================================================
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100100
101# This is needed in LOCAL_C_INCLUDES to access the C library's private
102# header named <bionic_time.h>
103#
104libcutils_c_includes := bionic/libc/private
105
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800106include $(CLEAR_VARS)
107LOCAL_MODULE := libcutils
Jeff Brown053b8652012-06-06 16:25:03 -0700108LOCAL_SRC_FILES := $(commonSources) \
109 android_reboot.c \
110 ashmem-dev.c \
111 debugger.c \
112 klog.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700113 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -0700114 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700115 qtaguid.c \
Alex Ray0a346432012-11-14 17:25:28 -0800116 trace.c \
Jeff Sharkey885342a2012-08-14 21:00:22 -0700117 uevent.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800118
119ifeq ($(TARGET_ARCH),arm)
Lu, Hongjiubb12ac92010-12-27 16:53:58 -0800120LOCAL_SRC_FILES += arch-arm/memset32.S
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800121else # !arm
Lu, Hongjiubb12ac92010-12-27 16:53:58 -0800122ifeq ($(TARGET_ARCH_VARIANT),x86-atom)
123LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32
124LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c
125else # !x86-atom
Duane Sand1ca12052012-05-24 22:18:38 -0700126ifeq ($(TARGET_ARCH),mips)
127LOCAL_SRC_FILES += arch-mips/android_memset.c
128else # !mips
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800129LOCAL_SRC_FILES += memory.c
Duane Sand1ca12052012-05-24 22:18:38 -0700130endif # !mips
Lu, Hongjiubb12ac92010-12-27 16:53:58 -0800131endif # !x86-atom
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800132endif # !arm
133
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100134LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800135LOCAL_STATIC_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -0700136LOCAL_CFLAGS += $(targetSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800137include $(BUILD_STATIC_LIBRARY)
138
139include $(CLEAR_VARS)
140LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700141# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
142# liblog symbols present in libcutils.
143LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800144LOCAL_SHARED_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -0700145LOCAL_CFLAGS += $(targetSmpFlag)
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100146LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800147include $(BUILD_SHARED_LIBRARY)
148
Dima Zavin0fad7d02011-03-24 11:11:06 -0700149include $(CLEAR_VARS)
150LOCAL_MODULE := tst_str_parms
151LOCAL_CFLAGS += -DTEST_STR_PARMS
152LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
Dima Zavin14fc0c22011-04-27 22:26:23 -0700153LOCAL_SHARED_LIBRARIES := liblog
Dima Zavin0fad7d02011-03-24 11:11:06 -0700154LOCAL_MODULE_TAGS := optional
Dima Zavin14fc0c22011-04-27 22:26:23 -0700155include $(BUILD_EXECUTABLE)
Duane Sandd4a80982012-10-12 14:25:19 -0700156
157include $(call all-makefiles-under,$(LOCAL_PATH))