blob: a7eead974b31e6cd5ca684e15b090b6c1ca7bbed [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
25# some files must not be compiled when building against Mingw
26# they correspond to features not used by our host development tools
27# which are also hard or even impossible to port to native Win32
28WITH_MINGW :=
29ifeq ($(HOST_OS),windows)
30 ifeq ($(strip $(USE_CYGWIN)),)
31 WITH_MINGW := true
32 endif
33endif
34# USE_MINGW is defined when we build against Mingw on Linux
35ifneq ($(strip $(USE_MINGW)),)
36 WITH_MINGW := true
37endif
38
39ifndef WITH_MINGW
40 liblog_sources += \
41 logprint.c \
42 event_tag_map.c
Colin Cross9227bd32013-07-23 16:59:20 -070043else
44 liblog_sources += \
45 uio.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080046endif
47
48liblog_host_sources := $(liblog_sources) fake_log_device.c
Mark Salyzync0626fd2014-03-14 12:05:57 -070049liblog_target_sources := $(liblog_sources) log_time.cpp
Mark Salyzyn99ff9462014-03-12 09:29:06 -070050ifneq ($(TARGET_USES_LOGD),false)
Mark Salyzync0626fd2014-03-14 12:05:57 -070051liblog_target_sources += log_read.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080052else
Mark Salyzync0626fd2014-03-14 12:05:57 -070053liblog_target_sources += log_read_kern.c
Mark Salyzyn154f4602014-02-20 14:59:07 -080054endif
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080055
Elliott Hughesf82e7412011-07-13 17:37:07 -070056# Shared and static library for host
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080057# ========================================================
58LOCAL_MODULE := liblog
59LOCAL_SRC_FILES := $(liblog_host_sources)
Mark Salyzyna04464a2014-04-30 08:50:53 -070060LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror
Ian Rogers59ec7652014-06-05 14:32:49 -070061LOCAL_MULTILIB := both
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080062include $(BUILD_HOST_STATIC_LIBRARY)
63
Elliott Hughesf82e7412011-07-13 17:37:07 -070064include $(CLEAR_VARS)
65LOCAL_MODULE := liblog
66LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Christopher Tate5a6b8d12014-03-14 14:59:53 -070067ifeq ($(strip $(HOST_OS)),linux)
Mark Salyzynfa3716b2014-02-14 16:05:05 -080068LOCAL_LDLIBS := -lrt
Christopher Tate5a6b8d12014-03-14 14:59:53 -070069endif
Ian Rogers59ec7652014-06-05 14:32:49 -070070LOCAL_MULTILIB := both
Elliott Hughesf82e7412011-07-13 17:37:07 -070071include $(BUILD_HOST_SHARED_LIBRARY)
72
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080073
74# Static library for host, 64-bit
75# ========================================================
76include $(CLEAR_VARS)
77LOCAL_MODULE := lib64log
78LOCAL_SRC_FILES := $(liblog_host_sources)
Mark Salyzyna04464a2014-04-30 08:50:53 -070079LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -m64 -Werror
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080080include $(BUILD_HOST_STATIC_LIBRARY)
81
Jeff Brown29e1e732011-07-11 22:12:32 -070082# Shared and static library for target
83# ========================================================
84include $(CLEAR_VARS)
85LOCAL_MODULE := liblog
Colin Cross11aa6ee2014-01-03 18:58:16 -080086LOCAL_SRC_FILES := $(liblog_target_sources)
Mark Salyzyna04464a2014-04-30 08:50:53 -070087LOCAL_CFLAGS := -Werror
Jeff Brown29e1e732011-07-11 22:12:32 -070088include $(BUILD_STATIC_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080089
Jeff Brown29e1e732011-07-11 22:12:32 -070090include $(CLEAR_VARS)
91LOCAL_MODULE := liblog
92LOCAL_WHOLE_STATIC_LIBRARIES := liblog
Mark Salyzyna04464a2014-04-30 08:50:53 -070093LOCAL_CFLAGS := -Werror
Jeff Brown29e1e732011-07-11 22:12:32 -070094include $(BUILD_SHARED_LIBRARY)
Mark Salyzyn819c58a2013-11-22 12:39:43 -080095
96include $(call first-makefiles-under,$(LOCAL_PATH))