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