1################################################################################
2#
3# mm
4#
5################################################################################
6
7LINUX_TOOLS += mm
8
9define MM_BUILD_CMDS
10	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
11		MM_SUBDIR=vm; \
12	elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \
13		MM_SUBDIR=mm; \
14	else \
15		echo "Your kernel version is too old and does not have the mm tool." ; \
16		echo "At least kernel 3.4 must be used." ; \
17		exit 1 ; \
18	fi ; \
19	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR)/tools \
20		$(MM_MAKE_OPTS) $${MM_SUBDIR}
21endef
22
23# For install no need to recheck both cases: we know at least one
24# exists, because that was checked at build time already; we just
25# need to find which of the two: if not one, then the other.
26define MM_INSTALL_TARGET_CMDS
27	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
28		MM_SUBDIR=vm; \
29	else \
30		MM_SUBDIR=mm; \
31	fi ; \
32	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
33		$(LINUX_MAKE_FLAGS) \
34		INSTALL_ROOT=$(TARGET_DIR) \
35		DESTDIR=$(TARGET_DIR) \
36		$${MM_SUBDIR}_install
37endef
38