OT: How to call a bash function within a makefile

Discussion in 'C++' started by OnMyWayHome, Nov 12, 2005.

  1. OnMyWayHome

    OnMyWayHome Guest

    Sorry to post off-topic but I searched for usenet groups for bash and
    makefiles and I can't find a closer newsgroup. I also searched the
    internet using a variety of search strings and I can't find anything.
    If anyone has a recommendation, please let me know and I will post there.

    Here is an example GNU makefile:

    function DoThis()
    {
    echo $0
    }

    all :
    DoThis "Test"


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

    However, when I run 'make' I get the following error:

    makefile:3: *** missing separator. Stop.

    Line 3 corresponds to "function DoThis()".

    Does anyone know how to embed a bash function inside a GNU makefile?

    Any help appreciated,
    Chris
     
    OnMyWayHome, Nov 12, 2005
    #1
    1. Advertising

  2. Re: How to call a bash function within a makefile

    OnMyWayHome wrote:
    > Sorry to post off-topic but I searched for usenet groups for bash and
    > makefiles and I can't find a closer newsgroup.


    gnu.bash
    gnu.utils
    gnu.utils.help

    > I also searched the
    > internet using a variety of search strings and I can't find anything.


    Have you tried "GNU make manual"? Try it. You will get
    http://www.gnu.org/software/make/manual/make.html

    > If anyone has a recommendation, please let me know and I will post
    > there.


    See above.

    > [.. off-topic removed ..]


    V
     
    Victor Bazarov, Nov 12, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William Park

    (patch for Bash) GTK+2 + Bash

    William Park, Jul 11, 2005, in forum: XML
    Replies:
    3
    Views:
    2,331
    William Park
    Jul 14, 2005
  2. Replies:
    1
    Views:
    618
    Grumble
    Feb 8, 2006
  3. Brandon Dimcheff

    Great Lakes Ruby Bash - Call for Proposals

    Brandon Dimcheff, Feb 17, 2010, in forum: Ruby
    Replies:
    0
    Views:
    140
    Brandon Dimcheff
    Feb 17, 2010
  4. Andrew Poulos
    Replies:
    1
    Views:
    108
    Andrew Poulos
    Oct 11, 2006
  5. BlackHelicopter
    Replies:
    0
    Views:
    386
    BlackHelicopter
    Sep 16, 2013
Loading...

Share This Page