xx yy:
sleep 2
@echo [ $@:done ]
How do I put backgroud jobs in makefile?
"wait" does not seem to work here.
TIA
jl
In practice, you usually don't.
> "wait" does not seem to work here.
That's because "wait" can only wait for a child process of the shell
invoking wait, and each line in the makefile is a separate shell
command.
You can sorta hack around this:
foo & \
wait
but it's... not recommended.
Here's the thing. If you want a background job, make is almost certainly
the wrong tool. The POINT of make is to handle DEPENDENCIES. Dependencies,
as in, you can't continue until they're done. So there's no obvious reason
to want to background something.
If you're looking for parallelization, look into GNU make or BSD make and
note that they both support running multiple jobs.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!