[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help copying & renaming filename inside makefile.
From: |
Greg Chicares |
Subject: |
Re: Help copying & renaming filename inside makefile. |
Date: |
Fri, 14 Jan 2011 20:35:16 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
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).