On 2011-01-14 18:41Z, givemecode wrote:
[...]
> So I have all these headers which I call *.h and they are of course in an
> include directory. A co-worker created this little script inside the
> makefile which switches the endianness of the bitfields which I put in the
> headers, and renames them with *.hh and puts them in another directory.

If you have code like this:
  #include "header.h"
and you want it to include 'another_directory/header.hh' instead, then
use a flag to instruct the compiler to look for headers in the other
directory first, and change the file suffixes there from '.hh' to '.h'.
You'd wind up with
     big_endian/header.h
  little_endian/header.h
and then for example with gcc you could set CFLAGS='-I big_endian'
or '-I little_endian'.

If the makefile needs a list of headers for some other purpose, use
something like:
  $(wildcard $(endianness)/*.h)
with a suitable value of $(endianness).

_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to