EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: wanted: rule to build products with own CFLAGS inside single Makefile
From: Andrew Johnson <[email protected]>
To: Dayle Kotturi <[email protected]>
Cc: [email protected]
Date: Wed, 30 May 2007 15:31:23 -0500
Hi Dayle,

Dayle Kotturi wrote:

I have an RF phase and amplitude detection application which needs to be built slightly differently for each RF station. I want to keep the code as one single app and build multiple products. I need each product to have its own CFLAGS definition to pick up its correct code.


# 5/30/7: option 1. this doesn't work. None of these flags get used because
# <product>_CFLAGS_* is not interpreted
pad-gen_CFLAGS_RTEMS += -DPAD_GEN
pad-ref_CFLAGS_RTEMS += -DPAD_REF
pad-lsr_CFLAGS_RTEMS += -DPAD_LSR
pad-l1xkly_CFLAGS_RTEMS += -DPAD_L1XKLY
pad-kly_CFLAGS_RTEMS += -DPAD_KLY
pad-bph_CFLAGS_RTEMS += -DPAD_BPH

This doesn't work because the <name>_CFLAGS_<osclass> variables match the <name> part with the basename of the C source file being compiled, not the final product that you're building. Unfortunately the AppDevGuide is not very clear on this point.


You are wanting to compile the same set of files several times on the same architecture with different CFLAGS settings, but the EPICS build system is not designed to be able to compile a file more than once on a single target architecture - it can't keep track of what the CFLAGS settings were for the drvPad.o file, all it knows is how to convert drvPad.c into drvPad.o, and once it's done that it can use the result to create any final products that need drvPad.o.

Therefor what you're trying to do won't work with the EPICS build system the way you're trying to do it, but you can still do what you need in a slightly different way: you need to create a series of .c files for your different products, but all they contain is a #include of the main .c source file that you're wanting to compile. These files could even contain an appropriate #define PAD_GEN first to save you having to do the CFLAGS thing in the Makefile any more.

HTH,

- Andrew
--
The right to be heard does not automatically include
the right to be taken seriously. -- Hubert H. Humphrey

References:
wanted: rule to build products with own CFLAGS inside single Makefile Dayle Kotturi

Navigate by Date:
Prev: wanted: rule to build products with own CFLAGS inside single Makefile Dayle Kotturi
Next: Active X CA Server for LabVIEW Szalata, Zenon M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: wanted: rule to build products with own CFLAGS inside single Makefile Dayle Kotturi
Next: Active X CA Server for LabVIEW Szalata, Zenon M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·