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 # disable implicit rules 17 .SUFFIXES: 18 %:: %,v 19 %:: RCS/% 20 %:: RCS/%,v 21 %:: s.% 22 %:: SCCS/s.% 23 %.c: %.w %.ch 24 25 26 # this is a set of definitions that allow the usage of Makefile.android 27 # even if we're not using the Android build system. 28 # 29 30 BUILD_SYSTEM := android/build 31 OBJS_DIR := objs 32 LIBS_DIR := $(OBJS_DIR)/libs 33 CONFIG_MAKE := $(OBJS_DIR)/config.make 34 CONFIG_H := $(OBJS_DIR)/config-host.h 35 36 ifeq ($(wildcard $(CONFIG_MAKE)),) 37 $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "android-configure.sh" script) 38 endif 39 40 include $(CONFIG_MAKE) 41 include $(BUILD_SYSTEM)/definitions.make 42 43 VPATH := $(OBJS_DIR) 44 VPATH += :$(SRC_PATH)/android/config 45 VPATH += :$(SRC_PATH):$(SRC_PATH)/target-$(TARGET_ARCH) 46 47 .PHONY: all libraries executables clean clean-config clean-objs-dir \ 48 clean-executables clean-libraries 49 50 CLEAR_VARS := $(BUILD_SYSTEM)/clear_vars.make 51 BUILD_HOST_EXECUTABLE := $(BUILD_SYSTEM)/host_executable.make 52 BUILD_HOST_STATIC_LIBRARY := $(BUILD_SYSTEM)/host_static_library.make 53 54 DEPENDENCY_DIRS := 55 56 all: libraries executables 57 EXECUTABLES := 58 LIBRARIES := 59 60 ifneq ($(SDL_CONFIG),) 61 SDL_LIBS := $(filter %.a,$(shell $(SDL_CONFIG) --static-libs)) 62 $(foreach lib,$(SDL_LIBS), \ 63 $(eval $(call copy-prebuilt-lib,$(lib))) \ 64 ) 65 endif 66 67 clean: clean-intermediates 68 69 distclean: clean clean-config 70 71 # let's roll 72 include Makefile.android 73 74 libraries: $(LIBRARIES) 75 executables: $(EXECUTABLES) 76 77 clean-intermediates: 78 rm -rf $(OBJS_DIR)/intermediates $(EXECUTABLES) $(LIBRARIES) 79 80 clean-config: 81 rm -f $(CONFIG_MAKE) $(CONFIG_H) 82 83 # include dependency information 84 DEPENDENCY_DIRS := $(sort $(DEPENDENCY_DIRS)) 85 -include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d)) 86