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