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 := \ |
Nick Pelly | 92a7541 | 2009-05-19 19:22:42 -0700 | [diff] [blame^] | 20 | abort_socket.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 21 | array.c \ |
| 22 | hashmap.c \ |
| 23 | atomic.c \ |
| 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 \ |
| 34 | strdup16to8.c \ |
| 35 | strdup8to16.c \ |
| 36 | record_stream.c \ |
| 37 | process_name.c \ |
| 38 | properties.c \ |
| 39 | threads.c |
| 40 | |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 41 | commonHostSources := \ |
| 42 | ashmem-host.c |
| 43 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 44 | # some files must not be compiled when building against Mingw |
| 45 | # they correspond to features not used by our host development tools |
| 46 | # which are also hard or even impossible to port to native Win32 |
| 47 | WITH_MINGW := |
| 48 | ifeq ($(HOST_OS),windows) |
| 49 | ifeq ($(strip $(USE_CYGWIN)),) |
| 50 | WITH_MINGW := 1 |
| 51 | endif |
| 52 | endif |
| 53 | # USE_MINGW is defined when we build against Mingw on Linux |
| 54 | ifneq ($(strip $(USE_MINGW)),) |
| 55 | WITH_MINGW := 1 |
| 56 | endif |
| 57 | |
| 58 | ifeq ($(WITH_MINGW),1) |
| 59 | commonSources += \ |
| 60 | uio.c |
| 61 | else |
| 62 | commonSources += \ |
| 63 | mspace.c \ |
| 64 | selector.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 65 | tztime.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 66 | adb_networking.c \ |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 67 | zygote.c |
| 68 | |
| 69 | commonHostSources += \ |
| 70 | tzstrftime.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 71 | endif |
| 72 | |
| 73 | |
| 74 | # Static library for host |
| 75 | # ======================================================== |
| 76 | LOCAL_MODULE := libcutils |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 77 | LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 78 | LOCAL_LDLIBS := -lpthread |
| 79 | LOCAL_STATIC_LIBRARIES := liblog |
| 80 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 81 | |
| 82 | |
| 83 | ifeq ($(TARGET_SIMULATOR),true) |
| 84 | |
| 85 | # Shared library for simulator |
| 86 | # ======================================================== |
| 87 | include $(CLEAR_VARS) |
| 88 | LOCAL_MODULE := libcutils |
The Android Open Source Project | b1487e4 | 2009-03-18 22:20:28 -0700 | [diff] [blame] | 89 | 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] | 90 | LOCAL_LDLIBS := -lpthread |
| 91 | LOCAL_SHARED_LIBRARIES := liblog |
| 92 | include $(BUILD_SHARED_LIBRARY) |
| 93 | |
| 94 | else #!sim |
| 95 | |
| 96 | # Shared and static library for target |
| 97 | # ======================================================== |
| 98 | include $(CLEAR_VARS) |
| 99 | LOCAL_MODULE := libcutils |
| 100 | LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c |
| 101 | |
| 102 | ifeq ($(TARGET_ARCH),arm) |
| 103 | LOCAL_SRC_FILES += memset32.S atomic-android-arm.S |
| 104 | else # !arm |
| 105 | LOCAL_SRC_FILES += memory.c |
| 106 | endif # !arm |
| 107 | |
| 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 |