summaryrefslogtreecommitdiff
path: root/cross
diff options
context:
space:
mode:
Diffstat (limited to 'cross')
-rw-r--r--cross/ndk-build/ndk-build.mk.in19
1 files changed, 13 insertions, 6 deletions
diff --git a/cross/ndk-build/ndk-build.mk.in b/cross/ndk-build/ndk-build.mk.in
index 5b0aa82856d..57006901721 100644
--- a/cross/ndk-build/ndk-build.mk.in
+++ b/cross/ndk-build/ndk-build.mk.in
@@ -17,7 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
-# This file is included all over the place to build prerequisites.
+# This file is included all over the place to get and build
+# prerequisites.
NDK_BUILD_MODULES = @NDK_BUILD_MODULES@
NDK_BUILD_CXX_SHARED = @NDK_BUILD_CXX_SHARED@
@@ -33,6 +34,10 @@ endef
# imports a module and also declares it in LOCAL_SHARED_LIBRARIES.
NDK_BUILD_MODULES := $(call uniqify,$(NDK_BUILD_MODULES))
+# Here are all of the files to build.
+NDK_BUILD_ALL_FILES := $(foreach file,$(NDK_BUILD_MODULES), \
+ $(top_builddir)/cross/ndk-build/$(file))
+
# The C++ standard library must be extracted from the Android NDK
# directories and included in the application package, if any module
# requires the C++ standard library.
@@ -42,10 +47,6 @@ NDK_BUILD_SHARED += $(NDK_BUILD_CXX_SHARED)
endif
define subr-1
-
-$(top_builddir)/cross/ndk-build/$(1):
- $(MAKE) -C $(top_builddir)/cross/ndk-build $(1)
-
ifeq ($(suffix $(1)),.so)
NDK_BUILD_SHARED += $(top_builddir)/cross/ndk-build/$(1)
else
@@ -53,9 +54,15 @@ ifeq ($(suffix $(1)),.a)
NDK_BUILD_STATIC += $(top_builddir)/cross/ndk-build/$(1)
endif
endif
-
endef
# Generate rules for each module.
$(foreach module,$(NDK_BUILD_MODULES),$(eval $(call subr-1,$(module))))
+
+# Generate rules to build everything now.
+# Make sure to use the top_builddir currently defined.
+
+NDK_TOP_BUILDDIR := $(top_builddir)
+$(NDK_BUILD_ALL_FILES) &:
+ $(MAKE) -C $(NDK_TOP_BUILDDIR)/cross/ndk-build $(NDK_BUILD_MODULES)