1# 2# Copyright (C) 2011 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# 16 17LOCAL_PATH := $(call my-dir) 18 19LLVM_ROOT_PATH := external/llvm 20 21#============================================================================= 22# android librsloader for libbcc (Device) 23#----------------------------------------------------------------------------- 24 25include $(CLEAR_VARS) 26 27LOCAL_MODULE := librsloader 28 29LOCAL_MODULE_TAGS := optional 30 31LOCAL_SRC_FILES := \ 32 lib/ELFHeader.cpp \ 33 lib/ELFSymbol.cpp \ 34 lib/ELFSectionHeader.cpp \ 35 lib/ELFTypes.cpp \ 36 lib/MemChunk.cpp \ 37 lib/StubLayout.cpp \ 38 utils/raw_ostream.cpp \ 39 utils/rsl_assert.cpp \ 40 utils/helper.cpp \ 41 android/librsloader.cpp 42 43LOCAL_C_INCLUDES := \ 44 $(LOCAL_PATH)/ \ 45 $(LOCAL_PATH)/include \ 46 bionic \ 47 external/elfutils/libelf \ 48 external/stlport/stlport \ 49 $(LOCAL_C_INCLUDES) 50 51include $(LLVM_ROOT_PATH)/llvm-device-build.mk 52include $(BUILD_STATIC_LIBRARY) 53 54 55#============================================================================= 56# android librsloader for libbcc (Host) 57#----------------------------------------------------------------------------- 58 59include $(CLEAR_VARS) 60 61LOCAL_MODULE := librsloader 62 63LOCAL_MODULE_TAGS := optional 64 65LOCAL_SRC_FILES := \ 66 lib/ELFHeader.cpp \ 67 lib/ELFSymbol.cpp \ 68 lib/ELFSectionHeader.cpp \ 69 lib/ELFTypes.cpp \ 70 lib/MemChunk.cpp \ 71 lib/StubLayout.cpp \ 72 utils/raw_ostream.cpp \ 73 utils/rsl_assert.cpp \ 74 utils/helper.cpp \ 75 android/librsloader.cpp 76 77LOCAL_C_INCLUDES := \ 78 $(LOCAL_PATH)/ \ 79 $(LOCAL_PATH)/include \ 80 $(LOCAL_C_INCLUDES) 81 82ifeq (darwin,$(BUILD_OS)) 83LOCAL_CFLAGS += -DMACOSX 84endif 85 86include $(LLVM_ROOT_PATH)/llvm-host-build.mk 87include $(BUILD_HOST_STATIC_LIBRARY) 88 89 90#============================================================================= 91# librsloader-test (Device) 92#----------------------------------------------------------------------------- 93 94include $(CLEAR_VARS) 95 96LOCAL_MODULE := test-librsloader 97 98LOCAL_MODULE_TAGS := tests 99 100LOCAL_SHARED_LIBRARIES := \ 101 libstlport 102 103LOCAL_STATIC_LIBRARIES := \ 104 librsloader \ 105 libcutils \ 106 libLLVMSupport 107 108LOCAL_SRC_FILES := \ 109 android/test-librsloader.c 110 111include $(LLVM_ROOT_PATH)/llvm-device-build.mk 112include $(BUILD_EXECUTABLE) 113 114 115#============================================================================= 116# librsloader-test (Host) 117#----------------------------------------------------------------------------- 118 119include $(CLEAR_VARS) 120 121LOCAL_MODULE := test-librsloader 122 123LOCAL_MODULE_TAGS := tests 124 125LOCAL_LDFLAGS := \ 126 -lpthread \ 127 -ldl 128 129LOCAL_STATIC_LIBRARIES := \ 130 librsloader \ 131 libcutils \ 132 libLLVMSupport 133 134LOCAL_SRC_FILES := \ 135 android/test-librsloader.c 136 137include $(LLVM_ROOT_PATH)/llvm-host-build.mk 138include $(BUILD_HOST_EXECUTABLE) 139 140 141#============================================================================= 142# rsloader 143#----------------------------------------------------------------------------- 144 145ifdef BUILD_RSLOADER_TOOL 146include $(CLEAR_VARS) 147 148LOCAL_MODULE := rsloader 149 150LOCAL_MODULE_TAGS := tests 151 152LOCAL_SHARED_LIBRARIES := \ 153 libstlport 154 155LOCAL_STATIC_LIBRARIES := \ 156 libLLVMSupport 157 158LOCAL_SRC_FILES := \ 159 lib/ELFHeader.cpp \ 160 lib/ELFSymbol.cpp \ 161 lib/ELFSectionHeader.cpp \ 162 lib/ELFTypes.cpp \ 163 lib/StubLayout.cpp \ 164 utils/raw_ostream.cpp \ 165 utils/rsl_assert.cpp \ 166 utils/helper.cpp \ 167 main.cpp 168 169LOCAL_C_INCLUDES := \ 170 $(LOCAL_PATH) \ 171 $(LOCAL_PATH)/include \ 172 bionic \ 173 external/elfutils/libelf \ 174 external/stlport/stlport \ 175 $(LOCAL_C_INCLUDES) 176 177include $(LLVM_ROOT_PATH)/llvm-device-build.mk 178include $(BUILD_EXECUTABLE) 179endif 180 181 182#============================================================================= 183# stub-layout-unit-test 184#----------------------------------------------------------------------------- 185 186ifdef BUILD_STUB_LAYOUT_TEST 187include $(CLEAR_VARS) 188 189LOCAL_MODULE := stub-layout-unit-test 190 191LOCAL_MODULE_TAGS := tests 192 193LOCAL_SHARED_LIBRARIES := \ 194 libstlport 195 196LOCAL_SRC_FILES := \ 197 lib/StubLayout.cpp \ 198 utils/raw_ostream.cpp \ 199 utils/helper.cpp \ 200 tests/stub-test.cpp 201 202LOCAL_C_INCLUDES := \ 203 $(LOCAL_PATH) \ 204 $(LOCAL_PATH)/include \ 205 bionic \ 206 external/elfutils/libelf \ 207 external/stlport/stlport \ 208 $(LOCAL_C_INCLUDES) 209 210include $(LLVM_ROOT_PATH)/llvm-device-build.mk 211include $(BUILD_EXECUTABLE) 212endif 213