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 \ |
| 23 | buffer.c \ |
| 24 | socket_inaddr_any_server.c \ |
| 25 | socket_local_client.c \ |
| 26 | socket_local_server.c \ |
| 27 | socket_loopback_client.c \ |
| 28 | socket_loopback_server.c \ |
| 29 | socket_network_client.c \ |
| 30 | config_utils.c \ |
| 31 | cpu_info.c \ |
| 32 | load_file.c \ |
| 33 | strdup16to8.c \ |
| 34 | strdup8to16.c \ |
| 35 | record_stream.c \ |
| 36 | process_name.c \ |
| 37 | properties.c \ |
| 38 | threads.c |
| 39 | |
| 40 | # some files must not be compiled when building against Mingw |
| 41 | # they correspond to features not used by our host development tools |
| 42 | # which are also hard or even impossible to port to native Win32 |
| 43 | WITH_MINGW := |
| 44 | ifeq ($(HOST_OS),windows) |
| 45 | ifeq ($(strip $(USE_CYGWIN)),) |
| 46 | WITH_MINGW := 1 |
| 47 | endif |
| 48 | endif |
| 49 | # USE_MINGW is defined when we build against Mingw on Linux |
| 50 | ifneq ($(strip $(USE_MINGW)),) |
| 51 | WITH_MINGW := 1 |
| 52 | endif |
| 53 | |
| 54 | ifeq ($(WITH_MINGW),1) |
| 55 | commonSources += \ |
| 56 | uio.c |
| 57 | else |
| 58 | commonSources += \ |
| 59 | mspace.c \ |
| 60 | selector.c \ |
| 61 | fdevent.c \ |
| 62 | tztime.c \ |
| 63 | tzstrftime.c \ |
| 64 | adb_networking.c \ |
| 65 | zygote.c |
| 66 | endif |
| 67 | |
| 68 | |
| 69 | # Static library for host |
| 70 | # ======================================================== |
| 71 | LOCAL_MODULE := libcutils |
| 72 | LOCAL_SRC_FILES := $(commonSources) ashmem-host.c |
| 73 | LOCAL_LDLIBS := -lpthread |
| 74 | LOCAL_STATIC_LIBRARIES := liblog |
| 75 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 76 | |
| 77 | |
| 78 | ifeq ($(TARGET_SIMULATOR),true) |
| 79 | |
| 80 | # Shared library for simulator |
| 81 | # ======================================================== |
| 82 | include $(CLEAR_VARS) |
| 83 | LOCAL_MODULE := libcutils |
| 84 | LOCAL_SRC_FILES := $(commonSources) memory.c dlmalloc_stubs.c ashmem-host.c |
| 85 | LOCAL_LDLIBS := -lpthread |
| 86 | LOCAL_SHARED_LIBRARIES := liblog |
| 87 | include $(BUILD_SHARED_LIBRARY) |
| 88 | |
| 89 | else #!sim |
| 90 | |
| 91 | # Shared and static library for target |
| 92 | # ======================================================== |
| 93 | include $(CLEAR_VARS) |
| 94 | LOCAL_MODULE := libcutils |
| 95 | LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c |
| 96 | |
| 97 | ifeq ($(TARGET_ARCH),arm) |
| 98 | LOCAL_SRC_FILES += memset32.S atomic-android-arm.S |
| 99 | else # !arm |
| 100 | LOCAL_SRC_FILES += memory.c |
| 101 | endif # !arm |
| 102 | |
| 103 | LOCAL_C_INCLUDES := $(KERNEL_HEADERS) |
| 104 | LOCAL_STATIC_LIBRARIES := liblog |
| 105 | include $(BUILD_STATIC_LIBRARY) |
| 106 | |
| 107 | include $(CLEAR_VARS) |
| 108 | LOCAL_MODULE := libcutils |
| 109 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils |
| 110 | LOCAL_SHARED_LIBRARIES := liblog |
| 111 | include $(BUILD_SHARED_LIBRARY) |
| 112 | |
| 113 | endif #!sim |