The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | # |
Mark Salyzyn | 819c58a | 2013-11-22 12:39:43 -0800 | [diff] [blame] | 2 | # Copyright (C) 2008-2014 The Android Open Source Project |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 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 | # |
| 16 | LOCAL_PATH := $(my-dir) |
| 17 | include $(CLEAR_VARS) |
| 18 | |
Mark Salyzyn | 1b79369 | 2015-03-05 09:56:27 -0800 | [diff] [blame] | 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: |
Mark Salyzyn | 0ee8de3 | 2016-01-06 21:17:43 +0000 | [diff] [blame] | 25 | liblog_cflags := -DLIBLOG_LOG_TAG=1005 |
Mark Salyzyn | f58e58a | 2016-03-25 15:50:46 -0700 | [diff] [blame] | 26 | liblog_cflags += -DSNET_EVENT_LOG_TAG=1397638484 |
Mark Salyzyn | d45d36e | 2015-02-12 15:14:26 -0800 | [diff] [blame] | 27 | |
Mark Salyzyn | facf94c | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 28 | liblog_sources := log_event_list.c log_event_write.c logger_write.c |
| 29 | liblog_sources += config_write.c logger_name.c logger_lock.c |
Mark Salyzyn | a4f2ef1 | 2016-02-25 09:02:09 -0800 | [diff] [blame] | 30 | liblog_host_sources := $(liblog_sources) fake_log_device.c event.logtags |
Mark Salyzyn | facf94c | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 31 | liblog_host_sources += fake_writer.c |
Mark Salyzyn | a4f2ef1 | 2016-02-25 09:02:09 -0800 | [diff] [blame] | 32 | liblog_target_sources := $(liblog_sources) event_tag_map.c |
Mark Salyzyn | facf94c | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 33 | liblog_target_sources += config_read.c log_time.cpp log_is_loggable.c logprint.c |
| 34 | liblog_target_sources += pmsg_reader.c pmsg_writer.c |
| 35 | liblog_target_sources += logd_reader.c logd_writer.c logger_read.c |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 36 | |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 37 | # Shared and static library for host |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 38 | # ======================================================== |
| 39 | LOCAL_MODULE := liblog |
| 40 | LOCAL_SRC_FILES := $(liblog_host_sources) |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 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 |
| 44 | LOCAL_SRC_FILES_darwin := event_tag_map.c |
| 45 | LOCAL_SRC_FILES_linux := event_tag_map.c |
| 46 | LOCAL_SRC_FILES_windows := uio.c |
Mark Salyzyn | 6d753fa | 2016-03-10 08:25:33 -0800 | [diff] [blame] | 47 | LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror -fvisibility=hidden $(liblog_cflags) |
Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 48 | LOCAL_MULTILIB := both |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 49 | LOCAL_MODULE_HOST_OS := darwin linux windows |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 50 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 51 | |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 52 | include $(CLEAR_VARS) |
| 53 | LOCAL_MODULE := liblog |
| 54 | LOCAL_WHOLE_STATIC_LIBRARIES := liblog |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 55 | LOCAL_LDLIBS_linux := -lrt |
Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 56 | LOCAL_MULTILIB := both |
Evgenii Stepanov | c744ef5 | 2015-06-11 14:39:57 -0700 | [diff] [blame] | 57 | LOCAL_CXX_STL := none |
Stephen Hines | b0e4f08 | 2015-09-10 22:47:07 -0700 | [diff] [blame] | 58 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 59 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 60 | |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 61 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 62 | # Shared and static library for target |
| 63 | # ======================================================== |
| 64 | include $(CLEAR_VARS) |
| 65 | LOCAL_MODULE := liblog |
Colin Cross | 11aa6ee | 2014-01-03 18:58:16 -0800 | [diff] [blame] | 66 | LOCAL_SRC_FILES := $(liblog_target_sources) |
Mark Salyzyn | 6d753fa | 2016-03-10 08:25:33 -0800 | [diff] [blame] | 67 | LOCAL_CFLAGS := -Werror -fvisibility=hidden $(liblog_cflags) |
Evgenii Stepanov | c744ef5 | 2015-06-11 14:39:57 -0700 | [diff] [blame] | 68 | # AddressSanitizer runtime library depends on liblog. |
| 69 | LOCAL_SANITIZE := never |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 70 | include $(BUILD_STATIC_LIBRARY) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 71 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 72 | include $(CLEAR_VARS) |
| 73 | LOCAL_MODULE := liblog |
| 74 | LOCAL_WHOLE_STATIC_LIBRARIES := liblog |
Mark Salyzyn | 6d753fa | 2016-03-10 08:25:33 -0800 | [diff] [blame] | 75 | LOCAL_CFLAGS := -Werror -fvisibility=hidden $(liblog_cflags) |
Dmitriy Ivanov | 692c0e4 | 2015-03-09 17:11:17 -0700 | [diff] [blame] | 76 | |
Dmitriy Ivanov | 58558a5 | 2015-09-28 10:40:35 -0700 | [diff] [blame] | 77 | # TODO: This is to work around b/24465209. Remove after root cause is fixed |
Dmitriy Ivanov | fd8afe6 | 2015-05-08 14:09:24 -0700 | [diff] [blame] | 78 | LOCAL_LDFLAGS_arm := -Wl,--hash-style=both |
Dmitriy Ivanov | 692c0e4 | 2015-03-09 17:11:17 -0700 | [diff] [blame] | 79 | |
Evgenii Stepanov | c744ef5 | 2015-06-11 14:39:57 -0700 | [diff] [blame] | 80 | LOCAL_SANITIZE := never |
| 81 | LOCAL_CXX_STL := none |
| 82 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 83 | include $(BUILD_SHARED_LIBRARY) |
Mark Salyzyn | 819c58a | 2013-11-22 12:39:43 -0800 | [diff] [blame] | 84 | |
| 85 | include $(call first-makefiles-under,$(LOCAL_PATH)) |