Re: Merging rules

2018-06-14 Thread Sébastien Hinderer
Sébastien Hinderer (2018/06/14 14:27 +0200): > Ah, it's too bad. Because, what I forgot to mention is that the intent > behind all this is to make the recipe(s) a bit more complex by adding > other variables, namely CFLAGS and CPPFLAGS, to let the user (the > person who compiles the package) use th

Re: Merging rules

2018-06-14 Thread Sébastien Hinderer
Dear Paul, Many thanks for your clear, prompt and helpful response! Paul Smith (2018/06/14 08:19 -0400): > On Thu, 2018-06-14 at 13:51 +0200, Sébastien Hinderer wrote: > > Now I am wondering whether there would be a way to rewrite this > > fragment without having to repeat the command. > > No, t

Re: Merging rules

2018-06-14 Thread Paul Smith
On Thu, 2018-06-14 at 13:51 +0200, Sébastien Hinderer wrote: > Now I am wondering whether there would be a way to rewrite this > fragment without having to repeat the command. No, there is no way to do that. Well, you could define a variable containing the rule and use an eval/call pair inside a

Re: Merging rules

2018-06-14 Thread Sébastien Hinderer
OK here is my real example, I think it's just simpler to show the fragments as they are -- sorry I dind't do it earlier. After a bunch of refactorings, I reached a point where the frament in question looks like this: %.$(O): %.c $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< %.$(

Re: Merging rules

2018-06-14 Thread Basin Ilya
> I do believe the > command is run only once, which is fine because it produces both files I think that `make all` depends on just one output of that rule. If you really want to such command only once, then don't mention additional outputs in the makefile or choose a primary output and make the

Re: Merging rules

2018-06-13 Thread Sébastien Hinderer
Hi, Basin! Basin Ilya (2018/06/13 21:15 +0300): > Hi Sébastien. > > > > Then make will think that with only one invocation all the different > > types of files will be produced, which is of course wrong. > > I think you've got a wrong impression. Make will run the rule as many > times as needed

Re: Merging rules

2018-06-13 Thread Basin Ilya
Hi Sébastien. > Then make will think that with only one invocation all the different > types of files will be produced, which is of course wrong. I think you've got a wrong impression. Make will run the rule as many times as needed to make all the targets. 13.06.2018 20:38, Sébastien Hinderer

Merging rules

2018-06-13 Thread Sébastien Hinderer
Dear all, Assume the following fragment of a Makefile %.$(O): %.c $(CC) ... %.pic.$(O): %.c $(CC) ... %.p.$(O): %.c $(CC) ... %.i.$(O): %.c $(CC) ... %.d.$(O): %.c $(CC) ... That is, these rules build different types of object files from C sources. Un