From 19b89983a1298c97368ac48e117803d1a2388d23 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 24 Sep 2017 15:00:50 -0500 Subject: [PATCH] Automatically pass build through to gmake on BSD Smarter BSDmakefile that automatically calls gmake to build the targets, even including `-j` if provided. README.md can be simplified to remove `gmake` references from build instructions for BSD users. (cherry picked from commit cc35241a6ec7091beffb0fd570e1fe9c0d2d2f51) --- BSDmakefile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/BSDmakefile b/BSDmakefile index 591052dc8..c85ec00fc 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -1,9 +1,17 @@ -warn: - @echo "Error: BSD Make not supported" - @echo "Please use GNU Make (gmake) to build fish. Refer to README.md for detailed build instructions." +JARG = +GMAKE = "gmake" +.if "$(.MAKE.JOBS)" != "" +JARG = -j$(.MAKE.JOBS) +.endif -all: warn -install: warn -test: warn +#by default bmake will cd into ./obj first +.OBJDIR: ./ + +.DONE .DEFAULT: .SILENT + $(GMAKE) $(.TARGETS:S,.DONE,,) $(JARG) + +.ERROR: .SILENT + if ! which $(GMAKE) > /dev/null; then \ + echo "GNU Make is required!"; \ + fi -.PHONY: warn all install test