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