URL:
<http://savannah.gnu.org/bugs/?50062>
Summary: Variable needed to check that Makefile is run by GNU
make?
Project: make
Submitted by: None
Submitted on: Tue 17 Jan 2017 06:59:36 AM UTC
Severity: 3 - Normal
Item Group: Documentation
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: None
Operating System: Any
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
When one wants to check that it is really GNU make that is run for a given
Makefile, the standard solution is to
rely on $(shell make --version), or to read $(MAKE_VERSION). See e.g.
http://unix.stackexchange.com/questions/218692
The second solution is simpler and more efficient but nothing prevents other,
non-GNU, make's to support a variable called MAKE_VERSION.
A solution would be to have another variable, e.g. $(GNUMAKE_VERSION), that
could be just a synonym for $(MAKE_VERSION), but that would probably never be
used by other make's.
Then one would not even read it, just check that it is defined:
ifndef GNUMAKE_VERSION
$(error "Sorry, you are not running GNU make. I must stop...)
endif
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50062>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-make