Android.mk revision da04c52ab1036048520fca265cf02b61dca789e0
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#
16LOCAL_PATH := $(my-dir)
17include $(CLEAR_VARS)
18
19ifeq ($(TARGET_CPU_SMP),true)
20    targetSmpFlag := -DANDROID_SMP=1
21else
22    targetSmpFlag := -DANDROID_SMP=0
23endif
24hostSmpFlag := -DANDROID_SMP=0
25
26commonSources := \
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	sockets.c \
39	config_utils.c \
40	cpu_info.c \
41	load_file.c \
42	klog.c \
43	list.c \
44	open_memstream.c \
45	strdup16to8.c \
46	strdup8to16.c \
47	record_stream.c \
48	process_name.c \
49	properties.c \
50	threads.c \
51	sched_policy.c \
52	iosched_policy.c \
53	str_parms.c
54
55commonHostSources := \
56        ashmem-host.c
57
58# some files must not be compiled when building against Mingw
59# they correspond to features not used by our host development tools
60# which are also hard or even impossible to port to native Win32
61WINDOWS_HOST_ONLY :=
62ifeq ($(HOST_OS),windows)
63    ifeq ($(strip $(USE_CYGWIN)),)
64        WINDOWS_HOST_ONLY := 1
65    endif
66endif
67# USE_MINGW is defined when we build against Mingw on Linux
68ifneq ($(strip $(USE_MINGW)),)
69    WINDOWS_HOST_ONLY := 1
70endif
71
72ifeq ($(WINDOWS_HOST_ONLY),1)
73    commonSources += \
74        uio.c
75else
76    commonSources += \
77        abort_socket.c \
78        mspace.c \
79        selector.c \
80        tztime.c \
81        zygote.c
82
83    commonHostSources += \
84        tzstrftime.c
85endif
86
87
88# Static library for host
89# ========================================================
90LOCAL_MODULE := libcutils
91LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
92LOCAL_LDLIBS := -lpthread
93LOCAL_STATIC_LIBRARIES := liblog
94LOCAL_CFLAGS += $(hostSmpFlag)
95include $(BUILD_HOST_STATIC_LIBRARY)
96
97
98# Shared and static library for target
99# ========================================================
100include $(CLEAR_VARS)
101LOCAL_MODULE := libcutils
102LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c android_reboot.c partition_utils.c uevent.c qtaguid.c
103
104ifeq ($(TARGET_ARCH),arm)
105LOCAL_SRC_FILES += arch-arm/memset32.S
106else  # !arm
107ifeq ($(TARGET_ARCH),sh)
108LOCAL_SRC_FILES += memory.c atomic-android-sh.c
109else  # !sh
110ifeq ($(TARGET_ARCH_VARIANT),x86-atom)
111LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32
112LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c
113else # !x86-atom
114LOCAL_SRC_FILES += memory.c
115endif # !x86-atom
116endif # !sh
117endif # !arm
118
119LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
120LOCAL_STATIC_LIBRARIES := liblog
121LOCAL_CFLAGS += $(targetSmpFlag)
122include $(BUILD_STATIC_LIBRARY)
123
124include $(CLEAR_VARS)
125LOCAL_MODULE := libcutils
126LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
127LOCAL_SHARED_LIBRARIES := liblog
128LOCAL_CFLAGS += $(targetSmpFlag)
129include $(BUILD_SHARED_LIBRARY)
130
131include $(CLEAR_VARS)
132LOCAL_MODULE := tst_str_parms
133LOCAL_CFLAGS += -DTEST_STR_PARMS
134LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
135LOCAL_SHARED_LIBRARIES := liblog
136LOCAL_MODULE_TAGS := optional
137include $(BUILD_EXECUTABLE)
138