blob: af87ffacc67bed0109d5651bb2a441b898257991 [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 \
Felipe Leme75876a22016-10-27 16:31:27 -070023 libdumpstateaidl \
Felipe Lemee844a9d2016-09-21 15:01:39 -070024 libhardware_legacy \
25 liblog \
Felipe Leme75876a22016-10-27 16:31:27 -070026 libselinux \
Jaekyun Seokd56dec82016-11-25 16:20:40 +090027 libutils \
Felipe Lemebda15a02016-11-16 17:48:25 -080028 $(COMMON_ZIP_LIBRARIES)
Jaekyun Seokd56dec82016-11-25 16:20:40 +090029COMMON_STATIC_LIBRARIES := \
30 libdumpstateutil
Felipe Lemebda15a02016-11-16 17:48:25 -080031
32# ====================#
33# libdumpstateutil #
34# ====================#
35include $(CLEAR_VARS)
36
37LOCAL_MODULE := libdumpstateutil
38
39LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
40LOCAL_C_INCLUDES := $(LOCAL_PATH)
41LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
42LOCAL_SRC_FILES := \
Felipe Lemef0292972016-11-22 13:57:05 -080043 DumpstateInternal.cpp \
44 DumpstateUtil.cpp
45LOCAL_SHARED_LIBRARIES := \
46 libbase
Felipe Lemebda15a02016-11-16 17:48:25 -080047
48include $(BUILD_STATIC_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
Todd Poynor4f5b9a72013-08-13 16:30:01 -0700111LOCAL_HAL_STATIC_LIBRARIES := libdumpstate
Felipe Leme4c2d6632016-09-28 14:32:00 -0700112
113LOCAL_CFLAGS += $(COMMON_LOCAL_CFLAGS)
114
Tom Cherry74155992015-08-14 13:01:23 -0700115LOCAL_INIT_RC := dumpstate.rc
Jeff Brownbf7f4922012-06-07 16:40:01 -0700116
Colin Crossf45fa6b2012-03-26 12:38:26 -0700117include $(BUILD_EXECUTABLE)
Felipe Leme4c2d6632016-09-28 14:32:00 -0700118
119# ===============#
120# dumpstate_test #
121# ===============#
122include $(CLEAR_VARS)
123
124LOCAL_MODULE := dumpstate_test
125
126LOCAL_MODULE_TAGS := tests
127
128LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
129
130LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
Felipe Leme75876a22016-10-27 16:31:27 -0700131 DumpstateService.cpp \
Felipe Leme4c2d6632016-09-28 14:32:00 -0700132 tests/dumpstate_test.cpp
133
Felipe Lemebda15a02016-11-16 17:48:25 -0800134LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES) \
Felipe Leme4c2d6632016-09-28 14:32:00 -0700135 libgmock
136
137LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
138
139include $(BUILD_NATIVE_TEST)
140
141# =======================#
142# dumpstate_test_fixture #
143# =======================#
144include $(CLEAR_VARS)
145
146LOCAL_MODULE := dumpstate_test_fixture
147
148LOCAL_MODULE_TAGS := tests
149
150LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
151
Felipe Lemecef02982016-10-03 17:22:22 -0700152LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
153
Felipe Leme4c2d6632016-09-28 14:32:00 -0700154LOCAL_SRC_FILES := \
155 tests/dumpstate_test_fixture.cpp
156
Colin Cross52737922016-12-02 19:27:04 -0800157LOCAL_MODULE_CLASS := NATIVE_TESTS
158
159dumpstate_tests_intermediates := $(local-intermediates-dir)/DATA
Felipe Lemecef02982016-10-03 17:22:22 -0700160dumpstate_tests_subpath_from_data := nativetest/dumpstate_test_fixture
161dumpstate_tests_root_in_device := /data/$(dumpstate_tests_subpath_from_data)
Colin Cross52737922016-12-02 19:27:04 -0800162dumpstate_tests_root_for_test_zip := $(dumpstate_tests_intermediates)/$(dumpstate_tests_subpath_from_data)
Felipe Lemecef02982016-10-03 17:22:22 -0700163testdata_files := $(call find-subdir-files, testdata/*)
164
Colin Cross52737922016-12-02 19:27:04 -0800165# Copy test data files to intermediates/DATA for use with LOCAL_PICKUP_FILES
Felipe Lemecef02982016-10-03 17:22:22 -0700166GEN := $(addprefix $(dumpstate_tests_root_for_test_zip)/, $(testdata_files))
167$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
168$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
169$(GEN): $(dumpstate_tests_root_for_test_zip)/testdata/% : $(LOCAL_PATH)/testdata/%
170 $(transform-generated-source)
171LOCAL_GENERATED_SOURCES += $(GEN)
Colin Cross52737922016-12-02 19:27:04 -0800172
173# Copy test data files again to $OUT/data so the tests can be run with adb sync
174# TODO: the build system should do this automatically
175GEN := $(addprefix $(TARGET_OUT_DATA)/$(dumpstate_tests_subpath_from_data)/, $(testdata_files))
176$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
177$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
178$(GEN): $(TARGET_OUT_DATA)/$(dumpstate_tests_subpath_from_data)/testdata/% : $(LOCAL_PATH)/testdata/%
179 $(transform-generated-source)
180LOCAL_GENERATED_SOURCES += $(GEN)
181
182LOCAL_PICKUP_FILES := $(dumpstate_tests_intermediates)
Felipe Lemecef02982016-10-03 17:22:22 -0700183
Felipe Leme4c2d6632016-09-28 14:32:00 -0700184include $(BUILD_NATIVE_TEST)
Felipe Leme06c082b2016-10-31 11:41:05 -0700185
186# =======================#
187# libdumpstate.default #
188# =======================#
189include $(CLEAR_VARS)
190
191LOCAL_SRC_FILES := libdumpstate_default.cpp
192LOCAL_MODULE := libdumpstate.default
193
194LOCAL_STATIC_LIBRARIES := libdumpstateheaders
195include $(BUILD_STATIC_LIBRARY)