xfs
[Top] [All Lists]

Re: [PATCH] use CFLAGS in src/Makefile

To: Christian Kujau <lists@xxxxxxxxxxxxxxx>
Subject: Re: [PATCH] use CFLAGS in src/Makefile
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 6 Jan 2010 11:39:53 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <alpine.DEB.2.01.1001021409290.3483@xxxxxxxxxxxxxxxxxx>
References: <alpine.DEB.2.01.1001021409290.3483@xxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
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.

<Prev in Thread] Current Thread [Next in Thread>