blob: 9353546dc11da62d0528ca88ebd4b845b20646c3 [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 += \
43 logprint.c \
44 event_tag_map.c
Colin Cross9227bd32013-07-23 16:59:20 -070045else
46 liblog_sources += \
47 uio.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080048endif
49
Mark Salyzynd45d36e2015-02-12 15:14:26 -080050liblog_host_sources := $(liblog_sources) fake_log_device.c event.logtags
Mark Salyzyn95687052014-10-02 11:12:28 -070051liblog_target_sources := $(liblog_sources) log_time.cpp log_is_loggable.c
Mark Salyzyn99ff9462014-03-12 09:29:06 -070052ifneq ($(TARGET_USES_LOGD),false)
Mark Salyzync0626fd2014-03-14 12:05:57 -070053liblog_target_sources += log_read.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080054else
Mark Salyzync0626fd2014-03-14 12:05:57 -070055liblog_target_sources += log_read_kern.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080056endif
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080057
Elliott Hughesf82e7412011-07-13 17:37:07 -070058# Shared and static library for host
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080059# ========================================================
60LOCAL_MODULE := liblog
61LOCAL_SRC_FILES := $(liblog_host_sources)
Mark Salyzynd45d36e2015-02-12 15:14:26 -080062LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror $(liblog_cflags)
Ian Rogers59ec7652014-06-05 14:32:49 -070063LOCAL_MULTILIB := both
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080064include $(BUILD_HOST_STATIC_LIBRARY)
65
Elliott Hughesf82e7412011-07-13 17:37:07 -070066include $(CLEAR_VARS)
67LOCAL_MODULE := liblog
68LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Christopher Tate5a6b8d12014-03-14 14:59:53 -070069ifeq ($(strip $(HOST_OS)),linux)
Mark Salyzynfa3716b2014-02-14 16:05:05 -080070LOCAL_LDLIBS := -lrt
Christopher Tate5a6b8d12014-03-14 14:59:53 -070071endif
Ian Rogers59ec7652014-06-05 14:32:49 -070072LOCAL_MULTILIB := both
Elliott Hughesf82e7412011-07-13 17:37:07 -070073include $(BUILD_HOST_SHARED_LIBRARY)
74
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080075
Jeff Brown29e1e732011-07-11 22:12:32 -070076# Shared and static library for target
77# ========================================================
78include $(CLEAR_VARS)
79LOCAL_MODULE := liblog
Colin Cross11aa6ee2014-01-03 18:58:16 -080080LOCAL_SRC_FILES := $(liblog_target_sources)
Mark Salyzynd45d36e2015-02-12 15:14:26 -080081LOCAL_CFLAGS := -Werror $(liblog_cflags)
Jeff Brown29e1e732011-07-11 22:12:32 -070082include $(BUILD_STATIC_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080083
Jeff Brown29e1e732011-07-11 22:12:32 -070084include $(CLEAR_VARS)
85LOCAL_MODULE := liblog
86LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Mark Salyzynd45d36e2015-02-12 15:14:26 -080087LOCAL_CFLAGS := -Werror $(liblog_cflags)
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))