1 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 LOCAL_PATH := $(call my-dir) 6 7 crazy_linker_sources := \ 8 src/crazy_linker_api.cpp \ 9 src/crazy_linker_ashmem.cpp \ 10 src/crazy_linker_debug.cpp \ 11 src/crazy_linker_elf_loader.cpp \ 12 src/crazy_linker_elf_relocations.cpp \ 13 src/crazy_linker_elf_relro.cpp \ 14 src/crazy_linker_elf_symbols.cpp \ 15 src/crazy_linker_elf_view.cpp \ 16 src/crazy_linker_error.cpp \ 17 src/crazy_linker_globals.cpp \ 18 src/crazy_linker_library_list.cpp \ 19 src/crazy_linker_library_view.cpp \ 20 src/crazy_linker_line_reader.cpp \ 21 src/crazy_linker_proc_maps.cpp \ 22 src/crazy_linker_rdebug.cpp \ 23 src/crazy_linker_search_path_list.cpp \ 24 src/crazy_linker_shared_library.cpp \ 25 src/crazy_linker_thread.cpp \ 26 src/crazy_linker_util.cpp \ 27 src/crazy_linker_wrappers.cpp \ 28 src/crazy_linker_system.cpp \ 29 src/linker_phdr.cpp \ 30 31 # The crazy linker itself. 32 include $(CLEAR_VARS) 33 LOCAL_MODULE := crazy_linker 34 LOCAL_C_INCLUDES = $(LOCAL_PATH)/include $(LOCAL_PATH)/src 35 LOCAL_CFLAGS := -Os -fvisibility=hidden -Wall -Werror 36 LOCAL_SRC_FILES := $(crazy_linker_sources) 37 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 38 LOCAL_EXPORT_LDLIBS := -llog 39 include $(BUILD_STATIC_LIBRARY) 40 41 # The crazy linker unit tests. 42 include $(CLEAR_VARS) 43 44 LOCAL_MODULE := crazylinker_unittest 45 LOCAL_SRC_FILES := \ 46 $(crazy_linker_sources) \ 47 src/crazy_linker_ashmem_unittest.cpp \ 48 src/crazy_linker_error_unittest.cpp \ 49 src/crazy_linker_line_reader_unittest.cpp \ 50 src/crazy_linker_system_mock.cpp \ 51 src/crazy_linker_system_unittest.cpp \ 52 src/crazy_linker_globals_unittest.cpp \ 53 src/crazy_linker_proc_maps_unittest.cpp \ 54 src/crazy_linker_search_path_list_unittest.cpp \ 55 src/crazy_linker_util_unittest.cpp \ 56 src/crazy_linker_thread_unittest.cpp \ 57 minitest/minitest.cc \ 58 59 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/src 60 LOCAL_CFLAGS += -DUNIT_TESTS 61 LOCAL_LDLIBS := -llog 62 63 include $(BUILD_EXECUTABLE) 64 65