Re:GNU make insanity: finding the value of the -j parameter
by Hello71 on Saturday March 28, 2015 @08:06PM
(#9283294)
[ Parent
| on HN ]
Re:GNU make insanity: finding the value of the -j parameter
by TheDong on Saturday March 28, 2015 @11:19PM
(#9283753)
Right, you used 'make' as the parser. He said "grep the makefile". You're not grepping the makefile. Nice solution though!
Re:GNU make insanity: finding the value of the -j parameter
by Hello71 on Sunday March 29, 2015 @10:07AM
(#9284850)
> You need to write a full parser to discover all the targets.
I don't think grep '^[^ ]*:' really counts as writing a parser.
Re:GNU make insanity: finding the value of the -j parameter
by TheDong on Sunday March 29, 2015 @12:43PM
(#9285477)
Running "make -p" is running a full parser which someone else wrote. Grep is not extracting the targets from a makefile there, it's extracting the targets from an intermediate representation of a makefile.
Re:GNU make insanity: finding the value of the -j parameter
by Hello71 on Sunday March 29, 2015 @01:00PM
(#9285546)
> The real insanity with make is that it has no interface to check whether a Makefile contains a given target.
>
> Best you can do is to run make -n target to probe, but it's possible to write Makefiles that run code even though -n is used, which will defeat such probes at distribution scale. It quickly becomes an exercise in heuristics and output parsing.
Re:GNU make insanity: finding the value of the -j parameter
by TheDong on Sunday March 29, 2015 @02:29PM
(#9285888)
We're arguing different things.
The comment I replied to, chaosfactors, specifically specified grepping the makefile. You're arguing that you can find all the targets and I never said you can't. I simply said you can't find them all by only grepping the makefile.