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 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 24 | |
| 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 |
| 28 | WITH_MINGW := |
| 29 | ifeq ($(HOST_OS),windows) |
| 30 | ifeq ($(strip $(USE_CYGWIN)),) |
| 31 | WITH_MINGW := true |
| 32 | endif |
| 33 | endif |
| 34 | # USE_MINGW is defined when we build against Mingw on Linux |
| 35 | ifneq ($(strip $(USE_MINGW)),) |
| 36 | WITH_MINGW := true |
| 37 | endif |
| 38 | |
| 39 | ifndef WITH_MINGW |
| 40 | liblog_sources += \ |
| 41 | logprint.c \ |
| 42 | event_tag_map.c |
Colin Cross | 9227bd3 | 2013-07-23 16:59:20 -0700 | [diff] [blame] | 43 | else |
| 44 | liblog_sources += \ |
| 45 | uio.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 46 | endif |
| 47 | |
| 48 | liblog_host_sources := $(liblog_sources) fake_log_device.c |
Mark Salyzyn | c0626fd | 2014-03-14 12:05:57 -0700 | [diff] [blame] | 49 | liblog_target_sources := $(liblog_sources) log_time.cpp |
Mark Salyzyn | 99ff946 | 2014-03-12 09:29:06 -0700 | [diff] [blame] | 50 | ifneq ($(TARGET_USES_LOGD),false) |
Mark Salyzyn | c0626fd | 2014-03-14 12:05:57 -0700 | [diff] [blame] | 51 | liblog_target_sources += log_read.c |
Mark Salyzyn | 154f460 | 2014-02-20 14:59:07 -0800 | [diff] [blame] | 52 | else |
Mark Salyzyn | c0626fd | 2014-03-14 12:05:57 -0700 | [diff] [blame] | 53 | liblog_target_sources += log_read_kern.c |
Mark Salyzyn | 154f460 | 2014-02-20 14:59:07 -0800 | [diff] [blame] | 54 | endif |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 55 | |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 56 | # Shared and static library for host |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 57 | # ======================================================== |
| 58 | LOCAL_MODULE := liblog |
| 59 | LOCAL_SRC_FILES := $(liblog_host_sources) |
Mark Salyzyn | a04464a | 2014-04-30 08:50:53 -0700 | [diff] [blame] | 60 | LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror |
Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 61 | LOCAL_MULTILIB := both |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 62 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 63 | |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 64 | include $(CLEAR_VARS) |
| 65 | LOCAL_MODULE := liblog |
| 66 | LOCAL_WHOLE_STATIC_LIBRARIES := liblog |
Christopher Tate | 5a6b8d1 | 2014-03-14 14:59:53 -0700 | [diff] [blame] | 67 | ifeq ($(strip $(HOST_OS)),linux) |
Mark Salyzyn | fa3716b | 2014-02-14 16:05:05 -0800 | [diff] [blame] | 68 | LOCAL_LDLIBS := -lrt |
Christopher Tate | 5a6b8d1 | 2014-03-14 14:59:53 -0700 | [diff] [blame] | 69 | endif |
Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 70 | LOCAL_MULTILIB := both |
Elliott Hughes | f82e741 | 2011-07-13 17:37:07 -0700 | [diff] [blame] | 71 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 72 | |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 73 | |
| 74 | # Static library for host, 64-bit |
| 75 | # ======================================================== |
| 76 | include $(CLEAR_VARS) |
| 77 | LOCAL_MODULE := lib64log |
| 78 | LOCAL_SRC_FILES := $(liblog_host_sources) |
Mark Salyzyn | a04464a | 2014-04-30 08:50:53 -0700 | [diff] [blame] | 79 | LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -m64 -Werror |
Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 80 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 81 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 82 | # Shared and static library for target |
| 83 | # ======================================================== |
| 84 | include $(CLEAR_VARS) |
| 85 | LOCAL_MODULE := liblog |
Colin Cross | 11aa6ee | 2014-01-03 18:58:16 -0800 | [diff] [blame] | 86 | LOCAL_SRC_FILES := $(liblog_target_sources) |
Mark Salyzyn | a04464a | 2014-04-30 08:50:53 -0700 | [diff] [blame] | 87 | LOCAL_CFLAGS := -Werror |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 88 | include $(BUILD_STATIC_LIBRARY) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 89 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 90 | include $(CLEAR_VARS) |
| 91 | LOCAL_MODULE := liblog |
| 92 | LOCAL_WHOLE_STATIC_LIBRARIES := liblog |
Mark Salyzyn | a04464a | 2014-04-30 08:50:53 -0700 | [diff] [blame] | 93 | LOCAL_CFLAGS := -Werror |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 94 | include $(BUILD_SHARED_LIBRARY) |
Mark Salyzyn | 819c58a | 2013-11-22 12:39:43 -0800 | [diff] [blame] | 95 | |
| 96 | include $(call first-makefiles-under,$(LOCAL_PATH)) |