3 ms·
Why is it that you want d to run a then b then c, if a, b and c are independent goals? It might be that `make` is the wrong tool for the job here, but I'm not
by Karellen 4y ago
Why is it that you want d to run a then b then c, if a, b and c are independent goals?
It might be that `make` is the wrong tool for the job here, but I'm not sure what job you're trying to accomplish. You might be having an XY problem.
https://en.wikipedia.org/wiki/XY_problem https://en.wikipedia.org/wiki/XY_problem
- xg15 4y agoIn theory yes. But a lot of people seem to think they need this and (wrongly) assume they can archieve it by simply writing the goals in order. Otherwise OP wouldn't be able to break so many builds with the --shuffle option. I could see it make sense for some "generic" goals which have different dependencies depending on the context they are called. E.g. a "package" goal requiring that something is there to package, but what is there might depend on the top-level goal. But I agree, this is a bit of a misuse of goals - and definitely the direction that ultimately leads to some makefile from hell when this is invariably overdone.
- saurik 4y agoThere is no such thing as "the" top-level goal, so that use case doesn't work: if someone does a parallel build of multiple "top-level" goals the package goal will still need to do something reasonable. To make this work you need multiple package goals, maybe using a pattern goal, and then the package--which sounds like the thing he user was actually trying to get--is going to be an ultimate goal, not whatever you previously thought was the "top-level" one. Regardless: I haven't tried it yet, but I saw in a changelog that a recent version of make added .WAIT, which sounded like it does what you want.
- Karellen 4y ago> But a lot of people seem to think they need this and (wrongly) assume they can archieve it by simply writing the goals in order. Do they? > Otherwise OP wouldn't be able to break so many builds with the --shuffle option. That's not what I took away from OPs post. My reading is that a lot of people have goals that they think are independent, but contain hidden dependencies that they'd just not considered. Or, they have goals which have dependencies that were introduced after the makefile was written, and the makefile hasn't caught up yet. i.e. they don't want "build a then b then c", they want "build a and b and c together if that's at all possible (because I have 48 cores and only a single-threaded compiler) but not if it isn't" - and they just haven't correctly specified what should be possible. Having thought a bit more, you could do your original request with the following stanza: d: make a make b make c If that's what they wanted, it's not that hard. Or they could just write a shell script to do a then b then c, instead of using make.