blob: d1e94ed3cf16e800a39f638c617f9cc114a64808 [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
Felipe Leme35b8cf12017-02-10 15:47:29 -0800106LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
Felipe Leme4c2d6632016-09-28 14:32:00 -0700107
Felipe Lemebda15a02016-11-16 17:48:25 -0800108LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)
Felipe Leme4c2d6632016-09-28 14:32:00 -0700109
Felipe Leme4c2d6632016-09-28 14:32:00 -0700110LOCAL_CFLAGS += $(COMMON_LOCAL_CFLAGS)
111
Tom Cherry74155992015-08-14 13:01:23 -0700112LOCAL_INIT_RC := dumpstate.rc
Jeff Brownbf7f4922012-06-07 16:40:01 -0700113
Colin Crossf45fa6b2012-03-26 12:38:26 -0700114include $(BUILD_EXECUTABLE)
Felipe Leme4c2d6632016-09-28 14:32:00 -0700115
116# ===============#
117# dumpstate_test #
118# ===============#
119include $(CLEAR_VARS)
120
121LOCAL_MODULE := dumpstate_test
122
123LOCAL_MODULE_TAGS := tests
124
125LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
126
127LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
Felipe Leme75876a22016-10-27 16:31:27 -0700128 DumpstateService.cpp \
Felipe Leme4c2d6632016-09-28 14:32:00 -0700129 tests/dumpstate_test.cpp
130
Felipe Lemebda15a02016-11-16 17:48:25 -0800131LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES) \
Felipe Leme4c2d6632016-09-28 14:32:00 -0700132 libgmock
133
134LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
135
136include $(BUILD_NATIVE_TEST)
137
138# =======================#
139# dumpstate_test_fixture #
140# =======================#
141include $(CLEAR_VARS)
142
143LOCAL_MODULE := dumpstate_test_fixture
144
145LOCAL_MODULE_TAGS := tests
146
147LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
148
Felipe Lemecef02982016-10-03 17:22:22 -0700149LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
150
Felipe Leme4c2d6632016-09-28 14:32:00 -0700151LOCAL_SRC_FILES := \
152 tests/dumpstate_test_fixture.cpp
153
Colin Cross52737922016-12-02 19:27:04 -0800154LOCAL_MODULE_CLASS := NATIVE_TESTS
155
156dumpstate_tests_intermediates := $(local-intermediates-dir)/DATA
Felipe Lemecef02982016-10-03 17:22:22 -0700157dumpstate_tests_subpath_from_data := nativetest/dumpstate_test_fixture
158dumpstate_tests_root_in_device := /data/$(dumpstate_tests_subpath_from_data)
Colin Cross52737922016-12-02 19:27:04 -0800159dumpstate_tests_root_for_test_zip := $(dumpstate_tests_intermediates)/$(dumpstate_tests_subpath_from_data)
Felipe Lemecef02982016-10-03 17:22:22 -0700160testdata_files := $(call find-subdir-files, testdata/*)
161
Colin Cross52737922016-12-02 19:27:04 -0800162# Copy test data files to intermediates/DATA for use with LOCAL_PICKUP_FILES
Felipe Lemecef02982016-10-03 17:22:22 -0700163GEN := $(addprefix $(dumpstate_tests_root_for_test_zip)/, $(testdata_files))
164$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
165$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
166$(GEN): $(dumpstate_tests_root_for_test_zip)/testdata/% : $(LOCAL_PATH)/testdata/%
167 $(transform-generated-source)
168LOCAL_GENERATED_SOURCES += $(GEN)
Colin Cross52737922016-12-02 19:27:04 -0800169
170# Copy test data files again to $OUT/data so the tests can be run with adb sync
171# TODO: the build system should do this automatically
172GEN := $(addprefix $(TARGET_OUT_DATA)/$(dumpstate_tests_subpath_from_data)/, $(testdata_files))
173$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
174$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
175$(GEN): $(TARGET_OUT_DATA)/$(dumpstate_tests_subpath_from_data)/testdata/% : $(LOCAL_PATH)/testdata/%
176 $(transform-generated-source)
177LOCAL_GENERATED_SOURCES += $(GEN)
178
179LOCAL_PICKUP_FILES := $(dumpstate_tests_intermediates)
Felipe Lemecef02982016-10-03 17:22:22 -0700180
Felipe Leme4c2d6632016-09-28 14:32:00 -0700181include $(BUILD_NATIVE_TEST)