0

Just to be clear, I'm not asking if it is possible to run jobs in parallel as I know, that this is what the -j flag does. I'm asking if you can run/call a job when you are in another job for example:

basic:
   echo "This is the basic job"
sub-job:
   call basic
   echo "And this is the sub-job"

Is there a way to do that?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • 4
    Why not just make `basic` a dependency of `sub-job`? Won't that give you the behaviour you're looking for? – G.M. Oct 31 '21 at 09:51
  • 1
    The usual way to do that is `$(MAKE) -$(MAKEFLAGS) basic`; but as the previous comment suggests, making it an explicit dependency which runs in the same `make` process is vastly preferable. A recursive `make` is useful if you have a separate project with its own Makefile, or if you need to force `make` to parse the Makefile again from scratch for the target. – tripleee Oct 31 '21 at 09:58
  • @G.M. It will, I'm just an idiot.... I also did used `make basic` in the job which also works. But yeah in my case, you solution is better. Thanks! –  Oct 31 '21 at 09:59
  • 1
    @tripleee Actually it is possible to do it non-recursively even for different projects, in case both are using https://github.com/cppfw/prorab . Recursive make is not needed. – igagis Oct 31 '21 at 20:24

0 Answers0