The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 1 | # Copyright (C) 2006 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 | LOCAL_PATH := $(call my-dir) |
| 16 | |
| 17 | subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \ |
| 18 | libdex \ |
| 19 | vm \ |
Piotr Gurgul | adcf37c | 2010-09-02 19:15:30 -0700 | [diff] [blame] | 20 | dexgen \ |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 21 | dexlist \ |
| 22 | dexopt \ |
| 23 | dexdump \ |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 24 | dx \ |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 25 | tools \ |
Elliott Hughes | 98c3592 | 2010-12-01 16:59:21 -0800 | [diff] [blame] | 26 | unit-tests \ |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 27 | )) |
| 28 | |
| 29 | include $(subdirs) |
| 30 | |
| 31 | |
| 32 | .PHONY: dex dex-debug |
| 33 | ifeq ($(DONT_INSTALL_DEX_FILES),true) |
| 34 | dex: |
| 35 | @echo "Forcing a remake with DONT_INSTALL_DEX_FILES=false" |
| 36 | $(hide) $(MAKE) DONT_INSTALL_DEX_FILES=false |
| 37 | else |
| 38 | # DONT_INSTALL_DEX_FILES is already false, so a normal make takes care of it. |
| 39 | dex: $(DEFAULT_GOAL) |
| 40 | endif |
| 41 | |
| 42 | d := |
| 43 | ifneq ($(GENERATE_DEX_DEBUG),) |
| 44 | d := debug |
| 45 | endif |
| 46 | ifneq ($(DONT_INSTALL_DEX_FILES),true) |
| 47 | d := $(d)-install |
| 48 | endif |
| 49 | ifneq ($(d),debug-install) |
| 50 | # generate the debug .dex files, with a copy in ./dalvik/DEBUG-FILES. |
| 51 | # We need to rebuild the .dex files for the debug output to be generated. |
| 52 | # The "touch -c $(DX)" is a hack that we know will force |
| 53 | # a rebuild of the .dex files. If $(DX) doesn't exist yet, |
| 54 | # we won't touch it (-c) and the normal build will create |
| 55 | # the .dex files naturally. |
| 56 | dex-debug: |
| 57 | @echo "Forcing an app rebuild with GENERATE_DEX_DEBUG=true" |
| 58 | @touch -c $(DX) |
| 59 | $(hide) $(MAKE) DONT_INSTALL_DEX_FILES=false GENERATE_DEX_DEBUG=true |
| 60 | else |
| 61 | # GENERATE_DEX_DEBUG and DONT_INSTALL_DEX_FILES are already set properly, |
| 62 | # so a normal make takes care of it. |
| 63 | dex-debug: $(DEFAULT_GOAL) |
| 64 | endif |