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
30BUILD_SYSTEM := android/build
31OBJS_DIR     := objs
32LIBS_DIR     := $(OBJS_DIR)/libs
33CONFIG_MAKE  := $(OBJS_DIR)/config.make
34CONFIG_H     := $(OBJS_DIR)/config-host.h
35
36ifeq ($(wildcard $(CONFIG_MAKE)),)
37    $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "android-configure.sh" script)
38endif
39
40include $(CONFIG_MAKE)
41include $(BUILD_SYSTEM)/definitions.make
42
43VPATH := $(OBJS_DIR)
44VPATH += :$(SRC_PATH)/android/config
45VPATH += :$(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
50CLEAR_VARS                := $(BUILD_SYSTEM)/clear_vars.make
51BUILD_HOST_EXECUTABLE     := $(BUILD_SYSTEM)/host_executable.make
52BUILD_HOST_STATIC_LIBRARY := $(BUILD_SYSTEM)/host_static_library.make
53
54DEPENDENCY_DIRS :=
55
56all: libraries executables
57EXECUTABLES :=
58LIBRARIES   :=
59
60ifneq ($(SDL_CONFIG),)
61SDL_LIBS   := $(filter %.a,$(shell $(SDL_CONFIG) --static-libs))
62$(foreach lib,$(SDL_LIBS), \
63    $(eval $(call copy-prebuilt-lib,$(lib))) \
64)
65endif
66
67clean: clean-intermediates
68
69distclean: clean clean-config
70
71# let's roll
72include Makefile.android
73
74libraries: $(LIBRARIES)
75executables: $(EXECUTABLES)
76
77clean-intermediates:
78	rm -rf $(OBJS_DIR)/intermediates $(EXECUTABLES) $(LIBRARIES)
79
80clean-config:
81	rm -f $(CONFIG_MAKE) $(CONFIG_H)
82
83# include dependency information
84DEPENDENCY_DIRS := $(sort $(DEPENDENCY_DIRS))
85-include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d))
86