< prev index next >
./Makefile
Print this page
@@ -1,7 +1,7 @@
#
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
@@ -26,13 +26,27 @@
###
### This file is just a very small wrapper needed to run the real make/Init.gmk.
### It also performs some sanity checks on make.
###
-# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU Make.
+# This code will cause FreeBSD make to print an error message and abort,
+# but GNU Make will treat it as a variable assignment
+.error ===You are not using GNU Make/gmake, this is a requirement. Check your path.===
+
+# The shell code below will be executed on /usr/ccs/bin/make on Solaris and
+# by OpenBSD make, but not in GNU Make.
# /usr/ccs/bin/make lacks basically every other flow control mechanism.
-.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU Make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
+.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU Make/gmake, this is a requirement. Check your path. 1>&2
+
+# This will make the rest of the file part of a conditional block on BSD make,
+# but GNU Make will treat it as an assignment.
+.if =GNU_ONLY
+
+# This will cause /usr/ccs/bin/make on Solaris to exit.
+.TEST_FOR_NON_GNUMAKE:sh=exit 1
+
+### Now we can be reasonably sure we're actually running GNU Make.
# The .FEATURES variable is likely to be unique for GNU Make.
ifeq ($(.FEATURES), )
$(info Error: '$(MAKE)' does not seem to be GNU Make, which is a requirement.)
$(info Check your path, or upgrade to GNU Make 3.81 or newer.)
@@ -60,5 +74,7 @@
endif
topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
# ... and then we can include the real makefile
include $(topdir)/make/Init.gmk
+
+.endif =GNU_ONLY
< prev index next >