aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile24
1 files changed, 22 insertions, 2 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 3cd1635ea..bf74b8ed1 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 The Android Open Source Project
+# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,5 +14,25 @@
#
# DO NOT MODIFY THIS FILE
-include build/core/main.mk
+
+# Check that we have at least GNU Make 3.81
+# We do this by detecting whether 'lastword' is supported
+#
+MAKE_TEST := $(lastword a b c d e f)
+ifneq ($(MAKE_TEST),f)
+ $(error,The Android NDK requires GNU Make 3.81 or higher to run !)
+endif
+
+# Find the NDK root installation path, should be this file's location.
+NDK_ROOT := $(dir $(lastword $(MAKEFILE_LIST)))
+NDK_ROOT := $(NDK_ROOT:%/=%)
+
+# Complain if the path contains spaces
+ifneq ($(words $(NDK_ROOT)),1)
+ $(info,The Android NDK installation path contains spaces: '$(NDK_ROOT)')
+ $(error,Please fix the problem by reinstalling to a different location.)
+endif
+
+include $(NDK_ROOT)/build/core/main.mk
+
# END OF FILE