blob: 75617a146f09f0a4cc8255ca43c87dbbbddc9fdd [file] [log] [blame]
Tao Baoce586882016-03-17 22:29:23 +00001# Copyright 2015 The ANdroid Open Source Project
Jed Estepf1fc48c2015-12-15 16:04:53 -08002#
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#
Tao Baoce586882016-03-17 22:29:23 +00007# http://www.apache.org/licenses/LICENSE-2.0
Jed Estepf1fc48c2015-12-15 16:04:53 -08008#
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
Tao Baoce586882016-03-17 22:29:23 +000017empty :=
18space := $(empty) $(empty)
19comma := ,
20
21ifneq ($(TARGET_INJECT_FAULTS),)
22TARGET_INJECT_FAULTS := $(subst $(comma),$(space),$(strip $(TARGET_INJECT_FAULTS)))
23endif
24
Jed Estepf1fc48c2015-12-15 16:04:53 -080025include $(CLEAR_VARS)
26
Tao Baoce586882016-03-17 22:29:23 +000027LOCAL_SRC_FILES := ota_io.cpp
Jed Estepf1fc48c2015-12-15 16:04:53 -080028LOCAL_MODULE_TAGS := eng
29LOCAL_MODULE := libotafault
30LOCAL_CLANG := true
Tao Baoce586882016-03-17 22:29:23 +000031
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
Jed Estepf1fc48c2015-12-15 16:04:53 -080040
41include $(BUILD_STATIC_LIBRARY)
42
43include $(CLEAR_VARS)
44
Tao Baoce586882016-03-17 22:29:23 +000045LOCAL_SRC_FILES := ota_io.cpp test.cpp
Jed Estepf1fc48c2015-12-15 16:04:53 -080046LOCAL_MODULE_TAGS := tests
47LOCAL_MODULE := otafault_test
Tao Baoce586882016-03-17 22:29:23 +000048LOCAL_STATIC_LIBRARIES := libc
Jed Estepf1fc48c2015-12-15 16:04:53 -080049LOCAL_FORCE_STATIC_EXECUTABLE := true
Tao Baoce586882016-03-17 22:29:23 +000050LOCAL_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
Jed Estepf1fc48c2015-12-15 16:04:53 -080057
58include $(BUILD_EXECUTABLE)