From 3e5d4f4ee8461e7746dd908fe544c965249f6003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 5 Mar 2018 14:15:55 -0500 Subject: [PATCH] Makefile: use $(MAKE) variable For some systems (i.e. FreeBSD) the default 'make' is not compatible with the GNU extensions used by QEMU makefiles. Calling the GNU make (gmake) works, however the help displayed refers to the host 'make' and copy/paste leads to lot of unobvious errors: $ gmake check-help [...] make check Run all tests $ make check make: "Makefile" line 28: Missing dependency operator make: "Makefile" line 37: Need an operator make: "Makefile" line 41: warning: duplicate script for target "git-submodule-update" ignored make: "rules.mak" line 70: warning: duplicate script for target "%.o" ignored make: Unknown modifier ' ' make: Unclosed substitution for eval modules (= missing) make: "tests/Makefile.include" line 24: Variable/Value missing from "export" make: "tests/" line 1: warning: Zero byte read from file, skipping rest of line. make: "tests/" line 1: Need an operator make: "Makefile" line 660: warning: duplicate script for target "ifneq" ignored make: "Makefile" line 78: warning: using previous script for "ifneq" defined here make: Fatal errors encountered -- cannot continue Using the $(MAKE) variable, the help displayed is consistent with the 'make' program used. Backports commit b98a3bae2596fd9bf60f140d042c8e993daba930 from qemu --- qemu/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/Makefile b/qemu/Makefile index 70c03976..fcb96fde 100644 --- a/qemu/Makefile +++ b/qemu/Makefile @@ -15,7 +15,7 @@ ifneq ($(realpath $(SRC_PATH)),$(realpath .)) ifneq ($(wildcard $(SRC_PATH)/config-host.mak),) $(error This is an out of tree build but your source tree ($(SRC_PATH)) \ seems to have been used for an in-tree build. You can fix this by running \ -"make distclean && rm -rf *-linux-user *-softmmu" in your source tree) +"$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree) endif endif @@ -87,7 +87,7 @@ endif else \ echo "WARNING: $@ out of date.";\ fi; \ - echo "Run \"make defconfig\" to regenerate."; \ + echo "Run \"$(MAKE) defconfig\" to regenerate."; \ rm $@.tmp; \ fi; \ else \