blob: 93bccb08ca3b348cfcaafa80ca086e5dea1a6201 [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 \
Andy McFaddencf63d5d2010-01-22 16:37:25 -080040 open_memstream.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080041 strdup16to8.c \
42 strdup8to16.c \
Dima Zavinabb7d582013-06-04 10:34:49 -070043 record_stream.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
Jeff Sharkey0ee7d8c2013-09-20 17:58:54 -070067ifneq ($(WINDOWS_HOST_ONLY),1)
68 commonSources += \
69 fs.c \
70 multiuser.c
71endif
72
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080073
74# Static library for host
75# ========================================================
76LOCAL_MODULE := libcutils
Jesse Wilson7ab237f2010-08-18 18:17:55 -070077LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080078LOCAL_LDLIBS := -lpthread
79LOCAL_STATIC_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -070080LOCAL_CFLAGS += $(hostSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080081include $(BUILD_HOST_STATIC_LIBRARY)
82
83
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080084# Static library for host, 64-bit
85# ========================================================
86include $(CLEAR_VARS)
87LOCAL_MODULE := lib64cutils
88LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
89LOCAL_LDLIBS := -lpthread
90LOCAL_STATIC_LIBRARIES := lib64log
91LOCAL_CFLAGS += $(hostSmpFlag) -m64
92include $(BUILD_HOST_STATIC_LIBRARY)
93
94
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080095# Shared and static library for target
96# ========================================================
David 'Digit' Turner7913bc02012-01-13 13:38:40 +010097
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080098include $(CLEAR_VARS)
99LOCAL_MODULE := libcutils
Jeff Brown053b8652012-06-06 16:25:03 -0700100LOCAL_SRC_FILES := $(commonSources) \
101 android_reboot.c \
102 ashmem-dev.c \
103 debugger.c \
104 klog.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700105 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -0700106 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700107 qtaguid.c \
Alex Ray0a346432012-11-14 17:25:28 -0800108 trace.c \
Jeff Sharkey885342a2012-08-14 21:00:22 -0700109 uevent.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800110
111ifeq ($(TARGET_ARCH),arm)
Daniel Leung51546ee2012-05-24 16:54:49 -0700112 LOCAL_SRC_FILES += arch-arm/memset32.S
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800113else # !arm
Daniel Leung51546ee2012-05-24 16:54:49 -0700114 ifeq ($(TARGET_ARCH),x86)
Pavel Chupin4aa51cd2013-10-10 20:19:15 +0400115 LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32
116 LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c
Daniel Leung51546ee2012-05-24 16:54:49 -0700117 else # !x86
118 ifeq ($(TARGET_ARCH),mips)
119 LOCAL_SRC_FILES += arch-mips/android_memset.c
120 else # !mips
121 LOCAL_SRC_FILES += memory.c
122 endif # !mips
123 endif # !x86
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800124endif # !arm
125
Colin Cross65dd88b2014-01-22 19:06:04 -0800126LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800127LOCAL_STATIC_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -0700128LOCAL_CFLAGS += $(targetSmpFlag)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800129include $(BUILD_STATIC_LIBRARY)
130
131include $(CLEAR_VARS)
132LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700133# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
134# liblog symbols present in libcutils.
135LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800136LOCAL_SHARED_LIBRARIES := liblog
Andy McFaddenac322da2010-05-19 22:33:28 -0700137LOCAL_CFLAGS += $(targetSmpFlag)
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100138LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800139include $(BUILD_SHARED_LIBRARY)
140
Dima Zavin0fad7d02011-03-24 11:11:06 -0700141include $(CLEAR_VARS)
142LOCAL_MODULE := tst_str_parms
143LOCAL_CFLAGS += -DTEST_STR_PARMS
144LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
Dima Zavin14fc0c22011-04-27 22:26:23 -0700145LOCAL_SHARED_LIBRARIES := liblog
Dima Zavin0fad7d02011-03-24 11:11:06 -0700146LOCAL_MODULE_TAGS := optional
Dima Zavin14fc0c22011-04-27 22:26:23 -0700147include $(BUILD_EXECUTABLE)
Duane Sandd4a80982012-10-12 14:25:19 -0700148
149include $(call all-makefiles-under,$(LOCAL_PATH))