Unix Programming - Creating diff executables with autotools

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2005 > Creating diff executables with autotools





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Creating diff executables with autotools
Paulo Matos

2005-11-08, 6:29 pm

Hi all,

How can I specify using autotools, in Makefile.am that I wish to create
diff executables from the same set of sources. The executables differ
in that they are compiled with different flags.
For example:
bin_PROGRAMS = test otest dtest # Normal test, optimized test and debug
test

If they have few sources files we can specify them repeatedly for
test_SOURCES otest_SOURCES and dtest_SOURCES, however if they have
hundreds of source files it gets harder to maintain.
What's the best way to do this?

Cheers,

Paulo Matos

Måns Rullgård

2005-11-08, 6:29 pm

"Paulo Matos" <pocmatos@gmail.com> writes:

> Hi all,
>
> How can I specify using autotools, in Makefile.am that I wish to create
> diff executables from the same set of sources. The executables differ
> in that they are compiled with different flags.
> For example:
> bin_PROGRAMS = test otest dtest # Normal test, optimized test and debug
> test
>
> If they have few sources files we can specify them repeatedly for
> test_SOURCES otest_SOURCES and dtest_SOURCES, however if they have
> hundreds of source files it gets harder to maintain.
> What's the best way to do this?


Maybe not the best, but one way is this:

SOURCES = foo.c bar.c
test_SOURCES = $(SOURCES)
otest_SOURCES = $(SOURCES)

--
Måns Rullgård
mru@inprovide.com
Paulo Matos

2005-11-08, 6:29 pm

Thanks...

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com