This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 2.95.2
On Thu, Nov 30, 2000 at 10:27:10PM +0100, Erik Mouw wrote:
> On Thu, Nov 30, 2000 at 02:54:11PM +0100, c958179@student.dtu.dk wrote:
> > Why can't I use GCC 2.95.2 for a makefile with folloving condition:
> > I mean it exit.
> >
> > target-dir:
> > @if ( $(MAKE) -version 2>/dev/null | grep GNU > /dev/null ) ; then
> > \
> > echo Gnumake. Excellent ; \
> > else \
> > echo This does not appear to be gnumake. ; \
> > exit 1 ; \
> >
> >
> >
> > Why is gcc-2.95.2 not fulfilling the condition?
>
> Because this has nothing to do with gcc. The makefile is complaining
> about the fact that the "make" utility is not GNU make. Get GNU make
> from ftp://ftp.gnu.org/gnu/make/ .
Also worth pointing out that you're missing a "fi" at the end of the
commands, which will make it barf no matter which version of make you have.
A better test for gnumake is: [cribbed from GNU libc's Makerules]
ifneq(,)
This makefile requires GNU Make.
endif
REQUIRED_MAKE_VERSION = 3.74 # Or whatever
REAL_MAKE_VERSION = $(firstword $(MAKE_VERSION))
ifneq ($(REQUIRED_MAKE_VERSION), \
$(firstword $(sort $(REAL_MAKE_VERSION) $(REQUIRED_MAKE_VERSION))))
Wrong GNU Make version. See above for the version needed.
endif
Or just name the makefile "GNUmakefile" and be done with it.
zw