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 \ |
| 49 | iosched_policy.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 += \ |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 73 | abort_socket.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 74 | mspace.c \ |
| 75 | selector.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 76 | tztime.c \ |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 77 | zygote.c |
| 78 | |
| 79 | commonHostSources += \ |
| 80 | tzstrftime.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 81 | endif |
| 82 | |
| 83 | |
| 84 | # Static library for host |
| 85 | # ======================================================== |
| 86 | LOCAL_MODULE := libcutils |
Jesse Wilson | 7ab237f | 2010-08-18 18:17:55 -0700 | [diff] [blame] | 87 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 88 | LOCAL_LDLIBS := -lpthread |
| 89 | LOCAL_STATIC_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 90 | LOCAL_CFLAGS += $(hostSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 91 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 92 | |
| 93 | |
| 94 | ifeq ($(TARGET_SIMULATOR),true) |
| 95 | |
| 96 | # Shared library for simulator |
| 97 | # ======================================================== |
| 98 | include $(CLEAR_VARS) |
| 99 | LOCAL_MODULE := libcutils |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 100 | 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] | 101 | LOCAL_LDLIBS := -lpthread |
| 102 | LOCAL_SHARED_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 103 | LOCAL_CFLAGS += $(targetSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 104 | include $(BUILD_SHARED_LIBRARY) |
| 105 | |
| 106 | else #!sim |
| 107 | |
| 108 | # Shared and static library for target |
| 109 | # ======================================================== |
| 110 | include $(CLEAR_VARS) |
| 111 | LOCAL_MODULE := libcutils |
| 112 | LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c |
| 113 | |
| 114 | ifeq ($(TARGET_ARCH),arm) |
Lu, Hongjiu | bb12ac9 | 2010-12-27 16:53:58 -0800 | [diff] [blame^] | 115 | LOCAL_SRC_FILES += arch-arm/memset32.S |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 116 | else # !arm |
Shin-ichiro KAWASAKI | c6af911 | 2009-08-04 19:14:22 +0900 | [diff] [blame] | 117 | ifeq ($(TARGET_ARCH),sh) |
| 118 | LOCAL_SRC_FILES += memory.c atomic-android-sh.c |
| 119 | else # !sh |
Lu, Hongjiu | bb12ac9 | 2010-12-27 16:53:58 -0800 | [diff] [blame^] | 120 | ifeq ($(TARGET_ARCH_VARIANT),x86-atom) |
| 121 | LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32 |
| 122 | LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c |
| 123 | else # !x86-atom |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 124 | LOCAL_SRC_FILES += memory.c |
Lu, Hongjiu | bb12ac9 | 2010-12-27 16:53:58 -0800 | [diff] [blame^] | 125 | endif # !x86-atom |
Shin-ichiro KAWASAKI | c6af911 | 2009-08-04 19:14:22 +0900 | [diff] [blame] | 126 | endif # !sh |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 127 | endif # !arm |
| 128 | |
| 129 | LOCAL_C_INCLUDES := $(KERNEL_HEADERS) |
| 130 | LOCAL_STATIC_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 131 | LOCAL_CFLAGS += $(targetSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 132 | include $(BUILD_STATIC_LIBRARY) |
| 133 | |
| 134 | include $(CLEAR_VARS) |
| 135 | LOCAL_MODULE := libcutils |
| 136 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils |
| 137 | LOCAL_SHARED_LIBRARIES := liblog |
Andy McFadden | ac322da | 2010-05-19 22:33:28 -0700 | [diff] [blame] | 138 | LOCAL_CFLAGS += $(targetSmpFlag) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 139 | include $(BUILD_SHARED_LIBRARY) |
| 140 | |
| 141 | endif #!sim |