blob: 6bbceb9dfcd0f8074080b2125faf8c158df15716 [file] [log] [blame]
Carl Shapiro7b216702011-06-17 15:09:26 -07001#
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
17LOCAL_PATH := $(call my-dir)
Carl Shapiro7b216702011-06-17 15:09:26 -070018
Brian Carlstrom4b620ff2011-09-11 01:11:01 -070019# These can be overridden via the environment or by editing to
20# enable/disable certain build configuration.
21ART_BUILD_TARGET_NDEBUG ?= true
22ART_BUILD_TARGET_DEBUG ?= true
Brian Carlstrom56778d82011-09-11 14:08:17 -070023ifeq ($(HOST_OS),linux)
24 ART_BUILD_HOST_NDEBUG ?= true
25 ART_BUILD_HOST_DEBUG ?= true
26else
27 ART_BUILD_HOST_NDEBUG ?= false
28 ART_BUILD_HOST_DEBUG ?= false
29endif
Brian Carlstrom4b620ff2011-09-11 01:11:01 -070030
Carl Shapiro0e6d1972011-07-06 19:17:39 -070031build_path := $(LOCAL_PATH)/build
Brian Carlstromcdc8de42011-07-19 14:23:17 -070032include $(build_path)/Android.common.mk
33
Carl Shapiro0e6d1972011-07-06 19:17:39 -070034include $(build_path)/Android.libart.mk
Brian Carlstrom69b15fb2011-09-03 12:25:21 -070035include $(build_path)/Android.executable.mk
Carl Shapiro7b216702011-06-17 15:09:26 -070036
Brian Carlstrom16192862011-09-12 17:50:06 -070037include $(build_path)/Android.oat.mk
38
Brian Carlstrom07d579f2011-07-27 13:31:51 -070039include $(build_path)/Android.libarttest.mk
Brian Carlstrombbf1e412011-09-18 14:14:51 -070040include $(build_path)/Android.gtest.mk
41include $(build_path)/Android.oattest.mk
Brian Carlstrom934486c2011-07-12 23:42:50 -070042
43# "m build-art" for quick minimal build
44.PHONY: build-art
45build-art: \
Brian Carlstrom69b15fb2011-09-03 12:25:21 -070046 $(ART_TARGET_EXECUTABLES) \
Brian Carlstrom8ecd08c2011-07-27 17:50:51 -070047 $(ART_TARGET_TEST_EXECUTABLES) \
Brian Carlstrom69b15fb2011-09-03 12:25:21 -070048 $(ART_HOST_EXECUTABLES) \
Carl Shapiro47940d62011-08-13 22:21:30 -070049 $(ART_HOST_TEST_EXECUTABLES)
Brian Carlstrom934486c2011-07-12 23:42:50 -070050
Brian Carlstrom4a96b602011-07-26 16:40:23 -070051# "mm test-art" to build and run all tests on host and device
52.PHONY: test-art
53test-art: test-art-host test-art-target
Brian Carlstrom395520e2011-09-25 19:35:00 -070054 @echo test-art PASSED
Brian Carlstrom4a96b602011-07-26 16:40:23 -070055
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070056.PHONY: test-art-gtest
57test-art-gtest: test-art-host test-art-target-gtest
58 @echo test-art-gtest PASSED
59
Elliott Hughes2cae5a22011-08-14 14:27:25 -070060define run-host-tests-with
Elliott Hughesb465ab02011-08-24 11:21:21 -070061 $(foreach file,$(sort $(ART_HOST_TEST_EXECUTABLES)),$(1) $(file) &&) true
Elliott Hughes2cae5a22011-08-14 14:27:25 -070062endef
63
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070064ART_HOST_DEPENDENCIES := $(ART_HOST_EXECUTABLES) $(HOST_OUT_JAVA_LIBRARIES)/core-hostdex.jar
65ART_TARGET_DEPENDENCIES := $(ART_TARGET_EXECUTABLES) $(TARGET_OUT_JAVA_LIBRARIES)/core.jar
Brian Carlstrom0796af02011-10-12 14:31:45 -070066
67ART_HOST_TEST_DEPENDENCIES := $(ART_HOST_DEPENDENCIES) $(ART_TEST_OAT_FILES)
68ART_TARGET_TEST_DEPENDENCIES := $(ART_TARGET_DEPENDENCIES) $(ART_TEST_OAT_FILES)
Brian Carlstrom9f30b382011-08-28 22:41:38 -070069
Brian Carlstrombc2f3e32011-09-22 17:16:54 -070070ART_TARGET_TEST_DEPENDENCIES += $(TARGET_OUT_EXECUTABLES)/oat_process $(TARGET_OUT_EXECUTABLES)/oat_processd
71
Elliott Hughes352a4242011-10-31 15:15:21 -070072# Switch this to "oat_process" to run an optimized build.
73OAT_PROCESS=oat_processd
74
Brian Carlstrombc2f3e32011-09-22 17:16:54 -070075########################################################################
76# host test targets
77
Brian Carlstrom934486c2011-07-12 23:42:50 -070078# "mm test-art-host" to build and run all host tests
79.PHONY: test-art-host
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070080test-art-host: $(ART_HOST_TEST_DEPENDENCIES) $(ART_HOST_TEST_TARGETS)
Brian Carlstrom395520e2011-09-25 19:35:00 -070081 @echo test-art-host PASSED
Brian Carlstrom59848da2011-07-23 20:35:19 -070082
Elliott Hughes5511f212011-08-12 18:07:45 -070083# "mm valgrind-art-host" to build and run all host tests under valgrind.
84.PHONY: valgrind-art-host
Brian Carlstrom9f30b382011-08-28 22:41:38 -070085valgrind-art-host: $(ART_HOST_TEST_DEPENDENCIES)
Elliott Hughes2cae5a22011-08-14 14:27:25 -070086 $(call run-host-tests-with,"valgrind")
Brian Carlstrom395520e2011-09-25 19:35:00 -070087 @echo valgrind-art-host PASSED
Elliott Hughes2cae5a22011-08-14 14:27:25 -070088
89# "mm tsan-art-host" to build and run all host tests under tsan.
90.PHONY: tsan-art-host
Brian Carlstrom9f30b382011-08-28 22:41:38 -070091tsan-art-host: $(ART_HOST_TEST_DEPENDENCIES)
Elliott Hughes2cae5a22011-08-14 14:27:25 -070092 $(call run-host-tests-with,"tsan")
Brian Carlstrom395520e2011-09-25 19:35:00 -070093 @echo tsan-art-host PASSED
Elliott Hughes5511f212011-08-12 18:07:45 -070094
Brian Carlstrombc2f3e32011-09-22 17:16:54 -070095########################################################################
96# target test targets
97
98# "mm test-art-target" to build and run all target tests
Brian Carlstrom4a96b602011-07-26 16:40:23 -070099.PHONY: test-art-target
Brian Carlstrome24fa612011-09-29 00:53:55 -0700100test-art-target: test-art-target-gtest test-art-target-oat test-art-target-run-test
Brian Carlstrom395520e2011-09-25 19:35:00 -0700101 @echo test-art-target PASSED
Brian Carlstrom86927212011-09-15 11:31:11 -0700102
103.PHONY: test-art-target-sync
104test-art-target-sync: $(ART_TARGET_TEST_DEPENDENCIES)
Brian Carlstrom4a96b602011-07-26 16:40:23 -0700105 adb remount
106 adb sync
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700107 adb shell mkdir -p $(ART_TEST_DIR)
Brian Carlstrom86927212011-09-15 11:31:11 -0700108
109.PHONY: test-art-target-gtest
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700110test-art-target-gtest: $(ART_TARGET_TEST_TARGETS)
Brian Carlstrom86927212011-09-15 11:31:11 -0700111
112.PHONY: test-art-target-oat
Brian Carlstrombbf1e412011-09-18 14:14:51 -0700113test-art-target-oat: $(ART_TEST_OAT_TARGETS)
Brian Carlstrom395520e2011-09-25 19:35:00 -0700114 @echo test-art-target-oat PASSED
Brian Carlstrom4a96b602011-07-26 16:40:23 -0700115
Brian Carlstrome24fa612011-09-29 00:53:55 -0700116.PHONY: test-art-target-run-test
117test-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 Carlstrom58ae9412011-10-04 00:56:06 -0700121test-art-target-run-test-002: test-art-target-sync
Brian Carlstrome24fa612011-09-29 00:53:55 -0700122 art/test/run-test 002
123 @echo test-art-target-run-test-002 PASSED
124
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700125########################################################################
126# oat_process test targets
127
Brian Carlstroma9f19782011-10-13 00:14:47 -0700128# $(1): jar or apk name
129define art-cache-oat
130 $(ART_CACHE_OUT)/$(subst /,@,$(patsubst %.apk,%.oat,$(patsubst %.jar,%.oat,$(1))))
131endef
132
133ART_CACHE_OATS :=
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700134# $(1): name
Brian Carlstroma9f19782011-10-13 00:14:47 -0700135define 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 Carlstrom27ec9612011-09-19 20:20:38 -0700138endef
139
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700140.PHONY: test-art-target-oat-process
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700141test-art-target-oat-process: test-art-target-oat-process-am # test-art-target-oat-process-Calculator
142
Brian Carlstroma9f19782011-10-13 00:14:47 -0700143$(eval $(call build-art-cache-oat,system/framework/am.jar))
144$(eval $(call build-art-cache-oat,system/app/Calculator.apk))
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700145
Ian Rogersf8a199c2011-11-03 17:16:02 -0700146
147# WORKING for zygote-art
Elliott Hughes0dc36d72011-12-13 19:40:43 -0800148ifeq ($(TARGET_PRODUCT),mysid)
149
150$(eval $(call build-art-cache-oat,system/app/ApplicationsProvider.apk))
151$(eval $(call build-art-cache-oat,system/app/BackupRestoreConfirmation.apk))
152$(eval $(call build-art-cache-oat,system/app/BIP.apk))
153$(eval $(call build-art-cache-oat,system/app/Bluetooth.apk))
154$(eval $(call build-art-cache-oat,system/app/BooksTablet.apk))
155$(eval $(call build-art-cache-oat,system/app/BrowserGoogle.apk))
156$(eval $(call build-art-cache-oat,system/app/CalendarGoogle.apk))
157$(eval $(call build-art-cache-oat,system/app/CalendarProvider.apk))
158$(eval $(call build-art-cache-oat,system/app/CameraGoogle.apk))
159$(eval $(call build-art-cache-oat,system/app/CertInstaller.apk))
160$(eval $(call build-art-cache-oat,system/app/ChromeBookmarksSyncAdapter.apk))
161$(eval $(call build-art-cache-oat,system/app/Contacts.apk))
162$(eval $(call build-art-cache-oat,system/app/ContactsProvider.apk))
163$(eval $(call build-art-cache-oat,system/app/DefaultContainerService.apk))
164$(eval $(call build-art-cache-oat,system/app/DeskClockGoogle.apk))
165$(eval $(call build-art-cache-oat,system/app/Development.apk))
166$(eval $(call build-art-cache-oat,system/app/DownloadProvider.apk))
167$(eval $(call build-art-cache-oat,system/app/DownloadProviderUi.apk))
168$(eval $(call build-art-cache-oat,system/app/DrmProvider.apk))
169$(eval $(call build-art-cache-oat,system/app/EmailGoogle.apk))
170$(eval $(call build-art-cache-oat,system/app/ExchangeGoogle.apk))
171$(eval $(call build-art-cache-oat,system/app/GalleryGoogle.apk))
172$(eval $(call build-art-cache-oat,system/app/GenieWidget.apk))
173$(eval $(call build-art-cache-oat,system/app/Gmail.apk))
174$(eval $(call build-art-cache-oat,system/app/GoogleBackupTransport.apk))
175$(eval $(call build-art-cache-oat,system/app/GoogleContactsSyncAdapter.apk))
176$(eval $(call build-art-cache-oat,system/app/GoogleEarth.apk))
177$(eval $(call build-art-cache-oat,system/app/GoogleFeedback.apk))
178$(eval $(call build-art-cache-oat,system/app/GoogleLoginService.apk))
179$(eval $(call build-art-cache-oat,system/app/GooglePackageVerifier.apk))
180$(eval $(call build-art-cache-oat,system/app/GooglePackageVerifierUpdater.apk))
181$(eval $(call build-art-cache-oat,system/app/GooglePartnerSetup.apk))
182$(eval $(call build-art-cache-oat,system/app/GoogleQuickSearchBox.apk))
183$(eval $(call build-art-cache-oat,system/app/GoogleServicesFramework.apk))
184$(eval $(call build-art-cache-oat,system/app/GoogleTTS.apk))
185$(eval $(call build-art-cache-oat,system/app/HTMLViewer.apk))
186$(eval $(call build-art-cache-oat,system/app/IMSFramework.apk))
187$(eval $(call build-art-cache-oat,system/app/HoloSpiralWallpaper.apk))
188$(eval $(call build-art-cache-oat,system/app/KeyChain.apk))
189$(eval $(call build-art-cache-oat,system/app/LatinImeDictionaryPack.apk))
190$(eval $(call build-art-cache-oat,system/app/LatinImeGoogle.apk))
191$(eval $(call build-art-cache-oat,system/app/Launcher2.apk))
192$(eval $(call build-art-cache-oat,system/app/LiveWallpapers.apk))
193$(eval $(call build-art-cache-oat,system/app/LiveWallpapersPicker.apk))
194$(eval $(call build-art-cache-oat,system/app/Maps.apk))
195$(eval $(call build-art-cache-oat,system/app/MarketUpdater.apk))
196$(eval $(call build-art-cache-oat,system/app/MediaProvider.apk))
197$(eval $(call build-art-cache-oat,system/app/MediaUploader.apk))
198$(eval $(call build-art-cache-oat,system/app/Microbes.apk))
199$(eval $(call build-art-cache-oat,system/app/Mms.apk))
200$(eval $(call build-art-cache-oat,system/app/Music2.apk))
201$(eval $(call build-art-cache-oat,system/app/MusicFX.apk))
202$(eval $(call build-art-cache-oat,system/app/MyVerizon.apk))
203$(eval $(call build-art-cache-oat,system/app/NetSpeed.apk))
204$(eval $(call build-art-cache-oat,system/app/NetworkLocation.apk))
205$(eval $(call build-art-cache-oat,system/app/Nfc.apk))
206$(eval $(call build-art-cache-oat,system/app/OneTimeInitializer.apk))
207$(eval $(call build-art-cache-oat,system/app/PackageInstaller.apk))
208$(eval $(call build-art-cache-oat,system/app/Phone.apk))
209$(eval $(call build-art-cache-oat,system/app/Phonesky.apk))
210$(eval $(call build-art-cache-oat,system/app/PlusOne.apk))
211$(eval $(call build-art-cache-oat,system/app/RTN.apk))
212$(eval $(call build-art-cache-oat,system/app/SDM.apk))
213$(eval $(call build-art-cache-oat,system/app/Settings.apk))
214$(eval $(call build-art-cache-oat,system/app/SettingsProvider.apk))
215$(eval $(call build-art-cache-oat,system/app/SetupWizard.apk))
216$(eval $(call build-art-cache-oat,system/app/SharedStorageBackup.apk))
217$(eval $(call build-art-cache-oat,system/app/SoundRecorder.apk))
218$(eval $(call build-art-cache-oat,system/app/SpeechRecorder.apk))
219$(eval $(call build-art-cache-oat,system/app/SPG.apk))
220$(eval $(call build-art-cache-oat,system/app/StingrayProgramMenu.apk))
221$(eval $(call build-art-cache-oat,system/app/StingrayProgramMenuSystem.apk))
222$(eval $(call build-art-cache-oat,system/app/Stk.apk))
223$(eval $(call build-art-cache-oat,system/app/Street.apk))
224$(eval $(call build-art-cache-oat,system/app/SyncMLSvc.apk))
225$(eval $(call build-art-cache-oat,system/app/SystemUI.apk))
226$(eval $(call build-art-cache-oat,system/app/TagGoogle.apk))
227$(eval $(call build-art-cache-oat,system/app/Talk.apk))
228$(eval $(call build-art-cache-oat,system/app/TelephonyProvider.apk))
229$(eval $(call build-art-cache-oat,system/app/Thinkfree.apk))
230$(eval $(call build-art-cache-oat,system/app/UserDictionaryProvider.apk))
231$(eval $(call build-art-cache-oat,system/app/VerizonSSO.apk))
232$(eval $(call build-art-cache-oat,system/app/VideoEditorGoogle.apk))
233$(eval $(call build-art-cache-oat,system/app/Videos.apk))
234$(eval $(call build-art-cache-oat,system/app/VisualizationWallpapers.apk))
235$(eval $(call build-art-cache-oat,system/app/VoiceDialer.apk))
236$(eval $(call build-art-cache-oat,system/app/VoiceSearch.apk))
237$(eval $(call build-art-cache-oat,system/app/VpnDialogs.apk))
238$(eval $(call build-art-cache-oat,system/app/VZWAPNLib.apk))
239$(eval $(call build-art-cache-oat,system/app/VZWAPNService.apk))
240$(eval $(call build-art-cache-oat,system/app/VZWBackupAssistant.apk))
241$(eval $(call build-art-cache-oat,system/app/YouTube.apk))
242$(eval $(call build-art-cache-oat,system/app/talkback.apk))
243$(eval $(call build-art-cache-oat,system/framework/android.test.runner.jar))
244$(eval $(call build-art-cache-oat,system/framework/bmgr.jar))
245$(eval $(call build-art-cache-oat,system/framework/bu.jar))
246$(eval $(call build-art-cache-oat,system/framework/com.android.future.usb.accessory.jar))
247$(eval $(call build-art-cache-oat,system/framework/com.android.location.provider.jar))
248$(eval $(call build-art-cache-oat,system/framework/com.android.nfc_extras.jar))
249$(eval $(call build-art-cache-oat,system/framework/com.google.android.maps.jar))
250$(eval $(call build-art-cache-oat,system/framework/com.google.android.media.effects.jar))
251$(eval $(call build-art-cache-oat,system/framework/ext.jar))
252$(eval $(call build-art-cache-oat,system/framework/ime.jar))
253$(eval $(call build-art-cache-oat,system/framework/input.jar))
254$(eval $(call build-art-cache-oat,system/framework/javax.obex.jar))
255$(eval $(call build-art-cache-oat,system/framework/monkey.jar))
256$(eval $(call build-art-cache-oat,system/framework/pm.jar))
257$(eval $(call build-art-cache-oat,system/framework/send_bug.jar))
258$(eval $(call build-art-cache-oat,system/framework/svc.jar))
259
260else
261
262ifeq ($(TARGET_PRODUCT),soju)
263
Ian Rogersf8a199c2011-11-03 17:16:02 -0700264$(eval $(call build-art-cache-oat,system/app/ApplicationsProvider.apk))
265$(eval $(call build-art-cache-oat,system/app/BackupRestoreConfirmation.apk))
266$(eval $(call build-art-cache-oat,system/app/Bluetooth.apk))
267$(eval $(call build-art-cache-oat,system/app/BooksTablet.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800268$(eval $(call build-art-cache-oat,system/app/BrowserGoogle.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700269$(eval $(call build-art-cache-oat,system/app/CalendarGoogle.apk))
270$(eval $(call build-art-cache-oat,system/app/CalendarProvider.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800271$(eval $(call build-art-cache-oat,system/app/CameraGoogle.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700272$(eval $(call build-art-cache-oat,system/app/CarHomeGoogle.apk))
273$(eval $(call build-art-cache-oat,system/app/CertInstaller.apk))
274$(eval $(call build-art-cache-oat,system/app/ChromeBookmarksSyncAdapter.apk))
275$(eval $(call build-art-cache-oat,system/app/Contacts.apk))
276$(eval $(call build-art-cache-oat,system/app/ContactsProvider.apk))
277$(eval $(call build-art-cache-oat,system/app/DefaultContainerService.apk))
278$(eval $(call build-art-cache-oat,system/app/DeskClockGoogle.apk))
279$(eval $(call build-art-cache-oat,system/app/Development.apk))
280$(eval $(call build-art-cache-oat,system/app/DownloadProvider.apk))
281$(eval $(call build-art-cache-oat,system/app/DownloadProviderUi.apk))
282$(eval $(call build-art-cache-oat,system/app/DrmProvider.apk))
283$(eval $(call build-art-cache-oat,system/app/EmailGoogle.apk))
284$(eval $(call build-art-cache-oat,system/app/ExchangeGoogle.apk))
285$(eval $(call build-art-cache-oat,system/app/GalleryGoogle.apk))
286$(eval $(call build-art-cache-oat,system/app/GenieWidget.apk))
287$(eval $(call build-art-cache-oat,system/app/Gmail.apk))
288$(eval $(call build-art-cache-oat,system/app/GoogleBackupTransport.apk))
289$(eval $(call build-art-cache-oat,system/app/GoogleContactsSyncAdapter.apk))
290$(eval $(call build-art-cache-oat,system/app/GoogleEarth.apk))
291$(eval $(call build-art-cache-oat,system/app/GoogleFeedback.apk))
292$(eval $(call build-art-cache-oat,system/app/GoogleLoginService.apk))
293$(eval $(call build-art-cache-oat,system/app/GooglePackageVerifier.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800294$(eval $(call build-art-cache-oat,system/app/GooglePackageVerifierUpdater.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700295$(eval $(call build-art-cache-oat,system/app/GooglePartnerSetup.apk))
296$(eval $(call build-art-cache-oat,system/app/GoogleQuickSearchBox.apk))
297$(eval $(call build-art-cache-oat,system/app/GoogleServicesFramework.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800298$(eval $(call build-art-cache-oat,system/app/GoogleTTS.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700299$(eval $(call build-art-cache-oat,system/app/HTMLViewer.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800300$(eval $(call build-art-cache-oat,system/app/HoloSpiralWallpaper.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700301$(eval $(call build-art-cache-oat,system/app/KeyChain.apk))
302$(eval $(call build-art-cache-oat,system/app/LatinImeDictionaryPack.apk))
303$(eval $(call build-art-cache-oat,system/app/LatinImeGoogle.apk))
304$(eval $(call build-art-cache-oat,system/app/Launcher2.apk))
305$(eval $(call build-art-cache-oat,system/app/LiveWallpapers.apk))
306$(eval $(call build-art-cache-oat,system/app/LiveWallpapersPicker.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700307$(eval $(call build-art-cache-oat,system/app/Maps.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800308$(eval $(call build-art-cache-oat,system/app/MarketUpdater.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700309$(eval $(call build-art-cache-oat,system/app/MediaProvider.apk))
310$(eval $(call build-art-cache-oat,system/app/MediaUploader.apk))
311$(eval $(call build-art-cache-oat,system/app/Microbes.apk))
312$(eval $(call build-art-cache-oat,system/app/Mms.apk))
313$(eval $(call build-art-cache-oat,system/app/Music2.apk))
314$(eval $(call build-art-cache-oat,system/app/MusicFX.apk))
315$(eval $(call build-art-cache-oat,system/app/NetSpeed.apk))
316$(eval $(call build-art-cache-oat,system/app/NetworkLocation.apk))
Brian Carlstromae826982011-11-09 01:33:42 -0800317$(eval $(call build-art-cache-oat,system/app/Nfc.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700318$(eval $(call build-art-cache-oat,system/app/OneTimeInitializer.apk))
319$(eval $(call build-art-cache-oat,system/app/PackageInstaller.apk))
320$(eval $(call build-art-cache-oat,system/app/Phone.apk))
321$(eval $(call build-art-cache-oat,system/app/Phonesky.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800322$(eval $(call build-art-cache-oat,system/app/PlusOne.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700323$(eval $(call build-art-cache-oat,system/app/Settings.apk))
324$(eval $(call build-art-cache-oat,system/app/SettingsProvider.apk))
325$(eval $(call build-art-cache-oat,system/app/SetupWizard.apk))
Brian Carlstrom41df0652011-11-10 10:35:05 -0800326$(eval $(call build-art-cache-oat,system/app/SharedStorageBackup.apk))
Ian Rogersf8a199c2011-11-03 17:16:02 -0700327$(eval $(call build-art-cache-oat,system/app/SoundRecorder.apk))
328$(eval $(call build-art-cache-oat,system/app/SpeechRecorder.apk))
329$(eval $(call build-art-cache-oat,system/app/StingrayProgramMenu.apk))
330$(eval $(call build-art-cache-oat,system/app/StingrayProgramMenuSystem.apk))
331$(eval $(call build-art-cache-oat,system/app/Street.apk))
332$(eval $(call build-art-cache-oat,system/app/SystemUI.apk))
333$(eval $(call build-art-cache-oat,system/app/TagGoogle.apk))
334$(eval $(call build-art-cache-oat,system/app/Talk.apk))
335$(eval $(call build-art-cache-oat,system/app/TelephonyProvider.apk))
336$(eval $(call build-art-cache-oat,system/app/Thinkfree.apk))
337$(eval $(call build-art-cache-oat,system/app/UserDictionaryProvider.apk))
338$(eval $(call build-art-cache-oat,system/app/VideoEditorGoogle.apk))
339$(eval $(call build-art-cache-oat,system/app/Videos.apk))
340$(eval $(call build-art-cache-oat,system/app/VisualizationWallpapers.apk))
341$(eval $(call build-art-cache-oat,system/app/VoiceDialer.apk))
342$(eval $(call build-art-cache-oat,system/app/VoiceSearch.apk))
343$(eval $(call build-art-cache-oat,system/app/VpnDialogs.apk))
344$(eval $(call build-art-cache-oat,system/app/YouTube.apk))
345$(eval $(call build-art-cache-oat,system/app/googlevoice.apk))
346$(eval $(call build-art-cache-oat,system/app/talkback.apk))
347$(eval $(call build-art-cache-oat,system/framework/android.test.runner.jar))
348$(eval $(call build-art-cache-oat,system/framework/bmgr.jar))
349$(eval $(call build-art-cache-oat,system/framework/bu.jar))
350$(eval $(call build-art-cache-oat,system/framework/com.android.future.usb.accessory.jar))
351$(eval $(call build-art-cache-oat,system/framework/com.android.location.provider.jar))
352$(eval $(call build-art-cache-oat,system/framework/com.android.nfc_extras.jar))
353$(eval $(call build-art-cache-oat,system/framework/com.google.android.maps.jar))
354$(eval $(call build-art-cache-oat,system/framework/com.google.android.media.effects.jar))
355$(eval $(call build-art-cache-oat,system/framework/ext.jar))
356$(eval $(call build-art-cache-oat,system/framework/ime.jar))
357$(eval $(call build-art-cache-oat,system/framework/input.jar))
358$(eval $(call build-art-cache-oat,system/framework/javax.obex.jar))
359$(eval $(call build-art-cache-oat,system/framework/monkey.jar))
360$(eval $(call build-art-cache-oat,system/framework/pm.jar))
361$(eval $(call build-art-cache-oat,system/framework/send_bug.jar))
362$(eval $(call build-art-cache-oat,system/framework/svc.jar))
Elliott Hughes0dc36d72011-12-13 19:40:43 -0800363
364else
365
Elliott Hughes42298fa2011-12-13 20:49:29 -0800366$(warning do not know what jars to compile for $(TARGET_PRODUCT))
Elliott Hughes0dc36d72011-12-13 19:40:43 -0800367
368endif
369
Ian Rogersf8a199c2011-11-03 17:16:02 -0700370endif
371
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700372.PHONY: test-art-target-oat-process-am
Brian Carlstroma9f19782011-10-13 00:14:47 -0700373test-art-target-oat-process-am: $(call art-cache-oat,system/framework/am.jar) test-art-target-sync
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700374 adb remount
375 adb sync
Elliott Hughes352a4242011-10-31 15:15:21 -0700376 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 Carlstrom47a0d5a2011-10-12 21:20:05 -0700377 $(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 Carlstrombc2f3e32011-09-22 17:16:54 -0700378 $(hide) rm /tmp/test-art-target-process-am
379
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700380.PHONY: test-art-target-oat-process-Calculator
381# Note that using this instead of "adb shell am start" make sure that the /data/art-cache is up-to-date
Brian Carlstroma9f19782011-10-13 00:14:47 -0700382test-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 Carlstrom47a0d5a2011-10-12 21:20:05 -0700383 mkdir -p $(ART_CACHE_OUT)
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700384 unzip $(TARGET_OUT_APPS)/Calculator.apk classes.dex -d $(TARGET_OUT_DATA)/art-cache
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700385 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 Carlstrombc2f3e32011-09-22 17:16:54 -0700386 adb remount
387 adb sync
Elliott Hughes352a4242011-10-31 15:15:21 -0700388 if [ "`adb shell getprop wrap.com.android.calculator2 | tr -d '\r'`" = "$(OAT_PROCESS)" ]; then \
Brian Carlstrom395520e2011-09-25 19:35:00 -0700389 echo wrap.com.android.calculator2 already set; \
Elliott Hughes6ba581a2011-10-25 11:45:35 -0700390 adb shell start; \
Brian Carlstrom395520e2011-09-25 19:35:00 -0700391 else \
392 echo Setting wrap.com.android.calculator2 and restarting runtime; \
Elliott Hughes352a4242011-10-31 15:15:21 -0700393 adb shell setprop wrap.com.android.calculator2 "$(OAT_PROCESS)"; \
Brian Carlstrom395520e2011-09-25 19:35:00 -0700394 adb shell stop; \
395 adb shell start; \
396 sleep 30; \
397 fi
Brian Carlstromdddab0c2011-09-27 13:35:23 -0700398 adb shell kill `adb shell ps | fgrep com.android.calculator2 | sed -e 's/[^ ]* *\([0-9]*\).*/\1/'`
Elliott Hughes352a4242011-10-31 15:15:21 -0700399 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 Carlstrom47a0d5a2011-10-12 21:20:05 -0700400 $(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 Carlstrombc2f3e32011-09-22 17:16:54 -0700401 $(hide) rm /tmp/test-art-target-process-Calculator
402
403########################################################################
Brian Carlstrom76aa0c02011-10-11 15:29:43 -0700404# zygote targets
405#
Brian Carlstrom0796af02011-10-12 14:31:45 -0700406# zygote-artd will change to use art to boot the device with a debug build
407# zygote-art will change to use art to boot the device with a production build
408# zygote-dalvik will restore to booting with dalvik
409#
410# zygote-artd-target-sync will just push a new artd in place of dvm
411# zygote-art-target-sync will just push a new art in place of dvm
Brian Carlstrom76aa0c02011-10-11 15:29:43 -0700412
Brian Carlstromfab62932011-10-27 21:47:49 -0700413# $(1): "d" for debug build, "" for ndebug build
414define define-zygote-art-targets
415.PHONY: zygote-art$(1)-target-sync
416zygote-art$(1)-target-sync: $(ART_TARGET_DEPENDENCIES) $(TARGET_BOOT_OAT) $(ART_CACHE_OATS)
417 cp $(TARGET_OUT_SHARED_LIBRARIES)/libart$(1).so $(TARGET_OUT_SHARED_LIBRARIES)/libdvm.so
418 cp $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/libart$(1).so $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/libdvm.so
419 cp $(TARGET_OUT_EXECUTABLES)/oatopt$(1) $(TARGET_OUT_EXECUTABLES)/dexopt
420 cp $(TARGET_OUT_EXECUTABLES_UNSTRIPPED)/oatopt$(1) $(TARGET_OUT_EXECUTABLES_UNSTRIPPED)/dexopt
Brian Carlstrom31edec52011-10-16 17:10:24 -0700421 mkdir -p $(TARGET_OUT_DATA)/property
Brian Carlstromd0239922011-11-09 01:28:48 -0800422 echo -n 1 > $(TARGET_OUT_DATA)/property/persist.sys.strictmode.disable
Brian Carlstrom0796af02011-10-12 14:31:45 -0700423 adb remount
424 adb sync
425
Brian Carlstromfab62932011-10-27 21:47:49 -0700426.PHONY: zygote-art$(1)
427zygote-art$(1): zygote-art$(1)-target-sync
Brian Carlstromb7bbba42011-10-13 14:58:47 -0700428 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
429 adb shell rm -f $(ART_CACHE_DIR)
Brian Carlstrom76aa0c02011-10-11 15:29:43 -0700430 rm -f $(ANDROID_PRODUCT_OUT)/boot.img
431 unset ONE_SHOT_MAKEFILE && $(MAKE) showcommands bootimage
432 adb reboot bootloader
433 fastboot flash boot $(ANDROID_PRODUCT_OUT)/boot.img
434 fastboot reboot
Brian Carlstromfab62932011-10-27 21:47:49 -0700435endef
436
437$(eval $(call define-zygote-art-targets,d))
438$(eval $(call define-zygote-art-targets,))
Brian Carlstrom76aa0c02011-10-11 15:29:43 -0700439
Brian Carlstrom0796af02011-10-12 14:31:45 -0700440.PHONY: zygote-dalvik
441zygote-dalvik:
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700442 cp $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libdvm.so $(TARGET_OUT_SHARED_LIBRARIES)/libdvm.so
443 cp $(call intermediates-dir-for,SHARED_LIBRARIES,libdvm)/LINKED/libdvm.so $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/libdvm.so
Brian Carlstromb7bbba42011-10-13 14:58:47 -0700444 cp $(call intermediates-dir-for,EXECUTABLES,dexopt)/dexopt $(TARGET_OUT_EXECUTABLES)/dexopt
445 cp $(call intermediates-dir-for,EXECUTABLES,dexopt)/LINKED/dexopt $(TARGET_OUT_EXECUTABLES_UNSTRIPPED)/dexopt
Brian Carlstromd0239922011-11-09 01:28:48 -0800446 rm -f $(TARGET_OUT_DATA)/property/persist.sys.strictmode.disable
447 adb shell rm /data/property/persist.sys.strictmode.disable
Brian Carlstrom0796af02011-10-12 14:31:45 -0700448 adb remount
449 adb sync
Brian Carlstrom648e5e92011-10-11 22:49:18 -0700450 cp system/core/rootdir/init.rc $(ANDROID_PRODUCT_OUT)/root/init.rc
Brian Carlstrom76aa0c02011-10-11 15:29:43 -0700451 rm -f $(ANDROID_PRODUCT_OUT)/boot.img
452 unset ONE_SHOT_MAKEFILE && $(MAKE) showcommands bootimage
453 adb reboot bootloader
454 fastboot flash boot $(ANDROID_PRODUCT_OUT)/boot.img
455 fastboot reboot
456
457########################################################################
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700458# oatdump targets
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700459
Brian Carlstrom395520e2011-09-25 19:35:00 -0700460.PHONY: dump-oat
Brian Carlstrom03a20ba2011-10-13 10:24:13 -0700461dump-oat: dump-oat-core dump-oat-boot dump-oat-Calculator
Brian Carlstrom395520e2011-09-25 19:35:00 -0700462
Brian Carlstrome10b6972011-09-26 13:49:03 -0700463.PHONY: dump-oat-core
464dump-oat-core: $(TARGET_CORE_OAT) $(OATDUMP)
Brian Carlstrom58ae9412011-10-04 00:56:06 -0700465 $(OATDUMP) --image=$(TARGET_CORE_IMG) --host-prefix=$(PRODUCT_OUT) --output=/tmp/core.oatdump.txt
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700466 @echo Output in /tmp/core.oatdump.txt
467
Brian Carlstrome10b6972011-09-26 13:49:03 -0700468.PHONY: dump-oat-boot
469dump-oat-boot: $(TARGET_BOOT_OAT) $(OATDUMP)
Brian Carlstrom58ae9412011-10-04 00:56:06 -0700470 $(OATDUMP) --image=$(TARGET_BOOT_IMG) --host-prefix=$(PRODUCT_OUT) --output=/tmp/boot.oatdump.txt
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700471 @echo Output in /tmp/boot.oatdump.txt
Brian Carlstrom78128a62011-09-15 17:21:19 -0700472
Brian Carlstrome10b6972011-09-26 13:49:03 -0700473.PHONY: dump-oat-Calculator
Brian Carlstrom03a20ba2011-10-13 10:24:13 -0700474dump-oat-Calculator: $(call art-cache-oat,system/app/Calculator.oat) $(TARGET_BOOT_OAT) $(OATDUMP)
475 $(OATDUMP) --oat=$< --boot-image=$(TARGET_BOOT_IMG) --host-prefix=$(PRODUCT_OUT) --output=/tmp/Calculator.oatdump.txt
Brian Carlstrome10b6972011-09-26 13:49:03 -0700476 @echo Output in /tmp/Calculator.oatdump.txt
477
478
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700479########################################################################
Brian Carlstromfab62932011-10-27 21:47:49 -0700480# clean-oat target
481#
482
483.PHONY: clean-oat
484clean-oat:
485 rm -f $(ART_TEST_OUT)/*.oat
Elliott Hughes55124a52011-12-08 15:52:52 -0800486 rm -f $(ART_TEST_OUT)/*.art
Brian Carlstromfab62932011-10-27 21:47:49 -0700487 rm -f $(ART_CACHE_OUT)/*.oat
Elliott Hughes55124a52011-12-08 15:52:52 -0800488 rm -f $(ART_CACHE_OUT)/*.art
Brian Carlstromfab62932011-10-27 21:47:49 -0700489 adb shell rm $(ART_TEST_DIR)/*.oat
Elliott Hughes55124a52011-12-08 15:52:52 -0800490 adb shell rm $(ART_TEST_DIR)/*.art
Brian Carlstromfab62932011-10-27 21:47:49 -0700491 adb shell rm $(ART_CACHE_DIR)/*.oat
Elliott Hughes55124a52011-12-08 15:52:52 -0800492 adb shell rm $(ART_CACHE_DIR)/*.art
Brian Carlstromfab62932011-10-27 21:47:49 -0700493
494########################################################################
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700495# cpplint target
496
Brian Carlstrom59848da2011-07-23 20:35:19 -0700497# "mm cpplint-art" to style check art source files
498.PHONY: cpplint-art
499cpplint-art:
Elliott Hughesa51a3dd2011-10-17 15:19:26 -0700500 ./art/tools/cpplint.py \
501 --filter=-whitespace/comments,-whitespace/line_length,-build/include,-build/header_guard,-readability/streams,-readability/todo,-runtime/references \
Elliott Hughes362f9bc2011-10-17 18:56:41 -0700502 $(ANDROID_BUILD_TOP)/art/src/*.h $(ANDROID_BUILD_TOP)/art/src/*.cc
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700503
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700504########################################################################
505
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700506include $(call all-makefiles-under,$(LOCAL_PATH))