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