help-make
[Top][All Lists]
Advanced

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

makefile parsing and variable expansion


From: Ian Lynagh
Subject: makefile parsing and variable expansion
Date: Wed, 30 Sep 2009 21:47:19 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi all,

I am trying to understand how makefiles are parsed, e.g. why this
makefile:

# -----------
default:
        echo hello

define foo
q:
        echo this is q1
        echo this is q2
endef

$(foo)
# -----------

ends up containing this (according to "make -pr"):

# -----------
q: echo this is q1
 echo this is q2
# -----------

Is there anything other than the source that I can read to understand
this?


I am also confused as to why the above Makefile is accepted, while:

# -----------
default:
        echo hello

q: echo this is q1
 echo this is q2
# -----------

is rejected.


Thanks
Ian





reply via email to

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