blob: d22540904f7370dc23d112f23134af1728e9e5c3 [file] [log] [blame]
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -08001# 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' Turneraff94b82011-02-07 18:10:54 +010016# 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 Project8b23a6c2009-03-03 19:30:32 -080026# 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
Stefan Hilzingerfb169872011-02-22 12:00:40 +000032LIBS_DIR := $(OBJS_DIR)/libs
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080033CONFIG_MAKE := $(OBJS_DIR)/config.make
34CONFIG_H := $(OBJS_DIR)/config-host.h
35
36ifeq ($(wildcard $(CONFIG_MAKE)),)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010037 $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "android-configure.sh" script)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080038endif
39
40include $(CONFIG_MAKE)
41include $(BUILD_SYSTEM)/definitions.make
42
43VPATH := $(OBJS_DIR)
44VPATH += :$(SRC_PATH)/android/config
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080045
46.PHONY: all libraries executables clean clean-config clean-objs-dir \
47 clean-executables clean-libraries
48
49CLEAR_VARS := $(BUILD_SYSTEM)/clear_vars.make
50BUILD_HOST_EXECUTABLE := $(BUILD_SYSTEM)/host_executable.make
51BUILD_HOST_STATIC_LIBRARY := $(BUILD_SYSTEM)/host_static_library.make
David 'Digit' Turneraf061c52014-02-28 23:33:54 +010052BUILD_HOST_SHARED_LIBRARY := $(BUILD_SYSTEM)/host_shared_library.make
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080053
54DEPENDENCY_DIRS :=
55
56all: libraries executables
57EXECUTABLES :=
58LIBRARIES :=
59
David 'Digit' Turner34d16512010-05-18 17:02:33 -070060ifneq ($(SDL_CONFIG),)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080061SDL_LIBS := $(filter %.a,$(shell $(SDL_CONFIG) --static-libs))
62$(foreach lib,$(SDL_LIBS), \
63 $(eval $(call copy-prebuilt-lib,$(lib))) \
64)
David 'Digit' Turner34d16512010-05-18 17:02:33 -070065endif
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080066
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))
David 'Digit' Turner34d16512010-05-18 17:02:33 -070085-include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d))