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