Jed Estep | f1fc48c | 2015-12-15 16:04:53 -0800 | [diff] [blame] | 1 | # Copyright 2015 The ANdroid Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific languae governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | LOCAL_PATH := $(call my-dir) |
| 16 | |
| 17 | empty := |
| 18 | space := $(empty) $(empty) |
| 19 | comma := , |
| 20 | |
| 21 | ifneq ($(TARGET_INJECT_FAULTS),) |
| 22 | TARGET_INJECT_FAULTS := $(subst $(comma),$(space),$(strip $(TARGET_INJECT_FAULTS))) |
| 23 | endif |
| 24 | |
| 25 | include $(CLEAR_VARS) |
| 26 | |
| 27 | LOCAL_SRC_FILES := ota_io.cpp |
| 28 | LOCAL_MODULE_TAGS := eng |
| 29 | LOCAL_MODULE := libotafault |
| 30 | LOCAL_CLANG := true |
| 31 | |
| 32 | ifneq ($(TARGET_INJECT_FAULTS),) |
| 33 | $(foreach ft,$(TARGET_INJECT_FAULTS),\ |
| 34 | $(eval LOCAL_CFLAGS += -DTARGET_$(ft)_FAULT=$(TARGET_$(ft)_FAULT_FILE))) |
| 35 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 36 | LOCAL_CFLAGS += -DTARGET_INJECT_FAULTS |
| 37 | endif |
| 38 | |
| 39 | LOCAL_STATIC_LIBRARIES := libc |
| 40 | |
| 41 | include $(BUILD_STATIC_LIBRARY) |
| 42 | |
| 43 | include $(CLEAR_VARS) |
| 44 | |
| 45 | LOCAL_SRC_FILES := ota_io.cpp test.cpp |
| 46 | LOCAL_MODULE_TAGS := tests |
| 47 | LOCAL_MODULE := otafault_test |
| 48 | LOCAL_STATIC_LIBRARIES := libc |
| 49 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 50 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-writable-strings |
| 51 | |
| 52 | ifneq ($(TARGET_INJECT_FAULTS),) |
| 53 | $(foreach ft,$(TARGET_INJECT_FAULTS),\ |
| 54 | $(eval LOCAL_CFLAGS += -DTARGET_$(ft)_FAULT=$(TARGET_$(ft)_FAULT_FILE))) |
| 55 | LOCAL_CFLAGS += -DTARGET_INJECT_FAULTS |
| 56 | endif |
| 57 | |
| 58 | include $(BUILD_EXECUTABLE) |