help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error commands commence before first target...


From: Paul D. Smith
Subject: Re: error commands commence before first target...
Date: Tue, 10 Oct 2006 14:09:54 -0400

%% "zuheyr alsalihi" <address@hidden> writes:

> My concern is to give some information to the user.
> I was trying to chose among some compilers and tell
> the user what is (s)he using.
>
> The echo command is really mysterious to me in that
> I have so many of them working so well in similar places,
> and hop, some breaks...

Please remember to include the help-make mailing list on CC line so
everyone can see the discussion.

Basically, you seem to be confused as to what exactly a makefile is
(and is not).  A makefile is not a shell script.  You can't just write
shell commands (programs to be invoked) into a makefile anywhere you
want.  Make does not read your makefile and "execute" the commands it
finds as it reads them, like the shell does.

You should read the user's manual for GNU make; you can find a copy in
various formats, including online, here:

    http://www.gnu.org/software/make/manual/

Or you can purchase a copy from your favourite technology bookstore
(hopefully), or Amazon or whatever ships to your area.


If you want make to print a message to the user as it reads in the
makefile, you can use the $(warning ...) or, if you have at least make
version 3.81, the $(info ...) functions.  See the section on make
functions in the manual.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]