1 # Copyright (C) 2008 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 # 16 # Makefile for the Dalvik modular interpreter. This is not currently 17 # integrated into the build system. 18 # 19 20 SHELL := /bin/sh 21 22 # Build system has TARGET_ARCH=arm, but we need the exact architecture. 23 # The base assumption for an ARM platform is ARMv5TE, but we may want to 24 # support older ARMv4 devices, or use special features from ARMv6 or VFP. 25 # The simulator build is "desktop". 26 # 27 # To generate sources for all targets: 28 # for arch in desktop armv5te; do TARGET_ARCH_EXT=$arch make -f Makefile-mterp; done 29 # 30 #TARGET_ARCH_EXT := armv5te 31 32 OUTPUT_DIR := out 33 34 # Accumulate all possible dependencies for the generated files in a very 35 # conservative fashion. If it's not one of the generated files in "out", 36 # assume it's a dependency. 37 SOURCE_DEPS := \ 38 $(shell find . -path ./$(OUTPUT_DIR) -prune -o -type f -print) \ 39 ../Android.mk ../../Android.mk 40 41 # Source files generated by the script. There's always one C and one 42 # assembly file, though in practice one or the other could be empty. 43 GEN_SOURCES := \ 44 $(OUTPUT_DIR)/InterpC-$(TARGET_ARCH_EXT).c \ 45 $(OUTPUT_DIR)/InterpAsm-$(TARGET_ARCH_EXT).S 46 47 target: $(GEN_SOURCES) 48 49 $(GEN_SOURCES): $(SOURCE_DEPS) 50 @mkdir -p out 51 ./gen-mterp.py $(TARGET_ARCH_EXT) $(OUTPUT_DIR) 52