[PATCH] use CFLAGS in src/Makefile

Christoph Hellwig hch at infradead.org
Wed Jan 6 10:39:53 CST 2010


On Sat, Jan 02, 2010 at 02:16:08PM -0800, Christian Kujau wrote:
> Hi,
> 
> while compiling xfstests after configuring with a different CFLAGS value, 
> gcc fails in ./src:
> 
> [...]
> make[2]: Entering directory `/usr/local/src/xfstests-git/src'
> gcc -g -O2 -DDEBUG  -I../include -DVERSION=\"1.0.0\" -L/opt/xfsprogs/lib  
> -DREAD iopat.c -o preallo_rw_pattern_reader
> iopat.c:21:21: error: xfs/xfs.h: No such file or directory
> [...]
> 
> Somehow CFLAGS isn't passed to gcc, but "GCFLAGS" is. I'm not too savvy 
> with the xfstests build system, but in include/builddefs.in we see:
> 
>    # Global, Platform, Local CFLAGS
>    CFLAGS += $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)
> 
> ...thus I'm proposing the following fix:

This looks correct, or at least better than what we had before.
But I really dislike how we defeat the abstraction used for compiling
all the other tools.

What might be better is to add a small
preallo_rw_pattern_writer.c file that just contains:

#define WRITE
#include iopat.c

and the same for the reader side and use the normal rules to compile
the program.




More information about the xfs mailing list