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 | 99ff946 | 2014-03-12 09:29:06 -0700 | [diff] [blame] | 19 | ifneq ($(TARGET_USES_LOGD),false) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 20 | liblog_sources := logd_write.c |
Mark Salyzyn | 154f460 | 2014-02-20 14:59:07 -0800 | [diff] [blame] | 21 | else |
| 22 | liblog_sources := logd_write_kern.c |
| 23 | endif |
Mark Salyzyn | fa3716b | 2014-02-14 16:05:05 -0800 | [diff] [blame^] | 24 | liblog_sources += log_time.cpp |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 25 | |
Mark Salyzyn | dfa7a07 | 2014-02-11 12:29:31 -0800 | [diff] [blame] | 26 | ifneq ($(filter userdebug eng,$(TARGET_BUILD_VARIANT)),) |
| 27 | liblog_cflags := -DUSERDEBUG_BUILD=1 |
| 28 | endif |
| 29 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 30 | # some files must not be compiled when building against Mingw |
| 31 | # they correspond to features not used by our host development tools |
| 32 | # which are also hard or even impossible to port to native Win32 |
| 33 | WITH_MINGW := |
| 34 | ifeq ($(HOST_OS),windows) |
| 35 | ifeq ($(strip $(USE_CYGWIN)),) |
| 36 | WITH_MINGW := true |
| 37 | endif |
| 38 | endif |
| 39 | # USE_MINGW is defined when we build against Mingw on Linux |
| 40 | ifneq ($(strip $(USE_MINGW)),) |
| 41 | WITH_MINGW := true |
| 42 | endif |
| 43 | |
| 44 | ifndef WITH_MINGW |
| 45 | liblog_sources += \ |
| 46 | logprint.c \ |
| 47 | event_tag_map.c |
Colin Cross | 9227bd3 | 2013-07-23 16:59:20 -0700 | [diff] [blame] | 48 | else |
| 49 | liblog_sources += \ |
| 50 | uio.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 51 | endif |
| 52 | |
| 53 | liblog_host_sources := $(liblog_sources) fake_log_device.c |
Mark Salyzyn | 99ff946 | 2014-03-12 09:29:06 -0700 | [diff] [blame] | 54 | ifneq ($(TARGET_USES_LOGD),false) |
Colin Cross | 11aa6ee | 2014-01-03 18:58:16 -0800 | [diff] [blame] | 55 | liblog_target_sources = $(liblog_sources) log_read.c |
Mark Salyzyn | 154f460 | 2014-02-20 14:59:07 -0800 | [diff] [blame] | 56 | else |
| 57 | liblog_target_sources = $(liblog_sources) log_read_kern.c |
| 58 | endif |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 59 | |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 60 | # Shared and static library for host |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 61 | # ======================================================== |
| 62 | LOCAL_MODULE := liblog |
| 63 | LOCAL_SRC_FILES := $(liblog_host_sources) |
Mark Salyzyn | fa3716b | 2014-02-14 16:05:05 -0800 | [diff] [blame^] | 64 | LOCAL_LDLIBS := -lpthread -lrt |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 65 | LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 |
| 66 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 67 | |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 68 | include $(CLEAR_VARS) |
| 69 | LOCAL_MODULE := liblog |
| 70 | LOCAL_WHOLE_STATIC_LIBRARIES := liblog |
Mark Salyzyn | fa3716b | 2014-02-14 16:05:05 -0800 | [diff] [blame^] | 71 | LOCAL_LDLIBS := -lrt |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 72 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 73 | |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 74 | |
| 75 | # Static library for host, 64-bit |
| 76 | # ======================================================== |
| 77 | include $(CLEAR_VARS) |
| 78 | LOCAL_MODULE := lib64log |
| 79 | LOCAL_SRC_FILES := $(liblog_host_sources) |
Mark Salyzyn | fa3716b | 2014-02-14 16:05:05 -0800 | [diff] [blame^] | 80 | LOCAL_LDLIBS := -lpthread -lrt |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 81 | LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -m64 |
| 82 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 83 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 84 | # Shared and static library for target |
| 85 | # ======================================================== |
| 86 | include $(CLEAR_VARS) |
| 87 | LOCAL_MODULE := liblog |
Colin Cross | 11aa6ee | 2014-01-03 18:58:16 -0800 | [diff] [blame] | 88 | LOCAL_SRC_FILES := $(liblog_target_sources) |
Mark Salyzyn | dfa7a07 | 2014-02-11 12:29:31 -0800 | [diff] [blame] | 89 | LOCAL_CFLAGS := $(liblog_cflags) |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 90 | include $(BUILD_STATIC_LIBRARY) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 91 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 92 | include $(CLEAR_VARS) |
| 93 | LOCAL_MODULE := liblog |
| 94 | LOCAL_WHOLE_STATIC_LIBRARIES := liblog |
Mark Salyzyn | dfa7a07 | 2014-02-11 12:29:31 -0800 | [diff] [blame] | 95 | LOCAL_CFLAGS := $(liblog_cflags) |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 96 | include $(BUILD_SHARED_LIBRARY) |
Mark Salyzyn | 819c58a | 2013-11-22 12:39:43 -0800 | [diff] [blame] | 97 | |
| 98 | include $(call first-makefiles-under,$(LOCAL_PATH)) |