bug-bash
[Top][All Lists]
Advanced

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

Re: How to call a new bash function within a makefile


From: OnMyWayHome
Subject: Re: How to call a new bash function within a makefile
Date: Tue, 15 Nov 2005 00:29:57 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915

Thanks for the post Paul. I may be remembering it incorrectly,
but your post does help me.
Thanks,
Chris

Paul D. Smith wrote:
%% OnMyWayHome <blank@blank.org> writes:

  o> I don't have gnu.bash on my newsgroup server, so I'm posting this here.
  o> Here is an example GNU makefile:

  o> function DoThis()
  o> {
  o>      echo $0
  o> }

  o> all :
  o>      DoThis "Test"

  o> I've seen this done before where a bash function is defined within a
  o> makefile, and can be subsequently called when a target is matched.

You must have been imagining things :-)

This is not, and never has been supported.  At least, not in GNU make.
Makefiles must contain make syntax.  They cannot contain shell
functions.


I mean, I guess you could do something like this:

    defineDoThis = function DoThis() { echo $0; }

    all:
            $(defineDoThis); DoThis "Test"

but I doubt that's what you're looking for.





reply via email to

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