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