Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 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 | LOCAL_PATH := $(call my-dir) |
Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 18 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 19 | # These can be overridden via the environment or by editing to |
| 20 | # enable/disable certain build configuration. |
| 21 | ART_BUILD_TARGET_NDEBUG ?= true |
| 22 | ART_BUILD_TARGET_DEBUG ?= true |
Brian Carlstrom | 56778d8 | 2011-09-11 14:08:17 -0700 | [diff] [blame] | 23 | ifeq ($(HOST_OS),linux) |
| 24 | ART_BUILD_HOST_NDEBUG ?= true |
| 25 | ART_BUILD_HOST_DEBUG ?= true |
| 26 | else |
| 27 | ART_BUILD_HOST_NDEBUG ?= false |
| 28 | ART_BUILD_HOST_DEBUG ?= false |
| 29 | endif |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 30 | |
Carl Shapiro | 0e6d197 | 2011-07-06 19:17:39 -0700 | [diff] [blame] | 31 | build_path := $(LOCAL_PATH)/build |
Brian Carlstrom | cdc8de4 | 2011-07-19 14:23:17 -0700 | [diff] [blame] | 32 | include $(build_path)/Android.common.mk |
| 33 | |
Carl Shapiro | 0e6d197 | 2011-07-06 19:17:39 -0700 | [diff] [blame] | 34 | include $(build_path)/Android.libart.mk |
Brian Carlstrom | 69b15fb | 2011-09-03 12:25:21 -0700 | [diff] [blame] | 35 | include $(build_path)/Android.executable.mk |
Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 36 | |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 37 | include $(build_path)/Android.oat.mk |
| 38 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 39 | include $(build_path)/Android.libarttest.mk |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 40 | include $(build_path)/Android.gtest.mk |
| 41 | include $(build_path)/Android.oattest.mk |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 42 | |
| 43 | # "m build-art" for quick minimal build |
| 44 | .PHONY: build-art |
| 45 | build-art: \ |
Brian Carlstrom | 69b15fb | 2011-09-03 12:25:21 -0700 | [diff] [blame] | 46 | $(ART_TARGET_EXECUTABLES) \ |
Brian Carlstrom | 8ecd08c | 2011-07-27 17:50:51 -0700 | [diff] [blame] | 47 | $(ART_TARGET_TEST_EXECUTABLES) \ |
Brian Carlstrom | 69b15fb | 2011-09-03 12:25:21 -0700 | [diff] [blame] | 48 | $(ART_HOST_EXECUTABLES) \ |
Carl Shapiro | 47940d6 | 2011-08-13 22:21:30 -0700 | [diff] [blame] | 49 | $(ART_HOST_TEST_EXECUTABLES) |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 50 | |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 51 | # "mm test-art" to build and run all tests on host and device |
| 52 | .PHONY: test-art |
| 53 | test-art: test-art-host test-art-target |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 54 | @echo test-art PASSED |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 55 | |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 56 | .PHONY: test-art-gtest |
| 57 | test-art-gtest: test-art-host test-art-target-gtest |
| 58 | @echo test-art-gtest PASSED |
| 59 | |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 60 | define run-host-tests-with |
Elliott Hughes | b465ab0 | 2011-08-24 11:21:21 -0700 | [diff] [blame] | 61 | $(foreach file,$(sort $(ART_HOST_TEST_EXECUTABLES)),$(1) $(file) &&) true |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 62 | endef |
| 63 | |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 64 | ART_HOST_DEPENDENCIES := $(ART_HOST_EXECUTABLES) $(HOST_OUT_JAVA_LIBRARIES)/core-hostdex.jar |
| 65 | ART_TARGET_DEPENDENCIES := $(ART_TARGET_EXECUTABLES) $(TARGET_OUT_JAVA_LIBRARIES)/core.jar |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 66 | |
| 67 | ART_HOST_TEST_DEPENDENCIES := $(ART_HOST_DEPENDENCIES) $(ART_TEST_OAT_FILES) |
| 68 | ART_TARGET_TEST_DEPENDENCIES := $(ART_TARGET_DEPENDENCIES) $(ART_TEST_OAT_FILES) |
Brian Carlstrom | 9f30b38 | 2011-08-28 22:41:38 -0700 | [diff] [blame] | 69 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 70 | ART_TARGET_TEST_DEPENDENCIES += $(TARGET_OUT_EXECUTABLES)/oat_process $(TARGET_OUT_EXECUTABLES)/oat_processd |
| 71 | |
Elliott Hughes | 352a424 | 2011-10-31 15:15:21 -0700 | [diff] [blame] | 72 | # Switch this to "oat_process" to run an optimized build. |
| 73 | OAT_PROCESS=oat_processd |
| 74 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 75 | ######################################################################## |
| 76 | # host test targets |
| 77 | |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 78 | # "mm test-art-host" to build and run all host tests |
| 79 | .PHONY: test-art-host |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 80 | test-art-host: $(ART_HOST_TEST_DEPENDENCIES) $(ART_HOST_TEST_TARGETS) |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 81 | @echo test-art-host PASSED |
Brian Carlstrom | 59848da | 2011-07-23 20:35:19 -0700 | [diff] [blame] | 82 | |
Elliott Hughes | 5511f21 | 2011-08-12 18:07:45 -0700 | [diff] [blame] | 83 | # "mm valgrind-art-host" to build and run all host tests under valgrind. |
| 84 | .PHONY: valgrind-art-host |
Brian Carlstrom | 9f30b38 | 2011-08-28 22:41:38 -0700 | [diff] [blame] | 85 | valgrind-art-host: $(ART_HOST_TEST_DEPENDENCIES) |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 86 | $(call run-host-tests-with,"valgrind") |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 87 | @echo valgrind-art-host PASSED |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 88 | |
| 89 | # "mm tsan-art-host" to build and run all host tests under tsan. |
| 90 | .PHONY: tsan-art-host |
Brian Carlstrom | 9f30b38 | 2011-08-28 22:41:38 -0700 | [diff] [blame] | 91 | tsan-art-host: $(ART_HOST_TEST_DEPENDENCIES) |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 92 | $(call run-host-tests-with,"tsan") |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 93 | @echo tsan-art-host PASSED |
Elliott Hughes | 5511f21 | 2011-08-12 18:07:45 -0700 | [diff] [blame] | 94 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 95 | ######################################################################## |
| 96 | # target test targets |
| 97 | |
| 98 | # "mm test-art-target" to build and run all target tests |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 99 | .PHONY: test-art-target |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 100 | test-art-target: test-art-target-gtest test-art-target-oat test-art-target-run-test |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 101 | @echo test-art-target PASSED |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 102 | |
| 103 | .PHONY: test-art-target-sync |
| 104 | test-art-target-sync: $(ART_TARGET_TEST_DEPENDENCIES) |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 105 | adb remount |
| 106 | adb sync |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 107 | adb shell mkdir -p $(ART_TEST_DIR) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 108 | |
| 109 | .PHONY: test-art-target-gtest |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 110 | test-art-target-gtest: $(ART_TARGET_TEST_TARGETS) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 111 | |
| 112 | .PHONY: test-art-target-oat |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 113 | test-art-target-oat: $(ART_TEST_OAT_TARGETS) |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 114 | @echo test-art-target-oat PASSED |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 115 | |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 116 | .PHONY: test-art-target-run-test |
| 117 | test-art-target-run-test: test-art-target-run-test-002 |
| 118 | @echo test-art-target-run-test PASSED |
| 119 | |
| 120 | .PHONY: test-art-target-run-test-002 |
Brian Carlstrom | 58ae941 | 2011-10-04 00:56:06 -0700 | [diff] [blame] | 121 | test-art-target-run-test-002: test-art-target-sync |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 122 | art/test/run-test 002 |
| 123 | @echo test-art-target-run-test-002 PASSED |
| 124 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 125 | ######################################################################## |
| 126 | # oat_process test targets |
| 127 | |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 128 | # $(1): jar or apk name |
| 129 | define art-cache-oat |
| 130 | $(ART_CACHE_OUT)/$(subst /,@,$(patsubst %.apk,%.oat,$(patsubst %.jar,%.oat,$(1)))) |
| 131 | endef |
| 132 | |
| 133 | ART_CACHE_OATS := |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 134 | # $(1): name |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 135 | define build-art-cache-oat |
| 136 | $(call build-art-oat,$(PRODUCT_OUT)/$(1),$(call art-cache-oat,$(1)),$(TARGET_BOOT_IMG)) |
| 137 | ART_CACHE_OATS += $(call art-cache-oat,$(1)) |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 138 | endef |
| 139 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 140 | .PHONY: test-art-target-oat-process |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 141 | test-art-target-oat-process: test-art-target-oat-process-am # test-art-target-oat-process-Calculator |
| 142 | |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 143 | $(eval $(call build-art-cache-oat,system/framework/am.jar)) |
| 144 | $(eval $(call build-art-cache-oat,system/app/Calculator.apk)) |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 145 | |
Ian Rogers | f8a199c | 2011-11-03 17:16:02 -0700 | [diff] [blame^] | 146 | |
| 147 | # WORKING for zygote-art |
| 148 | ifeq (1,1) |
| 149 | $(eval $(call build-art-cache-oat,system/app/ApplicationsProvider.apk)) |
| 150 | $(eval $(call build-art-cache-oat,system/app/BackupRestoreConfirmation.apk)) |
| 151 | $(eval $(call build-art-cache-oat,system/app/Bluetooth.apk)) |
| 152 | $(eval $(call build-art-cache-oat,system/app/BooksTablet.apk)) |
| 153 | $(eval $(call build-art-cache-oat,system/app/Browser.apk)) |
| 154 | $(eval $(call build-art-cache-oat,system/app/CalendarGoogle.apk)) |
| 155 | $(eval $(call build-art-cache-oat,system/app/CalendarProvider.apk)) |
| 156 | $(eval $(call build-art-cache-oat,system/app/CarHomeGoogle.apk)) |
| 157 | $(eval $(call build-art-cache-oat,system/app/CertInstaller.apk)) |
| 158 | $(eval $(call build-art-cache-oat,system/app/ChromeBookmarksSyncAdapter.apk)) |
| 159 | $(eval $(call build-art-cache-oat,system/app/Contacts.apk)) |
| 160 | $(eval $(call build-art-cache-oat,system/app/ContactsProvider.apk)) |
| 161 | $(eval $(call build-art-cache-oat,system/app/DefaultContainerService.apk)) |
| 162 | $(eval $(call build-art-cache-oat,system/app/DeskClockGoogle.apk)) |
| 163 | $(eval $(call build-art-cache-oat,system/app/Development.apk)) |
| 164 | $(eval $(call build-art-cache-oat,system/app/DownloadProvider.apk)) |
| 165 | $(eval $(call build-art-cache-oat,system/app/DownloadProviderUi.apk)) |
| 166 | $(eval $(call build-art-cache-oat,system/app/DrmProvider.apk)) |
| 167 | $(eval $(call build-art-cache-oat,system/app/EmailGoogle.apk)) |
| 168 | $(eval $(call build-art-cache-oat,system/app/ExchangeGoogle.apk)) |
| 169 | $(eval $(call build-art-cache-oat,system/app/GalleryGoogle.apk)) |
| 170 | $(eval $(call build-art-cache-oat,system/app/GenieWidget.apk)) |
| 171 | $(eval $(call build-art-cache-oat,system/app/Gmail.apk)) |
| 172 | $(eval $(call build-art-cache-oat,system/app/GoogleBackupTransport.apk)) |
| 173 | $(eval $(call build-art-cache-oat,system/app/GoogleContactsSyncAdapter.apk)) |
| 174 | $(eval $(call build-art-cache-oat,system/app/GoogleEarth.apk)) |
| 175 | $(eval $(call build-art-cache-oat,system/app/GoogleFeedback.apk)) |
| 176 | $(eval $(call build-art-cache-oat,system/app/GoogleLoginService.apk)) |
| 177 | $(eval $(call build-art-cache-oat,system/app/GooglePackageVerifier.apk)) |
| 178 | $(eval $(call build-art-cache-oat,system/app/GooglePartnerSetup.apk)) |
| 179 | $(eval $(call build-art-cache-oat,system/app/GoogleQuickSearchBox.apk)) |
| 180 | $(eval $(call build-art-cache-oat,system/app/GoogleServicesFramework.apk)) |
| 181 | $(eval $(call build-art-cache-oat,system/app/GoogleTTS8k.apk)) |
| 182 | $(eval $(call build-art-cache-oat,system/app/HTMLViewer.apk)) |
| 183 | $(eval $(call build-art-cache-oat,system/app/KeyChain.apk)) |
| 184 | $(eval $(call build-art-cache-oat,system/app/LatinImeDictionaryPack.apk)) |
| 185 | $(eval $(call build-art-cache-oat,system/app/LatinImeGoogle.apk)) |
| 186 | $(eval $(call build-art-cache-oat,system/app/Launcher2.apk)) |
| 187 | $(eval $(call build-art-cache-oat,system/app/LiveWallpapers.apk)) |
| 188 | $(eval $(call build-art-cache-oat,system/app/LiveWallpapersPicker.apk)) |
| 189 | $(eval $(call build-art-cache-oat,system/app/MagicSmokeWallpapers.apk)) |
| 190 | $(eval $(call build-art-cache-oat,system/app/Maps.apk)) |
| 191 | $(eval $(call build-art-cache-oat,system/app/MediaProvider.apk)) |
| 192 | $(eval $(call build-art-cache-oat,system/app/MediaUploader.apk)) |
| 193 | $(eval $(call build-art-cache-oat,system/app/Microbes.apk)) |
| 194 | $(eval $(call build-art-cache-oat,system/app/Mms.apk)) |
| 195 | $(eval $(call build-art-cache-oat,system/app/Music2.apk)) |
| 196 | $(eval $(call build-art-cache-oat,system/app/MusicFX.apk)) |
| 197 | $(eval $(call build-art-cache-oat,system/app/NetSpeed.apk)) |
| 198 | $(eval $(call build-art-cache-oat,system/app/NetworkLocation.apk)) |
| 199 | $(eval $(call build-art-cache-oat,system/app/NfcGoogle.apk)) |
| 200 | $(eval $(call build-art-cache-oat,system/app/OneTimeInitializer.apk)) |
| 201 | $(eval $(call build-art-cache-oat,system/app/PackageInstaller.apk)) |
| 202 | $(eval $(call build-art-cache-oat,system/app/Phone.apk)) |
| 203 | $(eval $(call build-art-cache-oat,system/app/Phonesky.apk)) |
| 204 | $(eval $(call build-art-cache-oat,system/app/PlusOne.apk)) # requires more memory to avoid OutOfMemoryError |
| 205 | $(eval $(call build-art-cache-oat,system/app/Settings.apk)) |
| 206 | $(eval $(call build-art-cache-oat,system/app/SettingsProvider.apk)) |
| 207 | $(eval $(call build-art-cache-oat,system/app/SetupWizard.apk)) |
| 208 | $(eval $(call build-art-cache-oat,system/app/SoundRecorder.apk)) |
| 209 | $(eval $(call build-art-cache-oat,system/app/SpeechRecorder.apk)) |
| 210 | $(eval $(call build-art-cache-oat,system/app/StingrayProgramMenu.apk)) |
| 211 | $(eval $(call build-art-cache-oat,system/app/StingrayProgramMenuSystem.apk)) |
| 212 | $(eval $(call build-art-cache-oat,system/app/Street.apk)) |
| 213 | $(eval $(call build-art-cache-oat,system/app/SystemUI.apk)) |
| 214 | $(eval $(call build-art-cache-oat,system/app/TagGoogle.apk)) |
| 215 | $(eval $(call build-art-cache-oat,system/app/Talk.apk)) |
| 216 | $(eval $(call build-art-cache-oat,system/app/TelephonyProvider.apk)) |
| 217 | $(eval $(call build-art-cache-oat,system/app/Thinkfree.apk)) |
| 218 | $(eval $(call build-art-cache-oat,system/app/UserDictionaryProvider.apk)) |
| 219 | $(eval $(call build-art-cache-oat,system/app/VideoEditorGoogle.apk)) |
| 220 | $(eval $(call build-art-cache-oat,system/app/Videos.apk)) |
| 221 | $(eval $(call build-art-cache-oat,system/app/VisualizationWallpapers.apk)) |
| 222 | $(eval $(call build-art-cache-oat,system/app/VoiceDialer.apk)) |
| 223 | $(eval $(call build-art-cache-oat,system/app/VoiceSearch.apk)) |
| 224 | $(eval $(call build-art-cache-oat,system/app/VpnDialogs.apk)) |
| 225 | $(eval $(call build-art-cache-oat,system/app/YouTube.apk)) |
| 226 | $(eval $(call build-art-cache-oat,system/app/googlevoice.apk)) |
| 227 | $(eval $(call build-art-cache-oat,system/app/talkback.apk)) |
| 228 | $(eval $(call build-art-cache-oat,system/framework/android.test.runner.jar)) |
| 229 | $(eval $(call build-art-cache-oat,system/framework/bmgr.jar)) |
| 230 | $(eval $(call build-art-cache-oat,system/framework/bu.jar)) |
| 231 | $(eval $(call build-art-cache-oat,system/framework/com.android.future.usb.accessory.jar)) |
| 232 | $(eval $(call build-art-cache-oat,system/framework/com.android.location.provider.jar)) |
| 233 | $(eval $(call build-art-cache-oat,system/framework/com.android.nfc_extras.jar)) |
| 234 | $(eval $(call build-art-cache-oat,system/framework/com.google.android.maps.jar)) |
| 235 | $(eval $(call build-art-cache-oat,system/framework/com.google.android.media.effects.jar)) |
| 236 | $(eval $(call build-art-cache-oat,system/framework/ext.jar)) |
| 237 | $(eval $(call build-art-cache-oat,system/framework/ime.jar)) |
| 238 | $(eval $(call build-art-cache-oat,system/framework/input.jar)) |
| 239 | $(eval $(call build-art-cache-oat,system/framework/javax.obex.jar)) |
| 240 | $(eval $(call build-art-cache-oat,system/framework/monkey.jar)) |
| 241 | $(eval $(call build-art-cache-oat,system/framework/pm.jar)) |
| 242 | $(eval $(call build-art-cache-oat,system/framework/send_bug.jar)) |
| 243 | $(eval $(call build-art-cache-oat,system/framework/svc.jar)) |
| 244 | endif |
| 245 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 246 | .PHONY: test-art-target-oat-process-am |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 247 | test-art-target-oat-process-am: $(call art-cache-oat,system/framework/am.jar) test-art-target-sync |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 248 | adb remount |
| 249 | adb sync |
Elliott Hughes | 352a424 | 2011-10-31 15:15:21 -0700 | [diff] [blame] | 250 | adb shell sh -c "export CLASSPATH=/system/framework/am.jar && $(OAT_PROCESS) /system/bin/app_process /system/bin com.android.commands.am.Am start http://android.com && touch $(ART_TEST_DIR)/test-art-target-process-am" |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 251 | $(hide) (adb pull $(ART_TEST_DIR)/test-art-target-process-am /tmp/ && echo test-art-target-process-am PASSED) || echo test-art-target-process-am FAILED |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 252 | $(hide) rm /tmp/test-art-target-process-am |
| 253 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 254 | .PHONY: test-art-target-oat-process-Calculator |
| 255 | # Note that using this instead of "adb shell am start" make sure that the /data/art-cache is up-to-date |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 256 | test-art-target-oat-process-Calculator: $(call art-cache-oat,system/app/Calculator.oat) $(call art-cache-oat,system/framework/am.jar) test-art-target-sync |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 257 | mkdir -p $(ART_CACHE_OUT) |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 258 | unzip $(TARGET_OUT_APPS)/Calculator.apk classes.dex -d $(TARGET_OUT_DATA)/art-cache |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 259 | mv $(TARGET_OUT_DATA)/art-cache/classes.dex $(ART_CACHE_OUT)/system@app@Calculator.apk@classes.dex.`unzip -lv $(TARGET_OUT_APPS)/Calculator.apk classes.dex | grep classes.dex | sed -E 's/.* ([0-9a-f]+) classes.dex/\1/'` # note this is extracting the crc32 that is needed as the file extension |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 260 | adb remount |
| 261 | adb sync |
Elliott Hughes | 352a424 | 2011-10-31 15:15:21 -0700 | [diff] [blame] | 262 | if [ "`adb shell getprop wrap.com.android.calculator2 | tr -d '\r'`" = "$(OAT_PROCESS)" ]; then \ |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 263 | echo wrap.com.android.calculator2 already set; \ |
Elliott Hughes | 6ba581a | 2011-10-25 11:45:35 -0700 | [diff] [blame] | 264 | adb shell start; \ |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 265 | else \ |
| 266 | echo Setting wrap.com.android.calculator2 and restarting runtime; \ |
Elliott Hughes | 352a424 | 2011-10-31 15:15:21 -0700 | [diff] [blame] | 267 | adb shell setprop wrap.com.android.calculator2 "$(OAT_PROCESS)"; \ |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 268 | adb shell stop; \ |
| 269 | adb shell start; \ |
| 270 | sleep 30; \ |
| 271 | fi |
Brian Carlstrom | dddab0c | 2011-09-27 13:35:23 -0700 | [diff] [blame] | 272 | adb shell kill `adb shell ps | fgrep com.android.calculator2 | sed -e 's/[^ ]* *\([0-9]*\).*/\1/'` |
Elliott Hughes | 352a424 | 2011-10-31 15:15:21 -0700 | [diff] [blame] | 273 | adb shell sh -c "export CLASSPATH=/system/framework/am.jar && $(OAT_PROCESS) /system/bin/app_process /system/bin com.android.commands.am.Am start -a android.intent.action.MAIN -n com.android.calculator2/.Calculator && touch $(ART_TEST_DIR)/test-art-target-process-Calculator" |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 274 | $(hide) (adb pull $(ART_TEST_DIR)/test-art-target-process-Calculator /tmp/ && echo test-art-target-process-Calculator PASSED) || echo test-art-target-process-Calculator FAILED |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 275 | $(hide) rm /tmp/test-art-target-process-Calculator |
| 276 | |
| 277 | ######################################################################## |
Brian Carlstrom | 76aa0c0 | 2011-10-11 15:29:43 -0700 | [diff] [blame] | 278 | # zygote targets |
| 279 | # |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 280 | # zygote-artd will change to use art to boot the device with a debug build |
| 281 | # zygote-art will change to use art to boot the device with a production build |
| 282 | # zygote-dalvik will restore to booting with dalvik |
| 283 | # |
| 284 | # zygote-artd-target-sync will just push a new artd in place of dvm |
| 285 | # zygote-art-target-sync will just push a new art in place of dvm |
Brian Carlstrom | 76aa0c0 | 2011-10-11 15:29:43 -0700 | [diff] [blame] | 286 | |
Brian Carlstrom | fab6293 | 2011-10-27 21:47:49 -0700 | [diff] [blame] | 287 | # $(1): "d" for debug build, "" for ndebug build |
| 288 | define define-zygote-art-targets |
| 289 | .PHONY: zygote-art$(1)-target-sync |
| 290 | zygote-art$(1)-target-sync: $(ART_TARGET_DEPENDENCIES) $(TARGET_BOOT_OAT) $(ART_CACHE_OATS) |
| 291 | cp $(TARGET_OUT_SHARED_LIBRARIES)/libart$(1).so $(TARGET_OUT_SHARED_LIBRARIES)/libdvm.so |
| 292 | cp $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/libart$(1).so $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/libdvm.so |
| 293 | cp $(TARGET_OUT_EXECUTABLES)/oatopt$(1) $(TARGET_OUT_EXECUTABLES)/dexopt |
| 294 | cp $(TARGET_OUT_EXECUTABLES_UNSTRIPPED)/oatopt$(1) $(TARGET_OUT_EXECUTABLES_UNSTRIPPED)/dexopt |
Brian Carlstrom | 31edec5 | 2011-10-16 17:10:24 -0700 | [diff] [blame] | 295 | mkdir -p $(TARGET_OUT_DATA)/property |
| 296 | echo -n 1 > $(TARGET_OUT_DATA)/property/persist.sys.strictmode.disabled |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 297 | adb remount |
| 298 | adb sync |
| 299 | |
Brian Carlstrom | fab6293 | 2011-10-27 21:47:49 -0700 | [diff] [blame] | 300 | .PHONY: zygote-art$(1) |
| 301 | zygote-art$(1): zygote-art$(1)-target-sync |
Brian Carlstrom | b7bbba4 | 2011-10-13 14:58:47 -0700 | [diff] [blame] | 302 | sed -e 's/--start-system-server/--start-system-server --no-preload/' -e 's/art-cache 0771/art-cache 0777/' < system/core/rootdir/init.rc > $(ANDROID_PRODUCT_OUT)/root/init.rc |
| 303 | adb shell rm -f $(ART_CACHE_DIR) |
Brian Carlstrom | 76aa0c0 | 2011-10-11 15:29:43 -0700 | [diff] [blame] | 304 | rm -f $(ANDROID_PRODUCT_OUT)/boot.img |
| 305 | unset ONE_SHOT_MAKEFILE && $(MAKE) showcommands bootimage |
| 306 | adb reboot bootloader |
| 307 | fastboot flash boot $(ANDROID_PRODUCT_OUT)/boot.img |
| 308 | fastboot reboot |
Brian Carlstrom | fab6293 | 2011-10-27 21:47:49 -0700 | [diff] [blame] | 309 | endef |
| 310 | |
| 311 | $(eval $(call define-zygote-art-targets,d)) |
| 312 | $(eval $(call define-zygote-art-targets,)) |
Brian Carlstrom | 76aa0c0 | 2011-10-11 15:29:43 -0700 | [diff] [blame] | 313 | |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 314 | .PHONY: zygote-dalvik |
| 315 | zygote-dalvik: |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 316 | cp $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libdvm.so $(TARGET_OUT_SHARED_LIBRARIES)/libdvm.so |
| 317 | cp $(call intermediates-dir-for,SHARED_LIBRARIES,libdvm)/LINKED/libdvm.so $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/libdvm.so |
Brian Carlstrom | b7bbba4 | 2011-10-13 14:58:47 -0700 | [diff] [blame] | 318 | cp $(call intermediates-dir-for,EXECUTABLES,dexopt)/dexopt $(TARGET_OUT_EXECUTABLES)/dexopt |
| 319 | cp $(call intermediates-dir-for,EXECUTABLES,dexopt)/LINKED/dexopt $(TARGET_OUT_EXECUTABLES_UNSTRIPPED)/dexopt |
Brian Carlstrom | 24a3c2e | 2011-10-17 18:07:52 -0700 | [diff] [blame] | 320 | rm -f $(TARGET_OUT_DATA)/property/persist.sys.strictmode.disabled |
Brian Carlstrom | 31edec5 | 2011-10-16 17:10:24 -0700 | [diff] [blame] | 321 | adb shell rm /data/property/persist.sys.strictmode.disabled |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 322 | adb remount |
| 323 | adb sync |
Brian Carlstrom | 648e5e9 | 2011-10-11 22:49:18 -0700 | [diff] [blame] | 324 | cp system/core/rootdir/init.rc $(ANDROID_PRODUCT_OUT)/root/init.rc |
Brian Carlstrom | 76aa0c0 | 2011-10-11 15:29:43 -0700 | [diff] [blame] | 325 | rm -f $(ANDROID_PRODUCT_OUT)/boot.img |
| 326 | unset ONE_SHOT_MAKEFILE && $(MAKE) showcommands bootimage |
| 327 | adb reboot bootloader |
| 328 | fastboot flash boot $(ANDROID_PRODUCT_OUT)/boot.img |
| 329 | fastboot reboot |
| 330 | |
| 331 | ######################################################################## |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 332 | # oatdump targets |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 333 | |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 334 | .PHONY: dump-oat |
Brian Carlstrom | 03a20ba | 2011-10-13 10:24:13 -0700 | [diff] [blame] | 335 | dump-oat: dump-oat-core dump-oat-boot dump-oat-Calculator |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 336 | |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 337 | .PHONY: dump-oat-core |
| 338 | dump-oat-core: $(TARGET_CORE_OAT) $(OATDUMP) |
Brian Carlstrom | 58ae941 | 2011-10-04 00:56:06 -0700 | [diff] [blame] | 339 | $(OATDUMP) --image=$(TARGET_CORE_IMG) --host-prefix=$(PRODUCT_OUT) --output=/tmp/core.oatdump.txt |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 340 | @echo Output in /tmp/core.oatdump.txt |
| 341 | |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 342 | .PHONY: dump-oat-boot |
| 343 | dump-oat-boot: $(TARGET_BOOT_OAT) $(OATDUMP) |
Brian Carlstrom | 58ae941 | 2011-10-04 00:56:06 -0700 | [diff] [blame] | 344 | $(OATDUMP) --image=$(TARGET_BOOT_IMG) --host-prefix=$(PRODUCT_OUT) --output=/tmp/boot.oatdump.txt |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 345 | @echo Output in /tmp/boot.oatdump.txt |
Brian Carlstrom | 78128a6 | 2011-09-15 17:21:19 -0700 | [diff] [blame] | 346 | |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 347 | .PHONY: dump-oat-Calculator |
Brian Carlstrom | 03a20ba | 2011-10-13 10:24:13 -0700 | [diff] [blame] | 348 | dump-oat-Calculator: $(call art-cache-oat,system/app/Calculator.oat) $(TARGET_BOOT_OAT) $(OATDUMP) |
| 349 | $(OATDUMP) --oat=$< --boot-image=$(TARGET_BOOT_IMG) --host-prefix=$(PRODUCT_OUT) --output=/tmp/Calculator.oatdump.txt |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 350 | @echo Output in /tmp/Calculator.oatdump.txt |
| 351 | |
| 352 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 353 | ######################################################################## |
Brian Carlstrom | fab6293 | 2011-10-27 21:47:49 -0700 | [diff] [blame] | 354 | # clean-oat target |
| 355 | # |
| 356 | |
| 357 | .PHONY: clean-oat |
| 358 | clean-oat: |
| 359 | rm -f $(ART_TEST_OUT)/*.oat |
| 360 | rm -f $(ART_CACHE_OUT)/*.oat |
| 361 | adb shell rm $(ART_TEST_DIR)/*.oat |
| 362 | adb shell rm $(ART_CACHE_DIR)/*.oat |
| 363 | |
| 364 | ######################################################################## |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 365 | # cpplint target |
| 366 | |
Brian Carlstrom | 59848da | 2011-07-23 20:35:19 -0700 | [diff] [blame] | 367 | # "mm cpplint-art" to style check art source files |
| 368 | .PHONY: cpplint-art |
| 369 | cpplint-art: |
Elliott Hughes | a51a3dd | 2011-10-17 15:19:26 -0700 | [diff] [blame] | 370 | ./art/tools/cpplint.py \ |
| 371 | --filter=-whitespace/comments,-whitespace/line_length,-build/include,-build/header_guard,-readability/streams,-readability/todo,-runtime/references \ |
Elliott Hughes | 362f9bc | 2011-10-17 18:56:41 -0700 | [diff] [blame] | 372 | $(ANDROID_BUILD_TOP)/art/src/*.h $(ANDROID_BUILD_TOP)/art/src/*.cc |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 373 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 374 | ######################################################################## |
| 375 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 376 | include $(call all-makefiles-under,$(LOCAL_PATH)) |