Generating multiple binaries from a single source file

Rodolfo Guilherme Wottrich rgwott@gmail.com
Sun Sep 1 03:58:00 GMT 2013


Hello everyone,

I would like to be able to generate multiple binaries from a single
source file, each of which being slightly different from the other(s).
For example, in case there's an OpenMP parallel region in the code, I
want to generate two binaries: one of them being the normal one and
the other one ignoring the parallel region, just like if the -fopenmp
flag hadn't been used.
This isn't exactly a good example, because I could just write a script
to compile the source file twice, with and without the flag. But the
manipulation I want to do with the code is something else.

How do you guys suggest me to do it? It occurs to me that I may simply
implement a new flag to perform a different behavior and compile the
code twice, but looking at the code, I found it somehow difficult to
do. Also, there may be some more clever way to do it.

However, if you guys think that the flag thing is the best way to do
it, please let me know and help me, telling how to implement that new
flag (I can't figure out how to).

Thanks in advance,

---
Rodolfo Guilherme Wottrich
Universidade Estadual de Campinas - Unicamp



More information about the Gcc mailing list