blob: 2c5e351a25c2fc370a02ba3e6351a943fecc8034 [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
19commonSources := \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080020 hashmap.c \
Carl Shapiro93b0cb42010-06-03 17:05:15 -070021 atomic.c.arm \
Mathias Agopian1d3faaf2009-04-10 14:24:31 -070022 native_handle.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080023 config_utils.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080024 load_file.c \
Andy McFaddencf63d5d2010-01-22 16:37:25 -080025 open_memstream.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080026 strdup16to8.c \
27 strdup8to16.c \
Dima Zavinabb7d582013-06-04 10:34:49 -070028 record_stream.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080029 process_name.c \
San Mehat493dad92009-09-12 10:06:57 -070030 threads.c \
San Mehat10d469b2010-02-25 14:02:55 -080031 sched_policy.c \
Dima Zavin0fad7d02011-03-24 11:11:06 -070032 iosched_policy.c \
Jeff Sharkey885342a2012-08-14 21:00:22 -070033 str_parms.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080034
35# some files must not be compiled when building against Mingw
36# they correspond to features not used by our host development tools
37# which are also hard or even impossible to port to native Win32
Raphaelf3cdf372009-05-26 13:23:23 -070038WINDOWS_HOST_ONLY :=
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080039ifeq ($(HOST_OS),windows)
40 ifeq ($(strip $(USE_CYGWIN)),)
Raphaelf3cdf372009-05-26 13:23:23 -070041 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080042 endif
43endif
44# USE_MINGW is defined when we build against Mingw on Linux
45ifneq ($(strip $(USE_MINGW)),)
Raphaelf3cdf372009-05-26 13:23:23 -070046 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080047endif
48
Jeff Sharkey0ee7d8c2013-09-20 17:58:54 -070049ifneq ($(WINDOWS_HOST_ONLY),1)
50 commonSources += \
51 fs.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070052 multiuser.c \
Mathieu Chartier0b9674f2014-06-03 15:28:26 -070053 socket_inaddr_any_server.c \
54 socket_local_client.c \
55 socket_local_server.c \
56 socket_loopback_client.c \
57 socket_loopback_server.c \
58 socket_network_client.c \
59 sockets.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070060
Mathieu Chartiere942d1f2014-06-03 18:12:29 -070061 commonHostSources += \
62 ashmem-host.c
63
Jeff Sharkey0ee7d8c2013-09-20 17:58:54 -070064endif
65
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080066
67# Static library for host
68# ========================================================
69LOCAL_MODULE := libcutils
Jesse Wilson7ab237f2010-08-18 18:17:55 -070070LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080071LOCAL_STATIC_LIBRARIES := liblog
Mark Salyzyn02a7c3a2014-05-05 08:49:13 -070072ifneq ($(HOST_OS),windows)
73LOCAL_CFLAGS += -Werror
74endif
Ian Rogers59ec7652014-06-05 14:32:49 -070075LOCAL_MULTILIB := both
Henrik Smiding86a16002014-05-16 13:26:08 +020076LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077include $(BUILD_HOST_STATIC_LIBRARY)
78
79
Jens Gulind3c8d5b2014-03-06 18:15:43 +010080# Tests for host
81# ========================================================
82include $(CLEAR_VARS)
83LOCAL_MODULE := tst_str_parms
Mark Salyzyn02a7c3a2014-05-05 08:49:13 -070084LOCAL_CFLAGS += -DTEST_STR_PARMS
85ifneq ($(HOST_OS),windows)
86LOCAL_CFLAGS += -Werror
87endif
Jens Gulind3c8d5b2014-03-06 18:15:43 +010088LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
89LOCAL_STATIC_LIBRARIES := liblog
90LOCAL_MODULE_TAGS := optional
Henrik Smiding86a16002014-05-16 13:26:08 +020091LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jens Gulind3c8d5b2014-03-06 18:15:43 +010092include $(BUILD_HOST_EXECUTABLE)
93
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080094
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 \
Henrik Smiding86a16002014-05-16 13:26:08 +0200105 memory.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700106 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -0700107 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700108 qtaguid.c \
Alex Ray0a346432012-11-14 17:25:28 -0800109 trace.c \
Henrik Smiding86a16002014-05-16 13:26:08 +0200110 uevent.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800111
Henrik Smiding86a16002014-05-16 13:26:08 +0200112LOCAL_SRC_FILES_arm += \
113 arch-arm/memset32.S \
114
Chih-Hung Hsieh60c57da2014-10-06 13:27:20 -0700115# arch-arm/memset32.S does not compile with Clang.
116LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
117
Christopher Ferrisd660d892014-06-20 10:28:28 -0700118LOCAL_SRC_FILES_arm64 += \
119 arch-arm64/android_memset.S \
120
Duane Sand734f50c2014-06-28 18:55:26 -0700121ifndef ARCH_MIPS_REV6
Henrik Smiding86a16002014-05-16 13:26:08 +0200122LOCAL_SRC_FILES_mips += \
123 arch-mips/android_memset.c \
124
Duane Sand734f50c2014-06-28 18:55:26 -0700125LOCAL_CFLAGS_mips += -DHAVE_MEMSET16 -DHAVE_MEMSET32
126endif
127
128# TODO: switch mips64 back to using arch-mips/android_memset.c
129LOCAL_SRC_FILES_mips64 += \
130# arch-mips/android_memset.c \
131
Henrik Smiding86a16002014-05-16 13:26:08 +0200132LOCAL_SRC_FILES_x86 += \
133 arch-x86/android_memset16.S \
134 arch-x86/android_memset32.S \
135
136LOCAL_SRC_FILES_x86_64 += \
Varvara Rainchik458d1252014-09-08 16:27:01 +0400137 arch-x86_64/android_memset16.S \
138 arch-x86_64/android_memset32.S \
Henrik Smiding86a16002014-05-16 13:26:08 +0200139
140LOCAL_CFLAGS_arm += -DHAVE_MEMSET16 -DHAVE_MEMSET32
Christopher Ferrisd660d892014-06-20 10:28:28 -0700141LOCAL_CFLAGS_arm64 += -DHAVE_MEMSET16 -DHAVE_MEMSET32
Duane Sand734f50c2014-06-28 18:55:26 -0700142#LOCAL_CFLAGS_mips64 += -DHAVE_MEMSET16 -DHAVE_MEMSET32
Henrik Smiding86a16002014-05-16 13:26:08 +0200143LOCAL_CFLAGS_x86 += -DHAVE_MEMSET16 -DHAVE_MEMSET32
144LOCAL_CFLAGS_x86_64 += -DHAVE_MEMSET16 -DHAVE_MEMSET32
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800145
Colin Cross65dd88b2014-01-22 19:06:04 -0800146LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800147LOCAL_STATIC_LIBRARIES := liblog
Elliott Hughese9ca7092014-11-17 11:16:59 -0800148LOCAL_CFLAGS += -Werror -std=gnu90
Henrik Smiding86a16002014-05-16 13:26:08 +0200149LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800150include $(BUILD_STATIC_LIBRARY)
151
152include $(CLEAR_VARS)
153LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700154# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
155# liblog symbols present in libcutils.
156LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800157LOCAL_SHARED_LIBRARIES := liblog
Elliott Hughese9ca7092014-11-17 11:16:59 -0800158LOCAL_CFLAGS += -Werror
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100159LOCAL_C_INCLUDES := $(libcutils_c_includes)
Henrik Smiding86a16002014-05-16 13:26:08 +0200160LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800161include $(BUILD_SHARED_LIBRARY)
162
Dima Zavin0fad7d02011-03-24 11:11:06 -0700163include $(CLEAR_VARS)
164LOCAL_MODULE := tst_str_parms
Mark Salyzyn12717162014-04-29 15:49:14 -0700165LOCAL_CFLAGS += -DTEST_STR_PARMS -Werror
Dima Zavin0fad7d02011-03-24 11:11:06 -0700166LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
Dima Zavin14fc0c22011-04-27 22:26:23 -0700167LOCAL_SHARED_LIBRARIES := liblog
Dima Zavin0fad7d02011-03-24 11:11:06 -0700168LOCAL_MODULE_TAGS := optional
Henrik Smiding86a16002014-05-16 13:26:08 +0200169LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dima Zavin14fc0c22011-04-27 22:26:23 -0700170include $(BUILD_EXECUTABLE)
Duane Sandd4a80982012-10-12 14:25:19 -0700171
172include $(call all-makefiles-under,$(LOCAL_PATH))