1# 2# Copyright (C) 2008-2014 The Android Open Source Project 3# 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 19# 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 26liblog_cflags += -DSNET_EVENT_LOG_TAG=1397638484 27 28liblog_sources := log_event_list.c log_event_write.c logger_write.c 29liblog_sources += config_write.c logger_name.c logger_lock.c 30liblog_host_sources := $(liblog_sources) fake_log_device.c event.logtags 31liblog_host_sources += fake_writer.c 32liblog_target_sources := $(liblog_sources) event_tag_map.c 33liblog_target_sources += config_read.c log_time.cpp log_is_loggable.c logprint.c 34liblog_target_sources += pmsg_reader.c pmsg_writer.c 35liblog_target_sources += logd_reader.c logd_writer.c logger_read.c 36 37# Shared and static library for host 38# ======================================================== 39LOCAL_MODULE := liblog 40LOCAL_SRC_FILES := $(liblog_host_sources) 41# some files must not be compiled when building against Mingw 42# they correspond to features not used by our host development tools 43# which are also hard or even impossible to port to native Win32 44LOCAL_SRC_FILES_darwin := event_tag_map.c 45LOCAL_SRC_FILES_linux := event_tag_map.c 46LOCAL_SRC_FILES_windows := uio.c 47LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror -fvisibility=hidden $(liblog_cflags) 48LOCAL_MULTILIB := both 49LOCAL_MODULE_HOST_OS := darwin linux windows 50include $(BUILD_HOST_STATIC_LIBRARY) 51 52include $(CLEAR_VARS) 53LOCAL_MODULE := liblog 54LOCAL_WHOLE_STATIC_LIBRARIES := liblog 55LOCAL_LDLIBS_linux := -lrt 56LOCAL_MULTILIB := both 57LOCAL_CXX_STL := none 58LOCAL_MODULE_HOST_OS := darwin linux windows 59include $(BUILD_HOST_SHARED_LIBRARY) 60 61 62# Shared and static library for target 63# ======================================================== 64include $(CLEAR_VARS) 65LOCAL_MODULE := liblog 66LOCAL_SRC_FILES := $(liblog_target_sources) 67LOCAL_CFLAGS := -Werror -fvisibility=hidden $(liblog_cflags) 68# AddressSanitizer runtime library depends on liblog. 69LOCAL_SANITIZE := never 70include $(BUILD_STATIC_LIBRARY) 71 72include $(CLEAR_VARS) 73LOCAL_MODULE := liblog 74LOCAL_WHOLE_STATIC_LIBRARIES := liblog 75LOCAL_CFLAGS := -Werror -fvisibility=hidden $(liblog_cflags) 76 77# TODO: This is to work around b/24465209. Remove after root cause is fixed 78LOCAL_LDFLAGS_arm := -Wl,--hash-style=both 79 80LOCAL_SANITIZE := never 81LOCAL_CXX_STL := none 82 83include $(BUILD_SHARED_LIBRARY) 84 85include $(call first-makefiles-under,$(LOCAL_PATH)) 86