1 # Copyright (C) 2012 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 # this is a set of definitions that allow the usage of Makefile.android 17 # even if we're not using the Android build system. 18 # 19 20 OBJS_DIR := objs 21 CONFIG_MAKE := $(OBJS_DIR)/config.make 22 CONFIG_H := $(OBJS_DIR)/config-host.h 23 24 ifeq ($(wildcard $(CONFIG_MAKE)),) 25 $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "android-configure.sh" script) 26 endif 27 28 include $(CONFIG_MAKE) 29 30 ifeq ($(strip $(BUILD_SYSTEM)),) 31 $(error "The BUILD_SYSTEM variable was not defined by your configuration sub-makefile. Aborting") 32 endif 33 34 include $(BUILD_SYSTEM)/definitions.make 35 36 VPATH := $(OBJS_DIR) 37 VPATH += :$(SRC_PATH)/include 38 VPATH += :$(SRC_PATH) 39 40 .PHONY: all libraries executables clean clean-config clean-objs-dir \ 41 clean-executables clean-libraries 42 43 CLEAR_VARS := $(BUILD_SYSTEM)/clear_vars.make 44 BUILD_HOST_EXECUTABLE := $(BUILD_SYSTEM)/host_executable.make 45 BUILD_HOST_STATIC_LIBRARY := $(BUILD_SYSTEM)/host_static_library.make 46 47 DEPENDENCY_DIRS := 48 49 all: libraries executables 50 EXECUTABLES := 51 LIBRARIES := 52 53 clean: clean-intermediates 54 55 distclean: clean clean-config 56 57 # let's roll 58 include Makefile.android 59 60 libraries: $(LIBRARIES) 61 executables: $(EXECUTABLES) 62 63 clean-intermediates: 64 rm -rf $(OBJS_DIR)/intermediates $(EXECUTABLES) $(LIBRARIES) 65 66 clean-config: 67 rm -f $(CONFIG_MAKE) $(CONFIG_H) 68 69 # include dependency information 70 DEPENDENCY_DIRS := $(sort $(DEPENDENCY_DIRS)) 71 -include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d)) 72