Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 1 | # -*- mode: makefile -*- |
| 2 | # Copyright (C) 2013 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | # |
| 17 | # Definitions for building the Conscrypt Java library, native code, |
| 18 | # and associated tests. |
| 19 | # |
| 20 | |
| 21 | # |
| 22 | # Common definitions for host and target. |
| 23 | # |
| 24 | |
| 25 | # Conscrypt is divided into modules. |
| 26 | # |
| 27 | # The structure is: |
| 28 | # |
nmittler | 72ddbd9 | 2016-12-20 08:59:37 -0800 | [diff] [blame] | 29 | # constants/ |
| 30 | # src/gen # Generates NativeConstants.java. |
nmittler | 7782d13 | 2016-11-22 11:34:01 -0800 | [diff] [blame] | 31 | # common/ |
| 32 | # src/main/java # Common Java source for all platforms. |
| 33 | # src/jni/ |
| 34 | # main # Common C++ source for all platforms. |
| 35 | # unbundled # C++ source used for OpenJDK and unbundled Android. |
| 36 | # android/ |
| 37 | # src/main/java # Java source for unbundled Android. |
| 38 | # openjdk/ |
| 39 | # src/main/java # Java source for OpenJDK. |
nmittler | 33a56e7 | 2016-12-16 16:59:48 -0800 | [diff] [blame] | 40 | # src/test |
| 41 | # java/ # Java source for common tests. |
| 42 | # resources/ # Support files for tests |
nmittler | 7782d13 | 2016-11-22 11:34:01 -0800 | [diff] [blame] | 43 | # platform/ |
| 44 | # src/main/java # Java source for bundled Android. |
| 45 | # src/test |
| 46 | # java/ # Java source for bundled tests. |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 47 | # |
| 48 | # All subdirectories are optional (hence the "2> /dev/null"s below). |
| 49 | |
| 50 | LOCAL_PATH := $(call my-dir) |
| 51 | |
Colin Cross | b77aef4 | 2015-03-30 17:23:41 -0700 | [diff] [blame] | 52 | local_javac_flags:=-Xmaxwarns 9999999 |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 53 | #local_javac_flags+=-Xlint:all -Xlint:-serial,-deprecation,-unchecked |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 54 | |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 55 | # |
| 56 | # Build for the target (device). |
| 57 | # |
| 58 | |
Kenny Root | 1cf50c8 | 2017-03-29 10:36:40 -0700 | [diff] [blame] | 59 | bundled_test_java_files := $(call all-java-files-under,platform/src/test/java) |
Adam Vartanian | 488471a | 2018-05-22 16:07:35 +0100 | [diff] [blame] | 60 | bundled_test_java_files += $(filter-out %/ConscryptSuite.java %/ConscryptJava6Suite.java,\ |
Adam Vartanian | 6b42eeb | 2018-01-04 20:07:22 +0000 | [diff] [blame] | 61 | $(call all-java-files-under,openjdk-integ-tests/src/test/java)) |
Kenny Root | 93e9a3c | 2017-03-03 13:35:16 -0800 | [diff] [blame] | 62 | bundled_test_java_files += $(call all-java-files-under,testing/src/main/java) |
| 63 | bundled_test_java_files := $(foreach j,$(bundled_test_java_files),\ |
| 64 | $(if $(findstring testing/src/main/java/libcore/,$(j)),,$(j))) |
nmittler | 33a56e7 | 2016-12-16 16:59:48 -0800 | [diff] [blame] | 65 | |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 66 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 67 | # Make the conscrypt-tests library. |
| 68 | include $(CLEAR_VARS) |
Nathan Mittler | 3f3e55f | 2017-01-10 09:11:14 -0800 | [diff] [blame] | 69 | LOCAL_SRC_FILES := $(bundled_test_java_files) |
Adam Vartanian | 3c9adfd | 2018-02-20 19:24:11 +0000 | [diff] [blame] | 70 | LOCAL_JAVA_RESOURCE_DIRS := openjdk/src/test/resources openjdk-integ-tests/src/test/resources |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 71 | LOCAL_NO_STANDARD_LIBRARIES := true |
Adam Vartanian | 6b42eeb | 2018-01-04 20:07:22 +0000 | [diff] [blame] | 72 | LOCAL_JAVA_LIBRARIES := \ |
| 73 | core-oj \ |
| 74 | core-libart \ |
| 75 | junit \ |
| 76 | mockito-target-minus-junit4 |
| 77 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
| 78 | core-tests-support \ |
| 79 | conscrypt-nojarjar \ |
Narayan Kamath | eaa601a | 2018-02-27 18:27:49 +0000 | [diff] [blame] | 80 | bouncycastle-unbundled \ |
| 81 | bouncycastle-bcpkix-unbundled \ |
| 82 | bouncycastle-ocsp-unbundled |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 83 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 84 | LOCAL_MODULE_TAGS := optional |
Kenny Root | 92b12a8 | 2013-10-02 16:44:41 -0700 | [diff] [blame] | 85 | LOCAL_MODULE := conscrypt-tests |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 86 | LOCAL_REQUIRED_MODULES := libjavacrypto |
| 87 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt |
Neil Fuller | 53d4211 | 2016-02-16 13:19:19 +0000 | [diff] [blame] | 88 | LOCAL_JAVA_LANGUAGE_VERSION := 1.7 |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 89 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Adam Vartanian | e56b72a | 2017-08-07 11:49:48 +0100 | [diff] [blame] | 90 | |
| 91 | bundled_benchmark_java_files := $(call all-java-files-under,testing/src/main/java) |
| 92 | bundled_benchmark_java_files := $(foreach j,$(bundled_benchmark_java_files),\ |
| 93 | $(if $(findstring testing/src/main/java/libcore/,$(j)),,$(j))) |
| 94 | bundled_benchmark_java_files += $(call all-java-files-under,benchmark-base/src/main/java) |
Adam Vartanian | e56b72a | 2017-08-07 11:49:48 +0100 | [diff] [blame] | 95 | bundled_benchmark_java_files += $(call all-java-files-under,benchmark-android/src/main/java) |
| 96 | |
| 97 | # Make the conscrypt-benchmarks library. |
| 98 | include $(CLEAR_VARS) |
| 99 | LOCAL_SRC_FILES := $(bundled_benchmark_java_files) |
| 100 | LOCAL_NO_STANDARD_LIBRARIES := true |
Adam Vartanian | f6dfbd2 | 2018-01-08 12:28:43 +0000 | [diff] [blame] | 101 | LOCAL_JAVA_LIBRARIES := \ |
| 102 | core-oj \ |
| 103 | core-libart \ |
| 104 | junit \ |
Narayan Kamath | eaa601a | 2018-02-27 18:27:49 +0000 | [diff] [blame] | 105 | bouncycastle-unbundled \ |
| 106 | bouncycastle-bcpkix-unbundled \ |
| 107 | bouncycastle-ocsp-unbundled \ |
Adam Vartanian | f6dfbd2 | 2018-01-08 12:28:43 +0000 | [diff] [blame] | 108 | caliper-api-target |
Adam Vartanian | e56b72a | 2017-08-07 11:49:48 +0100 | [diff] [blame] | 109 | LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support conscrypt-nojarjar |
| 110 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 111 | LOCAL_MODULE_TAGS := optional |
| 112 | LOCAL_MODULE := conscrypt-benchmarks |
| 113 | LOCAL_REQUIRED_MODULES := libjavacrypto |
| 114 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt |
| 115 | LOCAL_JAVA_LANGUAGE_VERSION := 1.7 |
| 116 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 117 | endif |
| 118 | |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 119 | # |
| 120 | # Build for the host. |
| 121 | # |
| 122 | |
Elliott Hughes | d9b323c | 2014-12-17 13:29:43 -0800 | [diff] [blame] | 123 | ifeq ($(HOST_OS),linux) |
| 124 | |
Ian Rogers | 3a03c73 | 2014-05-23 11:53:18 -0700 | [diff] [blame] | 125 | # Make the conscrypt-tests library. |
| 126 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 127 | include $(CLEAR_VARS) |
Nathan Mittler | 3f3e55f | 2017-01-10 09:11:14 -0800 | [diff] [blame] | 128 | LOCAL_SRC_FILES := $(bundled_test_java_files) |
Adam Vartanian | 3c9adfd | 2018-02-20 19:24:11 +0000 | [diff] [blame] | 129 | LOCAL_JAVA_RESOURCE_DIRS := openjdk/src/test/resources openjdk-integ-tests/src/test/resources |
Adam Vartanian | f6dfbd2 | 2018-01-08 12:28:43 +0000 | [diff] [blame] | 130 | LOCAL_JAVA_LIBRARIES := \ |
Narayan Kamath | eaa601a | 2018-02-27 18:27:49 +0000 | [diff] [blame] | 131 | bouncycastle-unbundled-hostdex \ |
| 132 | bouncycastle-bcpkix-unbundled-hostdex \ |
| 133 | bouncycastle-ocsp-unbundled-hostdex \ |
Adam Vartanian | f6dfbd2 | 2018-01-08 12:28:43 +0000 | [diff] [blame] | 134 | junit-hostdex \ |
| 135 | core-tests-support-hostdex \ |
| 136 | mockito-api-hostdex |
Adam Vartanian | 5533887 | 2017-10-18 15:26:55 +0100 | [diff] [blame] | 137 | LOCAL_STATIC_JAVA_LIBRARIES := conscrypt-nojarjar-hostdex |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 138 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 139 | LOCAL_MODULE_TAGS := optional |
Kenny Root | 92b12a8 | 2013-10-02 16:44:41 -0700 | [diff] [blame] | 140 | LOCAL_MODULE := conscrypt-tests-hostdex |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 141 | LOCAL_REQUIRED_MODULES := libjavacrypto |
Kenny Root | f8c4be0 | 2016-10-06 09:28:13 -0700 | [diff] [blame] | 142 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt |
Neil Fuller | 53d4211 | 2016-02-16 13:19:19 +0000 | [diff] [blame] | 143 | LOCAL_JAVA_LANGUAGE_VERSION := 1.7 |
Narayan Kamath | b32d679 | 2013-10-28 14:22:43 +0000 | [diff] [blame] | 144 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Ian Rogers | 3a03c73 | 2014-05-23 11:53:18 -0700 | [diff] [blame] | 145 | endif |
Kenny Root | 0e27f2a | 2013-09-16 13:58:19 -0700 | [diff] [blame] | 146 | |
Elliott Hughes | d9b323c | 2014-12-17 13:29:43 -0800 | [diff] [blame] | 147 | endif # HOST_OS == linux |
| 148 | |
Kenny Root | 18ed3be | 2014-11-24 10:57:37 -0800 | [diff] [blame] | 149 | # clear out local variables |
Kenny Root | 18ed3be | 2014-11-24 10:57:37 -0800 | [diff] [blame] | 150 | local_javac_flags := |
Nathan Mittler | 3f3e55f | 2017-01-10 09:11:14 -0800 | [diff] [blame] | 151 | bundled_test_java_files := |