4 ms·
> multiple outputs for a target I just had to figure out how to do this today with GNU make. It was something like this: %Parser.c %Parser.h %Lexer.c %Lexer
by kruhft 15y ago
> multiple outputs for a target
I just had to figure out how to do this today with GNU make. It was something like this:
%Parser.c %Parser.h %Lexer.c %Lexer.h %.tokens: %.g
antlr $<
With the object files required by the main project. Worked like a charm and solved the problem of running antlr multiple times for the produced files during a parallel build.
- evmar 15y agoI'm not sure I completely followed your example, but note that the straightforward syntax for multiple outputs from Make does the wrong thing. Here's a discussion of how to make it do what you really want. http://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html http://www.gnu.org/software/automake/manual/html_node/Multip...
- cygx 15y agoLook at the last paragraph of the linked site: For completeness it should be noted that GNU make is able to express rules with multiple output files using pattern rules The problem with this approach (aside from the fact that it's specific to GNU make) is that you need a shared (non-empty) stem in all output files; however, the following workaround appears to work: foo bar baz : % : .dummy/../% %/../foo %/../bar %/../baz : quux @sleep 2 touch foo bar baz