blob: 75617a146f09f0a4cc8255ca43c87dbbbddc9fdd [file] [log] [blame]
Jed Estepf1fc48c2015-12-15 16:04:53 -08001# 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
15LOCAL_PATH := $(call my-dir)
16
17empty :=
18space := $(empty) $(empty)
19comma := ,
20
21ifneq ($(TARGET_INJECT_FAULTS),)
22TARGET_INJECT_FAULTS := $(subst $(comma),$(space),$(strip $(TARGET_INJECT_FAULTS)))
23endif
24
25include $(CLEAR_VARS)
26
27LOCAL_SRC_FILES := ota_io.cpp
28LOCAL_MODULE_TAGS := eng
29LOCAL_MODULE := libotafault
30LOCAL_CLANG := true
31
32ifneq ($(TARGET_INJECT_FAULTS),)
33$(foreach ft,$(TARGET_INJECT_FAULTS),\
34 $(eval LOCAL_CFLAGS += -DTARGET_$(ft)_FAULT=$(TARGET_$(ft)_FAULT_FILE)))
35LOCAL_CFLAGS += -Wno-unused-parameter
36LOCAL_CFLAGS += -DTARGET_INJECT_FAULTS
37endif
38
39LOCAL_STATIC_LIBRARIES := libc
40
41include $(BUILD_STATIC_LIBRARY)
42
43include $(CLEAR_VARS)
44
45LOCAL_SRC_FILES := ota_io.cpp test.cpp
46LOCAL_MODULE_TAGS := tests
47LOCAL_MODULE := otafault_test
48LOCAL_STATIC_LIBRARIES := libc
49LOCAL_FORCE_STATIC_EXECUTABLE := true
50LOCAL_CFLAGS += -Wno-unused-parameter -Wno-writable-strings
51
52ifneq ($(TARGET_INJECT_FAULTS),)
53$(foreach ft,$(TARGET_INJECT_FAULTS),\
54 $(eval LOCAL_CFLAGS += -DTARGET_$(ft)_FAULT=$(TARGET_$(ft)_FAULT_FILE)))
55LOCAL_CFLAGS += -DTARGET_INJECT_FAULTS
56endif
57
58include $(BUILD_EXECUTABLE)