blob: a23de2dbfae04366b88f0f1cb06fed36cefc25fc [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001#
Mark Salyzyn819c58a2013-11-22 12:39:43 -08002# Copyright (C) 2008-2014 The Android Open Source Project
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08003#
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
Mark Salyzyn99ff9462014-03-12 09:29:06 -070019ifneq ($(TARGET_USES_LOGD),false)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080020liblog_sources := logd_write.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080021else
22liblog_sources := logd_write_kern.c
23endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080024
Mark Salyzyndfa7a072014-02-11 12:29:31 -080025ifneq ($(filter userdebug eng,$(TARGET_BUILD_VARIANT)),)
26liblog_cflags := -DUSERDEBUG_BUILD=1
27endif
28
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080029# some files must not be compiled when building against Mingw
30# they correspond to features not used by our host development tools
31# which are also hard or even impossible to port to native Win32
32WITH_MINGW :=
33ifeq ($(HOST_OS),windows)
34 ifeq ($(strip $(USE_CYGWIN)),)
35 WITH_MINGW := true
36 endif
37endif
38# USE_MINGW is defined when we build against Mingw on Linux
39ifneq ($(strip $(USE_MINGW)),)
40 WITH_MINGW := true
41endif
42
43ifndef WITH_MINGW
44 liblog_sources += \
45 logprint.c \
46 event_tag_map.c
Colin Cross9227bd32013-07-23 16:59:20 -070047else
48 liblog_sources += \
49 uio.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080050endif
51
52liblog_host_sources := $(liblog_sources) fake_log_device.c
Mark Salyzync0626fd2014-03-14 12:05:57 -070053liblog_target_sources := $(liblog_sources) log_time.cpp
Mark Salyzyn99ff9462014-03-12 09:29:06 -070054ifneq ($(TARGET_USES_LOGD),false)
Mark Salyzync0626fd2014-03-14 12:05:57 -070055liblog_target_sources += log_read.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080056else
Mark Salyzync0626fd2014-03-14 12:05:57 -070057liblog_target_sources += log_read_kern.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080058endif
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080059
Elliott Hughesf82e7412011-07-13 17:37:07 -070060# Shared and static library for host
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080061# ========================================================
62LOCAL_MODULE := liblog
63LOCAL_SRC_FILES := $(liblog_host_sources)
Christopher Tatedc507762014-03-14 14:37:39 -070064LOCAL_LDLIBS := -lpthread
65ifeq ($(strip $(HOST_OS)),linux)
66LOCAL_LDLIBS += -lrt
67endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080068LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1
69include $(BUILD_HOST_STATIC_LIBRARY)
70
Elliott Hughesf82e7412011-07-13 17:37:07 -070071include $(CLEAR_VARS)
72LOCAL_MODULE := liblog
73LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Christopher Tate5a6b8d12014-03-14 14:59:53 -070074ifeq ($(strip $(HOST_OS)),linux)
Mark Salyzynfa3716b2014-02-14 16:05:05 -080075LOCAL_LDLIBS := -lrt
Christopher Tate5a6b8d12014-03-14 14:59:53 -070076endif
Elliott Hughesf82e7412011-07-13 17:37:07 -070077include $(BUILD_HOST_SHARED_LIBRARY)
78
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080079
80# Static library for host, 64-bit
81# ========================================================
82include $(CLEAR_VARS)
83LOCAL_MODULE := lib64log
84LOCAL_SRC_FILES := $(liblog_host_sources)
Christopher Tatedc507762014-03-14 14:37:39 -070085LOCAL_LDLIBS := -lpthread
86ifeq ($(strip $(HOST_OS)),linux)
87LOCAL_LDLIBS += -lrt
88endif
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080089LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -m64
90include $(BUILD_HOST_STATIC_LIBRARY)
91
Jeff Brown29e1e732011-07-11 22:12:32 -070092# Shared and static library for target
93# ========================================================
94include $(CLEAR_VARS)
95LOCAL_MODULE := liblog
Colin Cross11aa6ee2014-01-03 18:58:16 -080096LOCAL_SRC_FILES := $(liblog_target_sources)
Mark Salyzyndfa7a072014-02-11 12:29:31 -080097LOCAL_CFLAGS := $(liblog_cflags)
Jeff Brown29e1e732011-07-11 22:12:32 -070098include $(BUILD_STATIC_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080099
Jeff Brown29e1e732011-07-11 22:12:32 -0700100include $(CLEAR_VARS)
101LOCAL_MODULE := liblog
102LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Mark Salyzyndfa7a072014-02-11 12:29:31 -0800103LOCAL_CFLAGS := $(liblog_cflags)
Jeff Brown29e1e732011-07-11 22:12:32 -0700104include $(BUILD_SHARED_LIBRARY)
Mark Salyzyn819c58a2013-11-22 12:39:43 -0800105
106include $(call first-makefiles-under,$(LOCAL_PATH))