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


Reply via email to