blob: 5eed63408213e6e0770b470ad171c5ee4bb8401d [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 Salyzyn1b793692015-03-05 09:56:27 -080019# This is what we want to do:
20# liblog_cflags := $(shell \
21# sed -n \
22# 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
23# $(LOCAL_PATH)/event.logtags)
24# so make sure we do not regret hard-coding it as follows:
25liblog_cflags := -DLIBLOG_LOG_TAG=1005
Mark Salyzynd45d36e2015-02-12 15:14:26 -080026
William Luh964428c2015-08-13 10:41:58 -070027liblog_sources := logd_write.c log_event_write.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080028
29# 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
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080032
Mark Salyzyn1b793692015-03-05 09:56:27 -080033ifeq ($(strip $(USE_MINGW)),)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080034 liblog_sources += \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080035 event_tag_map.c
Colin Cross9227bd32013-07-23 16:59:20 -070036else
37 liblog_sources += \
38 uio.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080039endif
40
Mark Salyzynd45d36e2015-02-12 15:14:26 -080041liblog_host_sources := $(liblog_sources) fake_log_device.c event.logtags
Mark Salyzyn95687052014-10-02 11:12:28 -070042liblog_target_sources := $(liblog_sources) log_time.cpp log_is_loggable.c
Mark Salyzyn1b793692015-03-05 09:56:27 -080043ifeq ($(strip $(USE_MINGW)),)
Mark Salyzyn31dd00f2015-03-04 17:01:30 -080044liblog_target_sources += logprint.c
45endif
Mark Salyzync0626fd2014-03-14 12:05:57 -070046liblog_target_sources += log_read.c
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080047
Elliott Hughesf82e7412011-07-13 17:37:07 -070048# Shared and static library for host
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080049# ========================================================
50LOCAL_MODULE := liblog
51LOCAL_SRC_FILES := $(liblog_host_sources)
Mark Salyzynd45d36e2015-02-12 15:14:26 -080052LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror $(liblog_cflags)
Ian Rogers59ec7652014-06-05 14:32:49 -070053LOCAL_MULTILIB := both
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080054include $(BUILD_HOST_STATIC_LIBRARY)
55
Elliott Hughesf82e7412011-07-13 17:37:07 -070056include $(CLEAR_VARS)
57LOCAL_MODULE := liblog
58LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Christopher Tate5a6b8d12014-03-14 14:59:53 -070059ifeq ($(strip $(HOST_OS)),linux)
Mark Salyzynfa3716b2014-02-14 16:05:05 -080060LOCAL_LDLIBS := -lrt
Christopher Tate5a6b8d12014-03-14 14:59:53 -070061endif
Ian Rogers59ec7652014-06-05 14:32:49 -070062LOCAL_MULTILIB := both
Evgenii Stepanovc744ef52015-06-11 14:39:57 -070063LOCAL_CXX_STL := none
Elliott Hughesf82e7412011-07-13 17:37:07 -070064include $(BUILD_HOST_SHARED_LIBRARY)
65
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080066
Jeff Brown29e1e732011-07-11 22:12:32 -070067# Shared and static library for target
68# ========================================================
69include $(CLEAR_VARS)
70LOCAL_MODULE := liblog
Colin Cross11aa6ee2014-01-03 18:58:16 -080071LOCAL_SRC_FILES := $(liblog_target_sources)
Mark Salyzynd45d36e2015-02-12 15:14:26 -080072LOCAL_CFLAGS := -Werror $(liblog_cflags)
Evgenii Stepanovc744ef52015-06-11 14:39:57 -070073# AddressSanitizer runtime library depends on liblog.
74LOCAL_SANITIZE := never
Jeff Brown29e1e732011-07-11 22:12:32 -070075include $(BUILD_STATIC_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080076
Jeff Brown29e1e732011-07-11 22:12:32 -070077include $(CLEAR_VARS)
78LOCAL_MODULE := liblog
79LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Mark Salyzynd45d36e2015-02-12 15:14:26 -080080LOCAL_CFLAGS := -Werror $(liblog_cflags)
Dmitriy Ivanov692c0e42015-03-09 17:11:17 -070081
82# TODO: This is to work around b/19059885. Remove after root cause is fixed
Dmitriy Ivanovfd8afe62015-05-08 14:09:24 -070083LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
Dmitriy Ivanov692c0e42015-03-09 17:11:17 -070084
Evgenii Stepanovc744ef52015-06-11 14:39:57 -070085LOCAL_SANITIZE := never
86LOCAL_CXX_STL := none
87
Jeff Brown29e1e732011-07-11 22:12:32 -070088include $(BUILD_SHARED_LIBRARY)
Mark Salyzyn819c58a2013-11-22 12:39:43 -080089
90include $(call first-makefiles-under,$(LOCAL_PATH))