OT: How to call a bash function within a makefile

O

OnMyWayHome

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
 
V

Victor Bazarov

OnMyWayHome said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top