blob: efc050b65cf8a7ebd9b6e3358bc5beba0a6ce426 [file] [log] [blame]
Colin Crossf45fa6b2012-03-26 12:38:26 -07001LOCAL_PATH:= $(call my-dir)
Todd Poynor4f5b9a72013-08-13 16:30:01 -07002
Felipe Leme4c2d6632016-09-28 14:32:00 -07003# ================#
4# Common settings #
5# ================#
6# ZipArchive support, the order matters here to get all symbols.
Jaekyun Seokd56dec82016-11-25 16:20:40 +09007COMMON_ZIP_LIBRARIES := libziparchive libz libcrypto
Colin Crossf45fa6b2012-03-26 12:38:26 -07008
Felipe Leme4c2d6632016-09-28 14:32:00 -07009# TODO: ideally the tests should depend on a shared dumpstate library, but currently libdumpstate
10# is used to define the device-specific HAL library. Instead, both dumpstate and dumpstate_test
11# shares a lot of common settings
12COMMON_LOCAL_CFLAGS := \
13 -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter
14COMMON_SRC_FILES := \
Felipe Lemef0292972016-11-22 13:57:05 -080015 DumpstateInternal.cpp \
Felipe Lemee844a9d2016-09-21 15:01:39 -070016 utils.cpp
Felipe Leme4c2d6632016-09-28 14:32:00 -070017COMMON_SHARED_LIBRARIES := \
Felipe Leme6f674ae2016-11-18 17:10:33 -080018 android.hardware.dumpstate@1.0 \
Steven Morelandc655a2a2016-12-13 17:42:19 -080019 libhidlbase \
Felipe Lemee844a9d2016-09-21 15:01:39 -070020 libbase \
Felipe Leme75876a22016-10-27 16:31:27 -070021 libbinder \
Felipe Lemee844a9d2016-09-21 15:01:39 -070022 libcutils \
Josh Gao00ac89e2017-01-18 16:01:25 -080023 libdebuggerd_client \
Felipe Leme75876a22016-10-27 16:31:27 -070024 libdumpstateaidl \
Felipe Leme47e9be22016-12-21 15:37:07 -080025 libdumpstateutil \
Felipe Lemee844a9d2016-09-21 15:01:39 -070026 liblog \
Felipe Leme75876a22016-10-27 16:31:27 -070027 libselinux \
Jaekyun Seokd56dec82016-11-25 16:20:40 +090028 libutils \
Felipe Lemebda15a02016-11-16 17:48:25 -080029 $(COMMON_ZIP_LIBRARIES)
30
31# ====================#
32# libdumpstateutil #
33# ====================#
34include $(CLEAR_VARS)
35
36LOCAL_MODULE := libdumpstateutil
37
38LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
39LOCAL_C_INCLUDES := $(LOCAL_PATH)
40LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
41LOCAL_SRC_FILES := \
Felipe Lemef0292972016-11-22 13:57:05 -080042 DumpstateInternal.cpp \
43 DumpstateUtil.cpp
44LOCAL_SHARED_LIBRARIES := \
Felipe Leme47e9be22016-12-21 15:37:07 -080045 libbase \
46 liblog \
Felipe Lemebda15a02016-11-16 17:48:25 -080047
Felipe Leme47e9be22016-12-21 15:37:07 -080048include $(BUILD_SHARED_LIBRARY)
Felipe Lemee844a9d2016-09-21 15:01:39 -070049
Felipe Lemef6d37e32016-10-27 16:58:06 -070050# ====================#
51# libdumpstateheaders #
52# ====================#
53# TODO: this module is necessary so the device-specific libdumpstate implementations do not
54# need to add any other dependency (like libbase). Should go away once dumpstate HAL changes.
55include $(CLEAR_VARS)
56
57LOCAL_EXPORT_C_INCLUDE_DIRS = $(LOCAL_PATH)
58LOCAL_MODULE := libdumpstateheaders
59LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
60 $(COMMON_SHARED_LIBRARIES)
61LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := \
Felipe Lemebda15a02016-11-16 17:48:25 -080062 $(COMMON_STATIC_LIBRARIES)
Felipe Lemef6d37e32016-10-27 16:58:06 -070063# Soong requires that whats is on LOCAL_EXPORTED_ is also on LOCAL_
64LOCAL_SHARED_LIBRARIES := $(LOCAL_EXPORT_SHARED_LIBRARY_HEADERS)
65LOCAL_STATIC_LIBRARIES := $(LOCAL_EXPORT_STATIC_LIBRARY_HEADERS)
66
67include $(BUILD_STATIC_LIBRARY)
68
Felipe Leme75876a22016-10-27 16:31:27 -070069# ================ #
70# libdumpstateaidl #
71# =================#
72include $(CLEAR_VARS)
73
74LOCAL_MODULE := libdumpstateaidl
75
76LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
77
78LOCAL_SHARED_LIBRARIES := \
79 libbinder \
80 libutils
81LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/binder
82LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
83LOCAL_C_INCLUDES := $(LOCAL_PATH)/binder
84LOCAL_SRC_FILES := \
Felipe Leme009ecbb2016-11-07 10:18:44 -080085 binder/android/os/IDumpstate.aidl \
Felipe Leme75876a22016-10-27 16:31:27 -070086 binder/android/os/IDumpstateListener.aidl \
Felipe Leme009ecbb2016-11-07 10:18:44 -080087 binder/android/os/IDumpstateToken.aidl
Felipe Leme75876a22016-10-27 16:31:27 -070088
89include $(BUILD_SHARED_LIBRARY)
90
Felipe Leme4c2d6632016-09-28 14:32:00 -070091# ==========#
92# dumpstate #
93# ==========#
94include $(CLEAR_VARS)
Felipe Lemee844a9d2016-09-21 15:01:39 -070095
Felipe Leme4c2d6632016-09-28 14:32:00 -070096ifdef BOARD_WLAN_DEVICE
97LOCAL_CFLAGS := -DFWDUMP_$(BOARD_WLAN_DEVICE)
98endif
99
100LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
Felipe Leme75876a22016-10-27 16:31:27 -0700101 DumpstateService.cpp \
Felipe Leme4c2d6632016-09-28 14:32:00 -0700102 dumpstate.cpp
103
104LOCAL_MODULE := dumpstate
105
Steven Morelandcb7ef822016-11-29 13:20:37 -0800106LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES) \
107 android.hardware.vibrator@1.0
Felipe Leme4c2d6632016-09-28 14:32:00 -0700108
Felipe Lemebda15a02016-11-16 17:48:25 -0800109LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)
Felipe Leme4c2d6632016-09-28 14:32:00 -0700110
Felipe Leme4c2d6632016-09-28 14:32:00 -0700111LOCAL_CFLAGS += $(COMMON_LOCAL_CFLAGS)
112
Tom Cherry74155992015-08-14 13:01:23 -0700113LOCAL_INIT_RC := dumpstate.rc
Jeff Brownbf7f4922012-06-07 16:40:01 -0700114
Colin Crossf45fa6b2012-03-26 12:38:26 -0700115include $(BUILD_EXECUTABLE)
Felipe Leme4c2d6632016-09-28 14:32:00 -0700116
117# ===============#
118# dumpstate_test #
119# ===============#
120include $(CLEAR_VARS)
121
122LOCAL_MODULE := dumpstate_test
123
124LOCAL_MODULE_TAGS := tests
125
126LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
127
128LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
Felipe Leme75876a22016-10-27 16:31:27 -0700129 DumpstateService.cpp \
Felipe Leme4c2d6632016-09-28 14:32:00 -0700130 tests/dumpstate_test.cpp
131
Felipe Lemebda15a02016-11-16 17:48:25 -0800132LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES) \
Felipe Leme4c2d6632016-09-28 14:32:00 -0700133 libgmock
134
135LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
136
137include $(BUILD_NATIVE_TEST)
138
139# =======================#
140# dumpstate_test_fixture #
141# =======================#
142include $(CLEAR_VARS)
143
144LOCAL_MODULE := dumpstate_test_fixture
145
146LOCAL_MODULE_TAGS := tests
147
148LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
149
Felipe Lemecef02982016-10-03 17:22:22 -0700150LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
151
Felipe Leme4c2d6632016-09-28 14:32:00 -0700152LOCAL_SRC_FILES := \
153 tests/dumpstate_test_fixture.cpp
154
Colin Cross52737922016-12-02 19:27:04 -0800155LOCAL_MODULE_CLASS := NATIVE_TESTS
156
157dumpstate_tests_intermediates := $(local-intermediates-dir)/DATA
Felipe Lemecef02982016-10-03 17:22:22 -0700158dumpstate_tests_subpath_from_data := nativetest/dumpstate_test_fixture
159dumpstate_tests_root_in_device := /data/$(dumpstate_tests_subpath_from_data)
Colin Cross52737922016-12-02 19:27:04 -0800160dumpstate_tests_root_for_test_zip := $(dumpstate_tests_intermediates)/$(dumpstate_tests_subpath_from_data)
Felipe Lemecef02982016-10-03 17:22:22 -0700161testdata_files := $(call find-subdir-files, testdata/*)
162
Colin Cross52737922016-12-02 19:27:04 -0800163# Copy test data files to intermediates/DATA for use with LOCAL_PICKUP_FILES
Felipe Lemecef02982016-10-03 17:22:22 -0700164GEN := $(addprefix $(dumpstate_tests_root_for_test_zip)/, $(testdata_files))
165$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
166$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
167$(GEN): $(dumpstate_tests_root_for_test_zip)/testdata/% : $(LOCAL_PATH)/testdata/%
168 $(transform-generated-source)
169LOCAL_GENERATED_SOURCES += $(GEN)
Colin Cross52737922016-12-02 19:27:04 -0800170
171# Copy test data files again to $OUT/data so the tests can be run with adb sync
172# TODO: the build system should do this automatically
173GEN := $(addprefix $(TARGET_OUT_DATA)/$(dumpstate_tests_subpath_from_data)/, $(testdata_files))
174$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
175$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
176$(GEN): $(TARGET_OUT_DATA)/$(dumpstate_tests_subpath_from_data)/testdata/% : $(LOCAL_PATH)/testdata/%
177 $(transform-generated-source)
178LOCAL_GENERATED_SOURCES += $(GEN)
179
180LOCAL_PICKUP_FILES := $(dumpstate_tests_intermediates)
Felipe Lemecef02982016-10-03 17:22:22 -0700181
Felipe Leme4c2d6632016-09-28 14:32:00 -0700182include $(BUILD_NATIVE_TEST)