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 | |
Jeff Sharkey | 0ee7d8c | 2013-09-20 17:58:54 -0700 | [diff] [blame] | 68 | ifneq ($(WINDOWS_HOST_ONLY),1) |
| 69 | commonSources += \ |
| 70 | fs.c \ |
| 71 | multiuser.c |
| 72 | endif |
| 73 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 74 | |
| 75 | # Static library for host |
| 76 | # ======================================================== |
| 77 | LOCAL_MODULE := libcutils |
Jesse Wilson | 7ab237f | 2010-08-18 18:17:55 -0700 | [diff] [blame] | 78 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 79 | LOCAL_LDLIBS := -lpthread |
| 80 | LOCAL_STATIC_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 81 | LOCAL_CFLAGS += $(hostSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 82 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 83 | |
| 84 | |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 85 | # Static library for host, 64-bit |
| 86 | # ======================================================== |
| 87 | include $(CLEAR_VARS) |
| 88 | LOCAL_MODULE := lib64cutils |
| 89 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c |
| 90 | LOCAL_LDLIBS := -lpthread |
| 91 | LOCAL_STATIC_LIBRARIES := lib64log |
| 92 | LOCAL_CFLAGS += $(hostSmpFlag) -m64 |
| 93 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 94 | |
| 95 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 96 | # Shared and static library for target |
| 97 | # ======================================================== |
David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 98 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 99 | include $(CLEAR_VARS) |
| 100 | LOCAL_MODULE := libcutils |
Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 101 | LOCAL_SRC_FILES := $(commonSources) \ |
| 102 | android_reboot.c \ |
| 103 | ashmem-dev.c \ |
| 104 | debugger.c \ |
| 105 | klog.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 \ |
Jeff Sharkey | 885342a | 2012-08-14 21:00:22 -0700 | [diff] [blame] | 110 | uevent.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 111 | |
| 112 | ifeq ($(TARGET_ARCH),arm) |
Daniel Leung | 51546ee | 2012-05-24 16:54:49 -0700 | [diff] [blame] | 113 | LOCAL_SRC_FILES += arch-arm/memset32.S |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 114 | else # !arm |
Daniel Leung | 51546ee | 2012-05-24 16:54:49 -0700 | [diff] [blame] | 115 | ifeq ($(TARGET_ARCH),x86) |
Pavel Chupin | 4aa51cd | 2013-10-10 20:19:15 +0400 | [diff] [blame] | 116 | LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
| 117 | 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] | 118 | else # !x86 |
| 119 | ifeq ($(TARGET_ARCH),mips) |
| 120 | LOCAL_SRC_FILES += arch-mips/android_memset.c |
| 121 | else # !mips |
| 122 | LOCAL_SRC_FILES += memory.c |
| 123 | endif # !mips |
| 124 | endif # !x86 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 125 | endif # !arm |
| 126 | |
Colin Cross | 65dd88b | 2014-01-22 19:06:04 -0800 | [diff] [blame^] | 127 | LOCAL_C_INCLUDES := $(libcutils_c_includes) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 128 | LOCAL_STATIC_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 129 | LOCAL_CFLAGS += $(targetSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 130 | include $(BUILD_STATIC_LIBRARY) |
| 131 | |
| 132 | include $(CLEAR_VARS) |
| 133 | LOCAL_MODULE := libcutils |
Ying Wang | c796ed9 | 2013-04-10 17:27:35 -0700 | [diff] [blame] | 134 | # TODO: remove liblog as whole static library, once we don't have prebuilt that requires |
| 135 | # liblog symbols present in libcutils. |
| 136 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 137 | LOCAL_SHARED_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 138 | LOCAL_CFLAGS += $(targetSmpFlag) |
David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 139 | LOCAL_C_INCLUDES := $(libcutils_c_includes) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 140 | include $(BUILD_SHARED_LIBRARY) |
| 141 | |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 142 | include $(CLEAR_VARS) |
| 143 | LOCAL_MODULE := tst_str_parms |
| 144 | LOCAL_CFLAGS += -DTEST_STR_PARMS |
| 145 | LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c |
Dima Zavin | 14fc0c2 | 2011-04-27 22:26:23 -0700 | [diff] [blame] | 146 | LOCAL_SHARED_LIBRARIES := liblog |
Dima Zavin | 0fad7d0 | 2011-03-24 11:11:06 -0700 | [diff] [blame] | 147 | LOCAL_MODULE_TAGS := optional |
Dima Zavin | 14fc0c2 | 2011-04-27 22:26:23 -0700 | [diff] [blame] | 148 | include $(BUILD_EXECUTABLE) |
Duane Sand | d4a8098 | 2012-10-12 14:25:19 -0700 | [diff] [blame] | 149 | |
| 150 | include $(call all-makefiles-under,$(LOCAL_PATH)) |