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 | |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 19 | ifeq ($(TARGET_CPU_SMP),true) |
| 20 | targetSmpFlag := -DANDROID_SMP=1 |
| 21 | else |
| 22 | targetSmpFlag := -DANDROID_SMP=0 |
| 23 | endif |
| 24 | hostSmpFlag := -DANDROID_SMP=0 |
| 25 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 26 | commonSources := \ |
| 27 | array.c \ |
| 28 | hashmap.c \ |
Carl Shapiro | 93b0cb4 | 2010-06-03 17:05:15 -0700 | [diff] [blame] | 29 | atomic.c.arm \ |
Mathias Agopian | 1d3faaf | 2009-04-10 14:24:31 -0700 | [diff] [blame] | 30 | native_handle.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 31 | 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 \ |
jeffhao | 2b8f76c | 2011-05-05 14:25:36 -0700 | [diff] [blame] | 38 | sockets.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 39 | config_utils.c \ |
| 40 | cpu_info.c \ |
| 41 | load_file.c \ |
Dima Zavin | da04c52 | 2011-09-01 17:09:44 -0700 | [diff] [blame] | 42 | list.c \ |
Andy McFadden | cf63d5d | 2010-01-22 16:37:25 -0800 | [diff] [blame] | 43 | open_memstream.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 44 | strdup16to8.c \ |
| 45 | strdup8to16.c \ |
| 46 | record_stream.c \ |
| 47 | process_name.c \ |
| 48 | properties.c \ |
Jeff Brown | 4a6b384 | 2012-03-19 14:07:26 -0700 | [diff] [blame] | 49 | qsort_r_compat.c \ |
San Mehat | 493dad9 | 2009-09-12 10:06:57 -0700 | [diff] [blame] | 50 | threads.c \ |
San Mehat | 10d469b | 2010-02-25 14:02:55 -0800 | [diff] [blame] | 51 | sched_policy.c \ |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 52 | iosched_policy.c \ |
Jeff Sharkey | 885342a | 2012-08-14 21:00:22 -0700 | [diff] [blame] | 53 | str_parms.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 54 | |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 55 | commonHostSources := \ |
| 56 | ashmem-host.c |
| 57 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 58 | # some files must not be compiled when building against Mingw |
| 59 | # they correspond to features not used by our host development tools |
| 60 | # which are also hard or even impossible to port to native Win32 |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 61 | WINDOWS_HOST_ONLY := |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 62 | ifeq ($(HOST_OS),windows) |
| 63 | ifeq ($(strip $(USE_CYGWIN)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 64 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 65 | endif |
| 66 | endif |
| 67 | # USE_MINGW is defined when we build against Mingw on Linux |
| 68 | ifneq ($(strip $(USE_MINGW)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 69 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 70 | endif |
| 71 | |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 72 | ifeq ($(WINDOWS_HOST_ONLY),1) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 73 | commonSources += \ |
| 74 | uio.c |
| 75 | else |
| 76 | commonSources += \ |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 77 | abort_socket.c \ |
Jeff Sharkey | 9685194 | 2012-08-27 15:03:37 -0700 | [diff] [blame] | 78 | fs.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 79 | selector.c \ |
Jeff Sharkey | de980f2 | 2012-08-16 17:16:43 -0700 | [diff] [blame] | 80 | multiuser.c \ |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 81 | zygote.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 82 | endif |
| 83 | |
| 84 | |
| 85 | # Static library for host |
| 86 | # ======================================================== |
| 87 | LOCAL_MODULE := libcutils |
Jesse Wilson | 7ab237f | 2010-08-18 18:17:55 -0700 | [diff] [blame] | 88 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 89 | LOCAL_LDLIBS := -lpthread |
| 90 | LOCAL_STATIC_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 91 | LOCAL_CFLAGS += $(hostSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 92 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 93 | |
| 94 | |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 95 | # Static library for host, 64-bit |
| 96 | # ======================================================== |
| 97 | include $(CLEAR_VARS) |
| 98 | LOCAL_MODULE := lib64cutils |
| 99 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c |
| 100 | LOCAL_LDLIBS := -lpthread |
| 101 | LOCAL_STATIC_LIBRARIES := lib64log |
| 102 | LOCAL_CFLAGS += $(hostSmpFlag) -m64 |
| 103 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 104 | |
| 105 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 106 | # Shared and static library for target |
| 107 | # ======================================================== |
David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 108 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 109 | include $(CLEAR_VARS) |
| 110 | LOCAL_MODULE := libcutils |
Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 111 | LOCAL_SRC_FILES := $(commonSources) \ |
| 112 | android_reboot.c \ |
| 113 | ashmem-dev.c \ |
| 114 | debugger.c \ |
| 115 | klog.c \ |
| 116 | mq.c \ |
| 117 | partition_utils.c \ |
| 118 | qtaguid.c \ |
Alex Ray | 0a34643 | 2012-11-14 17:25:28 -0800 | [diff] [blame] | 119 | trace.c \ |
Jeff Sharkey | 885342a | 2012-08-14 21:00:22 -0700 | [diff] [blame] | 120 | uevent.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 121 | |
| 122 | ifeq ($(TARGET_ARCH),arm) |
Daniel Leung | 51546ee | 2012-05-24 16:54:49 -0700 | [diff] [blame] | 123 | LOCAL_SRC_FILES += arch-arm/memset32.S |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 124 | else # !arm |
Daniel Leung | 51546ee | 2012-05-24 16:54:49 -0700 | [diff] [blame] | 125 | ifeq ($(TARGET_ARCH),x86) |
Pavel Chupin | 4aa51cd | 2013-10-10 20:19:15 +0400 | [diff] [blame] | 126 | LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
| 127 | LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c |
Daniel Leung | 51546ee | 2012-05-24 16:54:49 -0700 | [diff] [blame] | 128 | else # !x86 |
| 129 | ifeq ($(TARGET_ARCH),mips) |
| 130 | LOCAL_SRC_FILES += arch-mips/android_memset.c |
| 131 | else # !mips |
| 132 | LOCAL_SRC_FILES += memory.c |
| 133 | endif # !mips |
| 134 | endif # !x86 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 135 | endif # !arm |
| 136 | |
David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 137 | LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 138 | LOCAL_STATIC_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 139 | LOCAL_CFLAGS += $(targetSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 140 | include $(BUILD_STATIC_LIBRARY) |
| 141 | |
| 142 | include $(CLEAR_VARS) |
| 143 | LOCAL_MODULE := libcutils |
Ying Wang | c796ed9 | 2013-04-10 17:27:35 -0700 | [diff] [blame] | 144 | # TODO: remove liblog as whole static library, once we don't have prebuilt that requires |
| 145 | # liblog symbols present in libcutils. |
| 146 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 147 | LOCAL_SHARED_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 148 | LOCAL_CFLAGS += $(targetSmpFlag) |
David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 149 | LOCAL_C_INCLUDES := $(libcutils_c_includes) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 150 | include $(BUILD_SHARED_LIBRARY) |
| 151 | |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 152 | include $(CLEAR_VARS) |
| 153 | LOCAL_MODULE := tst_str_parms |
| 154 | LOCAL_CFLAGS += -DTEST_STR_PARMS |
| 155 | LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c |
Dima Zavin | 14fc0c2 | 2011-04-27 22:26:23 -0700 | [diff] [blame] | 156 | LOCAL_SHARED_LIBRARIES := liblog |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 157 | LOCAL_MODULE_TAGS := optional |
Dima Zavin | 14fc0c2 | 2011-04-27 22:26:23 -0700 | [diff] [blame] | 158 | include $(BUILD_EXECUTABLE) |
Duane Sand | d4a8098 | 2012-10-12 14:25:19 -0700 | [diff] [blame] | 159 | |
| 160 | include $(call all-makefiles-under,$(LOCAL_PATH)) |