--- old/./Makefile 2016-01-20 11:43:35.209321048 +0100 +++ new/./Makefile 2016-01-20 11:43:35.033321039 +0100 @@ -1,5 +1,5 @@ # -# 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 @@ -28,9 +28,23 @@ ### 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), ) @@ -62,3 +76,5 @@ # ... and then we can include the real makefile include $(topdir)/make/Init.gmk + +.endif =GNU_ONLY