[Top][All Lists]

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

Re: Sorry nevermind last email,

From: Paul D. Smith
Subject: Re: Sorry nevermind last email,
Date: Thu, 8 Jun 2006 15:30:56 -0400

%% "Tobias Contreras" <address@hidden> writes:

  tc> Sorry nevermind last email, 

  tc> Nmake's scope is very open while gnumake you need to order the
  tc> assignment of the definitions. I just needed to move the define
  tc> statement above the assignment of defines into ccflags32.

GNU make has two kinds of variable assignments.

The kind you used was simple assignment, with ":=":

    FOO := $(BAR)

In simple assignment the RHS of the assignment is expanded immediately
and the results stored in the variable FOO.  That value is then NOT
re-expanded later when it is used.  So, whatever value BAR had when the
statement was read in from the makefile is what will be put into FOO.

The other, more traditional make assignment is recursive assignment,
using a normal "=":

    FOO = $(BAR)

In this version, FOO has a value of the string "$(BAR)", and every time
FOO is expanded it recursively causes BAR to be expanded.  So, the
result will be whatever value BAR has when FOO is _expanded_, not when
FOO is _assigned_.

It sounds like you were expecting the second kind of assignment, but you
had the first kind (":=") in your makefile.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]