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 # 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 BUILD_SYSTEM := android/build 21 OBJS_DIR := objs 22 CONFIG_MAKE := $(OBJS_DIR)/config.make 23 CONFIG_H := $(OBJS_DIR)/config-host.h 24 25 ifeq ($(wildcard $(CONFIG_MAKE)),) 26 $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "rebuilt.sh" script) 27 endif 28 29 include $(CONFIG_MAKE) 30 include $(BUILD_SYSTEM)/definitions.make 31 32 VPATH := $(OBJS_DIR) 33 VPATH += :$(SRC_PATH)/android/config 34 VPATH += :$(SRC_PATH):$(SRC_PATH)/target-$(TARGET_ARCH) 35 36 .PHONY: all libraries executables clean clean-config clean-objs-dir \ 37 clean-executables clean-libraries 38 39 CLEAR_VARS := $(BUILD_SYSTEM)/clear_vars.make 40 BUILD_HOST_EXECUTABLE := $(BUILD_SYSTEM)/host_executable.make 41 BUILD_HOST_STATIC_LIBRARY := $(BUILD_SYSTEM)/host_static_library.make 42 43 DEPENDENCY_DIRS := 44 45 all: libraries executables 46 EXECUTABLES := 47 LIBRARIES := 48 49 SDL_CONFIG ?= $(PREBUILT)/sdl/bin/sdl-config 50 SDL_LIBS := $(filter %.a,$(shell $(SDL_CONFIG) --static-libs)) 51 $(foreach lib,$(SDL_LIBS), \ 52 $(eval $(call copy-prebuilt-lib,$(lib))) \ 53 ) 54 55 clean: clean-intermediates 56 57 distclean: clean clean-config 58 59 # let's roll 60 include Makefile.android 61 62 libraries: $(LIBRARIES) 63 executables: $(EXECUTABLES) 64 65 clean-intermediates: 66 rm -rf $(OBJS_DIR)/intermediates $(EXECUTABLES) $(LIBRARIES) 67 68 clean-config: 69 rm -f $(CONFIG_MAKE) $(CONFIG_H) 70 71 # include dependency information 72 DEPENDENCY_DIRS := $(sort $(DEPENDENCY_DIRS)) 73 -include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d))