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 cc35241a6e)
This commit is contained in:
Mahmoud Al-Qudsi 2017-09-24 15:00:50 -05:00
parent 92a6906e6a
commit 19b89983a1

View File

@ -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