The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 16 | # disable implicit rules |
| 17 | .SUFFIXES: |
| 18 | %:: %,v |
| 19 | %:: RCS/% |
| 20 | %:: RCS/%,v |
| 21 | %:: s.% |
| 22 | %:: SCCS/s.% |
| 23 | %.c: %.w %.ch |
| 24 | |
| 25 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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 |
Stefan Hilzinger | fb16987 | 2011-02-22 12:00:40 +0000 | [diff] [blame] | 32 | LIBS_DIR := $(OBJS_DIR)/libs |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 33 | CONFIG_MAKE := $(OBJS_DIR)/config.make |
| 34 | CONFIG_H := $(OBJS_DIR)/config-host.h |
| 35 | |
| 36 | ifeq ($(wildcard $(CONFIG_MAKE)),) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 37 | $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "android-configure.sh" script) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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 | |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 60 | ifneq ($(SDL_CONFIG),) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 61 | SDL_LIBS := $(filter %.a,$(shell $(SDL_CONFIG) --static-libs)) |
| 62 | $(foreach lib,$(SDL_LIBS), \ |
| 63 | $(eval $(call copy-prebuilt-lib,$(lib))) \ |
| 64 | ) |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 65 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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)) |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 85 | -include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d)) |