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 \ |
| 38 | config_utils.c \ |
| 39 | cpu_info.c \ |
| 40 | load_file.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 \ |
| 44 | record_stream.c \ |
| 45 | process_name.c \ |
| 46 | properties.c \ |
San Mehat | 493dad9 | 2009-09-12 10:06:57 -0700 | [diff] [blame] | 47 | threads.c \ |
San Mehat | 10d469b | 2010-02-25 14:02:55 -0800 | [diff] [blame] | 48 | sched_policy.c \ |
Jean-Baptiste Queru | 89790b8 | 2011-06-18 11:53:34 -0700 | [diff] [blame] | 49 | iosched_policy.c \ |
| 50 | str_parms.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 51 | |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 52 | commonHostSources := \ |
| 53 | ashmem-host.c |
| 54 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 55 | # some files must not be compiled when building against Mingw |
| 56 | # they correspond to features not used by our host development tools |
| 57 | # which are also hard or even impossible to port to native Win32 |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 58 | WINDOWS_HOST_ONLY := |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 59 | ifeq ($(HOST_OS),windows) |
| 60 | ifeq ($(strip $(USE_CYGWIN)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 61 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 62 | endif |
| 63 | endif |
| 64 | # USE_MINGW is defined when we build against Mingw on Linux |
| 65 | ifneq ($(strip $(USE_MINGW)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 66 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 67 | endif |
| 68 | |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 69 | ifeq ($(WINDOWS_HOST_ONLY),1) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 70 | commonSources += \ |
| 71 | uio.c |
| 72 | else |
| 73 | commonSources += \ |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 74 | abort_socket.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 75 | mspace.c \ |
| 76 | selector.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 77 | tztime.c \ |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 78 | zygote.c |
| 79 | |
| 80 | commonHostSources += \ |
| 81 | tzstrftime.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 | |
| 95 | ifeq ($(TARGET_SIMULATOR),true) |
| 96 | |
| 97 | # Shared library for simulator |
| 98 | # ======================================================== |
| 99 | include $(CLEAR_VARS) |
| 100 | LOCAL_MODULE := libcutils |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 101 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) memory.c dlmalloc_stubs.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 102 | LOCAL_LDLIBS := -lpthread |
| 103 | LOCAL_SHARED_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 104 | LOCAL_CFLAGS += $(targetSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 105 | include $(BUILD_SHARED_LIBRARY) |
| 106 | |
| 107 | else #!sim |
| 108 | |
| 109 | # Shared and static library for target |
| 110 | # ======================================================== |
| 111 | include $(CLEAR_VARS) |
| 112 | LOCAL_MODULE := libcutils |
Vernon Tang | 3f582e9 | 2011-04-25 13:08:17 +1000 | [diff] [blame] | 113 | LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c uevent.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 114 | |
| 115 | ifeq ($(TARGET_ARCH),arm) |
Bruce Beare | d7a2952 | 2010-12-27 16:53:58 -0800 | [diff] [blame] | 116 | LOCAL_SRC_FILES += arch-arm/memset32.S |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 117 | else # !arm |
Shin-ichiro KAWASAKI | c6af911 | 2009-08-04 19:14:22 +0900 | [diff] [blame] | 118 | ifeq ($(TARGET_ARCH),sh) |
| 119 | LOCAL_SRC_FILES += memory.c atomic-android-sh.c |
| 120 | else # !sh |
Bruce Beare | d7a2952 | 2010-12-27 16:53:58 -0800 | [diff] [blame] | 121 | ifeq ($(TARGET_ARCH_VARIANT),x86-atom) |
| 122 | LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
| 123 | LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c |
| 124 | else # !x86-atom |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 125 | LOCAL_SRC_FILES += memory.c |
Bruce Beare | d7a2952 | 2010-12-27 16:53:58 -0800 | [diff] [blame] | 126 | endif # !x86-atom |
Shin-ichiro KAWASAKI | c6af911 | 2009-08-04 19:14:22 +0900 | [diff] [blame] | 127 | endif # !sh |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 128 | endif # !arm |
| 129 | |
| 130 | LOCAL_C_INCLUDES := $(KERNEL_HEADERS) |
| 131 | LOCAL_STATIC_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 132 | LOCAL_CFLAGS += $(targetSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 133 | include $(BUILD_STATIC_LIBRARY) |
| 134 | |
| 135 | include $(CLEAR_VARS) |
| 136 | LOCAL_MODULE := libcutils |
| 137 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils |
| 138 | LOCAL_SHARED_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_SHARED_LIBRARY) |
| 141 | |
| 142 | endif #!sim |