Brett Chabot | bb5918e | 2011-06-17 17:07:12 -0700 | [diff] [blame] | 1 | # Copyright (C) 2011 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 language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # Build the unit tests. |
| 16 | LOCAL_PATH := $(call my-dir) |
| 17 | include $(CLEAR_VARS) |
| 18 | |
Brett Chabot | bb5918e | 2011-06-17 17:07:12 -0700 | [diff] [blame] | 19 | # Build the unit tests. |
| 20 | test_src_files := $(call find-subdir-files, *.cpp) |
| 21 | |
| 22 | shared_libraries := \ |
| 23 | libz \ |
| 24 | liblog \ |
| 25 | libcutils \ |
| 26 | libutils \ |
Brett Chabot | bb5918e | 2011-06-17 17:07:12 -0700 | [diff] [blame] | 27 | |
| 28 | static_libraries := \ |
| 29 | libgtest \ |
| 30 | libgtest_main |
| 31 | |
| 32 | c_includes := \ |
Brett Chabot | bb5918e | 2011-06-17 17:07:12 -0700 | [diff] [blame] | 33 | external/gtest/include \ |
Brett Chabot | bb5918e | 2011-06-17 17:07:12 -0700 | [diff] [blame] | 34 | |
| 35 | module_tags := eng tests |
| 36 | |
| 37 | $(foreach file,$(test_src_files), \ |
| 38 | $(eval include $(CLEAR_VARS)) \ |
| 39 | $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \ |
| 40 | $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \ |
| 41 | $(eval LOCAL_C_INCLUDES := $(c_includes)) \ |
| 42 | $(eval LOCAL_SRC_FILES := $(file)) \ |
| 43 | $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ |
| 44 | $(eval LOCAL_MODULE_TAGS := $(module_tags)) \ |
| 45 | $(eval include $(BUILD_EXECUTABLE)) \ |
| 46 | ) |