The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 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 | # |
| 16 | LOCAL_PATH := $(my-dir) |
| 17 | include $(CLEAR_VARS) |
| 18 | |
| 19 | commonSources := \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 20 | hashmap.c \ |
Carl Shapiro | 93b0cb4 | 2010-06-03 17:05:15 -0700 | [diff] [blame] | 21 | atomic.c.arm \ |
Mathias Agopian | 1d3faaf | 2009-04-10 14:24:31 -0700 | [diff] [blame] | 22 | native_handle.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 23 | config_utils.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 24 | load_file.c \ |
Andy McFadden | cf63d5d | 2010-01-22 16:37:25 -0800 | [diff] [blame] | 25 | open_memstream.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 26 | strdup16to8.c \ |
| 27 | strdup8to16.c \ |
Dima Zavin | abb7d58 | 2013-06-04 10:34:49 -0700 | [diff] [blame] | 28 | record_stream.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 29 | process_name.c \ |
San Mehat | 493dad9 | 2009-09-12 10:06:57 -0700 | [diff] [blame] | 30 | threads.c \ |
San Mehat | 10d469b | 2010-02-25 14:02:55 -0800 | [diff] [blame] | 31 | sched_policy.c \ |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 32 | iosched_policy.c \ |
Jeff Sharkey | 885342a | 2012-08-14 21:00:22 -0700 | [diff] [blame] | 33 | str_parms.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 34 | |
| 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 |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 38 | WINDOWS_HOST_ONLY := |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 39 | ifeq ($(HOST_OS),windows) |
| 40 | ifeq ($(strip $(USE_CYGWIN)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 41 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 42 | endif |
| 43 | endif |
| 44 | # USE_MINGW is defined when we build against Mingw on Linux |
| 45 | ifneq ($(strip $(USE_MINGW)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 46 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 47 | endif |
| 48 | |
Jeff Sharkey | 0ee7d8c | 2013-09-20 17:58:54 -0700 | [diff] [blame] | 49 | ifneq ($(WINDOWS_HOST_ONLY),1) |
| 50 | commonSources += \ |
| 51 | fs.c \ |
Elliott Hughes | 0bff5bd | 2014-05-20 12:01:29 -0700 | [diff] [blame] | 52 | multiuser.c \ |
Mathieu Chartier | 0b9674f | 2014-06-03 15:28:26 -0700 | [diff] [blame] | 53 | 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 Hughes | 0bff5bd | 2014-05-20 12:01:29 -0700 | [diff] [blame] | 60 | |
Mathieu Chartier | e942d1f | 2014-06-03 18:12:29 -0700 | [diff] [blame] | 61 | commonHostSources += \ |
| 62 | ashmem-host.c |
| 63 | |
Jeff Sharkey | 0ee7d8c | 2013-09-20 17:58:54 -0700 | [diff] [blame] | 64 | endif |
| 65 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 66 | |
| 67 | # Static library for host |
| 68 | # ======================================================== |
| 69 | LOCAL_MODULE := libcutils |
Jesse Wilson | 7ab237f | 2010-08-18 18:17:55 -0700 | [diff] [blame] | 70 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 71 | LOCAL_STATIC_LIBRARIES := liblog |
Mark Salyzyn | 02a7c3a | 2014-05-05 08:49:13 -0700 | [diff] [blame] | 72 | ifneq ($(HOST_OS),windows) |
| 73 | LOCAL_CFLAGS += -Werror |
| 74 | endif |
Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 75 | LOCAL_MULTILIB := both |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 76 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 77 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 78 | |
| 79 | |
Jens Gulin | d3c8d5b | 2014-03-06 18:15:43 +0100 | [diff] [blame] | 80 | # Tests for host |
| 81 | # ======================================================== |
| 82 | include $(CLEAR_VARS) |
| 83 | LOCAL_MODULE := tst_str_parms |
Mark Salyzyn | 02a7c3a | 2014-05-05 08:49:13 -0700 | [diff] [blame] | 84 | LOCAL_CFLAGS += -DTEST_STR_PARMS |
| 85 | ifneq ($(HOST_OS),windows) |
| 86 | LOCAL_CFLAGS += -Werror |
| 87 | endif |
Jens Gulin | d3c8d5b | 2014-03-06 18:15:43 +0100 | [diff] [blame] | 88 | LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c |
| 89 | LOCAL_STATIC_LIBRARIES := liblog |
| 90 | LOCAL_MODULE_TAGS := optional |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 91 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Jens Gulin | d3c8d5b | 2014-03-06 18:15:43 +0100 | [diff] [blame] | 92 | include $(BUILD_HOST_EXECUTABLE) |
| 93 | |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 94 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 95 | # Shared and static library for target |
| 96 | # ======================================================== |
David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 97 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 98 | include $(CLEAR_VARS) |
| 99 | LOCAL_MODULE := libcutils |
Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 100 | LOCAL_SRC_FILES := $(commonSources) \ |
| 101 | android_reboot.c \ |
| 102 | ashmem-dev.c \ |
| 103 | debugger.c \ |
| 104 | klog.c \ |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 105 | memory.c \ |
Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 106 | partition_utils.c \ |
Nick Kralevich | b39e3a8 | 2013-05-23 09:54:47 -0700 | [diff] [blame] | 107 | properties.c \ |
Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 108 | qtaguid.c \ |
Alex Ray | 0a34643 | 2012-11-14 17:25:28 -0800 | [diff] [blame] | 109 | trace.c \ |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 110 | uevent.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 111 | |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 112 | LOCAL_SRC_FILES_arm += \ |
| 113 | arch-arm/memset32.S \ |
| 114 | |
Chih-Hung Hsieh | 60c57da | 2014-10-06 13:27:20 -0700 | [diff] [blame] | 115 | # arch-arm/memset32.S does not compile with Clang. |
| 116 | LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as |
| 117 | |
Christopher Ferris | d660d89 | 2014-06-20 10:28:28 -0700 | [diff] [blame] | 118 | LOCAL_SRC_FILES_arm64 += \ |
| 119 | arch-arm64/android_memset.S \ |
| 120 | |
Duane Sand | 734f50c | 2014-06-28 18:55:26 -0700 | [diff] [blame] | 121 | ifndef ARCH_MIPS_REV6 |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 122 | LOCAL_SRC_FILES_mips += \ |
| 123 | arch-mips/android_memset.c \ |
| 124 | |
Duane Sand | 734f50c | 2014-06-28 18:55:26 -0700 | [diff] [blame] | 125 | LOCAL_CFLAGS_mips += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
| 126 | endif |
| 127 | |
| 128 | # TODO: switch mips64 back to using arch-mips/android_memset.c |
| 129 | LOCAL_SRC_FILES_mips64 += \ |
| 130 | # arch-mips/android_memset.c \ |
| 131 | |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 132 | LOCAL_SRC_FILES_x86 += \ |
| 133 | arch-x86/android_memset16.S \ |
| 134 | arch-x86/android_memset32.S \ |
| 135 | |
| 136 | LOCAL_SRC_FILES_x86_64 += \ |
Varvara Rainchik | 458d125 | 2014-09-08 16:27:01 +0400 | [diff] [blame] | 137 | arch-x86_64/android_memset16.S \ |
| 138 | arch-x86_64/android_memset32.S \ |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 139 | |
| 140 | LOCAL_CFLAGS_arm += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
Christopher Ferris | d660d89 | 2014-06-20 10:28:28 -0700 | [diff] [blame] | 141 | LOCAL_CFLAGS_arm64 += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
Duane Sand | 734f50c | 2014-06-28 18:55:26 -0700 | [diff] [blame] | 142 | #LOCAL_CFLAGS_mips64 += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 143 | LOCAL_CFLAGS_x86 += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
| 144 | LOCAL_CFLAGS_x86_64 += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 145 | |
Colin Cross | 65dd88b | 2014-01-22 19:06:04 -0800 | [diff] [blame] | 146 | LOCAL_C_INCLUDES := $(libcutils_c_includes) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 147 | LOCAL_STATIC_LIBRARIES := liblog |
Elliott Hughes | e9ca709 | 2014-11-17 11:16:59 -0800 | [diff] [blame] | 148 | LOCAL_CFLAGS += -Werror -std=gnu90 |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 149 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 150 | include $(BUILD_STATIC_LIBRARY) |
| 151 | |
| 152 | include $(CLEAR_VARS) |
| 153 | LOCAL_MODULE := libcutils |
Ying Wang | c796ed9 | 2013-04-10 17:27:35 -0700 | [diff] [blame] | 154 | # TODO: remove liblog as whole static library, once we don't have prebuilt that requires |
| 155 | # liblog symbols present in libcutils. |
| 156 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 157 | LOCAL_SHARED_LIBRARIES := liblog |
Elliott Hughes | e9ca709 | 2014-11-17 11:16:59 -0800 | [diff] [blame] | 158 | LOCAL_CFLAGS += -Werror |
David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 159 | LOCAL_C_INCLUDES := $(libcutils_c_includes) |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 160 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 161 | include $(BUILD_SHARED_LIBRARY) |
| 162 | |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 163 | include $(CLEAR_VARS) |
| 164 | LOCAL_MODULE := tst_str_parms |
Mark Salyzyn | 1271716 | 2014-04-29 15:49:14 -0700 | [diff] [blame] | 165 | LOCAL_CFLAGS += -DTEST_STR_PARMS -Werror |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 166 | LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c |
Dima Zavin | 14fc0c2 | 2011-04-27 22:26:23 -0700 | [diff] [blame] | 167 | LOCAL_SHARED_LIBRARIES := liblog |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 168 | LOCAL_MODULE_TAGS := optional |
Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 169 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dima Zavin | 14fc0c2 | 2011-04-27 22:26:23 -0700 | [diff] [blame] | 170 | include $(BUILD_EXECUTABLE) |
Duane Sand | d4a8098 | 2012-10-12 14:25:19 -0700 | [diff] [blame] | 171 | |
| 172 | include $(call all-makefiles-under,$(LOCAL_PATH)) |