blob: ea179fac533c0cd8f4827221db5e5fe25477baaf [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 Salyzynd45d36e2015-02-12 15:14:26 -080019liblog_cflags := $(shell sed -n 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' $(LOCAL_PATH)/event.logtags)
20
Mark Salyzyn99ff9462014-03-12 09:29:06 -070021ifneq ($(TARGET_USES_LOGD),false)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080022liblog_sources := logd_write.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080023else
24liblog_sources := logd_write_kern.c
25endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080026
27# some files must not be compiled when building against Mingw
28# they correspond to features not used by our host development tools
29# which are also hard or even impossible to port to native Win32
30WITH_MINGW :=
31ifeq ($(HOST_OS),windows)
32 ifeq ($(strip $(USE_CYGWIN)),)
33 WITH_MINGW := true
34 endif
35endif
36# USE_MINGW is defined when we build against Mingw on Linux
37ifneq ($(strip $(USE_MINGW)),)
38 WITH_MINGW := true
39endif
40
41ifndef WITH_MINGW
42 liblog_sources += \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080043 event_tag_map.c
Colin Cross9227bd32013-07-23 16:59:20 -070044else
45 liblog_sources += \
46 uio.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080047endif
48
Mark Salyzynd45d36e2015-02-12 15:14:26 -080049liblog_host_sources := $(liblog_sources) fake_log_device.c event.logtags
Mark Salyzyn95687052014-10-02 11:12:28 -070050liblog_target_sources := $(liblog_sources) log_time.cpp log_is_loggable.c
Mark Salyzyn31dd00f2015-03-04 17:01:30 -080051ifndef WITH_MINGW
52liblog_target_sources += logprint.c
53endif
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)
Mark Salyzynd45d36e2015-02-12 15:14:26 -080064LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror $(liblog_cflags)
Ian Rogers59ec7652014-06-05 14:32:49 -070065LOCAL_MULTILIB := both
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080066include $(BUILD_HOST_STATIC_LIBRARY)
67
Elliott Hughesf82e7412011-07-13 17:37:07 -070068include $(CLEAR_VARS)
69LOCAL_MODULE := liblog
70LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Christopher Tate5a6b8d12014-03-14 14:59:53 -070071ifeq ($(strip $(HOST_OS)),linux)
Mark Salyzynfa3716b2014-02-14 16:05:05 -080072LOCAL_LDLIBS := -lrt
Christopher Tate5a6b8d12014-03-14 14:59:53 -070073endif
Ian Rogers59ec7652014-06-05 14:32:49 -070074LOCAL_MULTILIB := both
Elliott Hughesf82e7412011-07-13 17:37:07 -070075include $(BUILD_HOST_SHARED_LIBRARY)
76
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080077
Jeff Brown29e1e732011-07-11 22:12:32 -070078# Shared and static library for target
79# ========================================================
80include $(CLEAR_VARS)
81LOCAL_MODULE := liblog
Colin Cross11aa6ee2014-01-03 18:58:16 -080082LOCAL_SRC_FILES := $(liblog_target_sources)
Mark Salyzynd45d36e2015-02-12 15:14:26 -080083LOCAL_CFLAGS := -Werror $(liblog_cflags)
Jeff Brown29e1e732011-07-11 22:12:32 -070084include $(BUILD_STATIC_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080085
Jeff Brown29e1e732011-07-11 22:12:32 -070086include $(CLEAR_VARS)
87LOCAL_MODULE := liblog
88LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Mark Salyzynd45d36e2015-02-12 15:14:26 -080089LOCAL_CFLAGS := -Werror $(liblog_cflags)
Jeff Brown29e1e732011-07-11 22:12:32 -070090include $(BUILD_SHARED_LIBRARY)
Mark Salyzyn819c58a2013-11-22 12:39:43 -080091
92include $(call first-makefiles-under,$(LOCAL_PATH))