Okay, but how do I then get automake to handle the compilation? I don't want to type in the compilation commands myself; that's what automake is for. If I add the benchmarking program to noinst_PROGRAMS, it compiles when 'make' is run, rather than only when 'make bench' is run. Also, when I wrote a custom target in bench/Makefile.am, the root makefile didn't seem to notice, and running make bench from the root of the project simply gave "make: Nothing to be done for `bench'."
On Sun, Jul 6, 2008 at 1:59 AM, Ralf Wildenhues <[EMAIL PROTECTED]> wrote: > Hello Tavian, > > * Tavian Barnes wrote on Sun, Jul 06, 2008 at 07:28:30AM CEST: >> Hi, guys. I have a question: how do I create a custom target, and >> selectively compile some code, and run the compiled executable, when >> this target is chosen? Specifically, I have a benchmarking suite for >> a library I wrote, and I want to compile the code in the bench/ >> directory, and run the executable, when the user types 'make bench'. >> I tried looking this up in the manual, but couldn't find it; sorry if >> I missed something obvious. > > Most of the Makefile.am text is copied verbatim into the Makefile.in > (and from there into the Makefile). So if you want to add custom > targets, just write plain make rules: > > bench: prerequisites... > ... compile > ... > .PHONY: bench > > Cheers, > Ralf > -- Tavian Barnes
