16e21232cSEd Heyl# Copyright (C) 2006 The Android Open Source Project
26e21232cSEd Heyl#
36e21232cSEd Heyl# Licensed under the Apache License, Version 2.0 (the "License");
46e21232cSEd Heyl# you may not use this file except in compliance with the License.
56e21232cSEd Heyl# You may obtain a copy of the License at
66e21232cSEd Heyl#
76e21232cSEd Heyl#      http://www.apache.org/licenses/LICENSE-2.0
86e21232cSEd Heyl#
96e21232cSEd Heyl# Unless required by applicable law or agreed to in writing, software
106e21232cSEd Heyl# distributed under the License is distributed on an "AS IS" BASIS,
116e21232cSEd Heyl# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126e21232cSEd Heyl# See the License for the specific language governing permissions and
136e21232cSEd Heyl# limitations under the License.
146e21232cSEd Heyl
156e21232cSEd HeylLOCAL_PATH := $(call my-dir)
166e21232cSEd Heyl
176e21232cSEd Heylsubdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
186e21232cSEd Heyl		libdex \
196e21232cSEd Heyl		vm \
206e21232cSEd Heyl		dexgen \
216e21232cSEd Heyl		dexlist \
226e21232cSEd Heyl		dexopt \
236e21232cSEd Heyl		dexdump \
246e21232cSEd Heyl		dx \
256e21232cSEd Heyl		tools \
266e21232cSEd Heyl		unit-tests \
276e21232cSEd Heyl	))
286e21232cSEd Heyl
296e21232cSEd Heylinclude $(subdirs)
306e21232cSEd Heyl
316e21232cSEd Heyl
326e21232cSEd Heyl.PHONY: dex dex-debug
336e21232cSEd Heylifeq ($(DONT_INSTALL_DEX_FILES),true)
346e21232cSEd Heyldex:
356e21232cSEd Heyl	@echo "Forcing a remake with DONT_INSTALL_DEX_FILES=false"
366e21232cSEd Heyl	$(hide) $(MAKE) DONT_INSTALL_DEX_FILES=false
376e21232cSEd Heylelse
386e21232cSEd Heyl# DONT_INSTALL_DEX_FILES is already false, so a normal make takes care of it.
396e21232cSEd Heyldex: $(DEFAULT_GOAL)
406e21232cSEd Heylendif
416e21232cSEd Heyl
426e21232cSEd Heyld :=
436e21232cSEd Heylifneq ($(GENERATE_DEX_DEBUG),)
446e21232cSEd Heyld := debug
456e21232cSEd Heylendif
466e21232cSEd Heylifneq ($(DONT_INSTALL_DEX_FILES),true)
476e21232cSEd Heyld := $(d)-install
486e21232cSEd Heylendif
496e21232cSEd Heylifneq ($(d),debug-install)
506e21232cSEd Heyl# generate the debug .dex files, with a copy in ./dalvik/DEBUG-FILES.
516e21232cSEd Heyl# We need to rebuild the .dex files for the debug output to be generated.
526e21232cSEd Heyl# The "touch -c $(DX)" is a hack that we know will force
536e21232cSEd Heyl# a rebuild of the .dex files.  If $(DX) doesn't exist yet,
546e21232cSEd Heyl# we won't touch it (-c) and the normal build will create
556e21232cSEd Heyl# the .dex files naturally.
566e21232cSEd Heyldex-debug:
576e21232cSEd Heyl	@echo "Forcing an app rebuild with GENERATE_DEX_DEBUG=true"
586e21232cSEd Heyl	@touch -c $(DX)
596e21232cSEd Heyl	$(hide) $(MAKE) DONT_INSTALL_DEX_FILES=false GENERATE_DEX_DEBUG=true
606e21232cSEd Heylelse
616e21232cSEd Heyl# GENERATE_DEX_DEBUG and DONT_INSTALL_DEX_FILES are already set properly,
626e21232cSEd Heyl# so a normal make takes care of it.
636e21232cSEd Heyldex-debug: $(DEFAULT_GOAL)
646e21232cSEd Heylendif