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 | |
| 19 | commonSources := \ |
| 20 | array.c \ |
| 21 | hashmap.c \ |
| 22 | atomic.c \ |
Mathias Agopian | 1d3faaf | 2009-04-10 14:24:31 -0700 | [diff] [blame] | 23 | native_handle.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 24 | buffer.c \ |
| 25 | socket_inaddr_any_server.c \ |
| 26 | socket_local_client.c \ |
| 27 | socket_local_server.c \ |
| 28 | socket_loopback_client.c \ |
| 29 | socket_loopback_server.c \ |
| 30 | socket_network_client.c \ |
| 31 | config_utils.c \ |
| 32 | cpu_info.c \ |
| 33 | load_file.c \ |
Andy McFadden | cf63d5d | 2010-01-22 16:37:25 -0800 | [diff] [blame] | 34 | open_memstream.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 35 | strdup16to8.c \ |
| 36 | strdup8to16.c \ |
| 37 | record_stream.c \ |
| 38 | process_name.c \ |
| 39 | properties.c \ |
San Mehat | 493dad9 | 2009-09-12 10:06:57 -0700 | [diff] [blame] | 40 | threads.c \ |
San Mehat | 10d469b | 2010-02-25 14:02:55 -0800 | [diff] [blame^] | 41 | sched_policy.c \ |
| 42 | iosched_policy.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 43 | |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 44 | commonHostSources := \ |
| 45 | ashmem-host.c |
| 46 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 47 | # some files must not be compiled when building against Mingw |
| 48 | # they correspond to features not used by our host development tools |
| 49 | # which are also hard or even impossible to port to native Win32 |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 50 | WINDOWS_HOST_ONLY := |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 51 | ifeq ($(HOST_OS),windows) |
| 52 | ifeq ($(strip $(USE_CYGWIN)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 53 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 54 | endif |
| 55 | endif |
| 56 | # USE_MINGW is defined when we build against Mingw on Linux |
| 57 | ifneq ($(strip $(USE_MINGW)),) |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 58 | WINDOWS_HOST_ONLY := 1 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 59 | endif |
| 60 | |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 61 | ifeq ($(WINDOWS_HOST_ONLY),1) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 62 | commonSources += \ |
| 63 | uio.c |
| 64 | else |
| 65 | commonSources += \ |
Raphael | f3cdf37 | 2009-05-26 13:23:23 -0700 | [diff] [blame] | 66 | abort_socket.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 67 | mspace.c \ |
| 68 | selector.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 69 | tztime.c \ |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 70 | zygote.c |
| 71 | |
| 72 | commonHostSources += \ |
| 73 | tzstrftime.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 74 | endif |
| 75 | |
| 76 | |
| 77 | # Static library for host |
| 78 | # ======================================================== |
| 79 | LOCAL_MODULE := libcutils |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 80 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 81 | LOCAL_LDLIBS := -lpthread |
| 82 | LOCAL_STATIC_LIBRARIES := liblog |
| 83 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 84 | |
| 85 | |
| 86 | ifeq ($(TARGET_SIMULATOR),true) |
| 87 | |
| 88 | # Shared library for simulator |
| 89 | # ======================================================== |
| 90 | include $(CLEAR_VARS) |
| 91 | LOCAL_MODULE := libcutils |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 92 | 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] | 93 | LOCAL_LDLIBS := -lpthread |
| 94 | LOCAL_SHARED_LIBRARIES := liblog |
| 95 | include $(BUILD_SHARED_LIBRARY) |
| 96 | |
| 97 | else #!sim |
| 98 | |
| 99 | # Shared and static library for target |
| 100 | # ======================================================== |
| 101 | include $(CLEAR_VARS) |
| 102 | LOCAL_MODULE := libcutils |
| 103 | LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c |
| 104 | |
| 105 | ifeq ($(TARGET_ARCH),arm) |
| 106 | LOCAL_SRC_FILES += memset32.S atomic-android-arm.S |
| 107 | else # !arm |
Shin-ichiro KAWASAKI | c6af911 | 2009-08-04 19:14:22 +0900 | [diff] [blame] | 108 | ifeq ($(TARGET_ARCH),sh) |
| 109 | LOCAL_SRC_FILES += memory.c atomic-android-sh.c |
| 110 | else # !sh |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 111 | LOCAL_SRC_FILES += memory.c |
Shin-ichiro KAWASAKI | c6af911 | 2009-08-04 19:14:22 +0900 | [diff] [blame] | 112 | endif # !sh |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 113 | endif # !arm |
| 114 | |
| 115 | LOCAL_C_INCLUDES := $(KERNEL_HEADERS) |
| 116 | LOCAL_STATIC_LIBRARIES := liblog |
| 117 | include $(BUILD_STATIC_LIBRARY) |
| 118 | |
| 119 | include $(CLEAR_VARS) |
| 120 | LOCAL_MODULE := libcutils |
| 121 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils |
| 122 | LOCAL_SHARED_LIBRARIES := liblog |
| 123 | include $(BUILD_SHARED_LIBRARY) |
| 124 | |
| 125 | endif #!sim |