[PATCH] respect CFLAGS/CPPFLAGS from build environment

Josh Boyer jwboyer at gmail.com
Mon Jun 16 12:12:42 EDT 2008


On Fri, 13 Jun 2008 17:11:21 -0400
Mike Frysinger <vapier at gentoo.org> wrote:

> On Friday 13 June 2008, Josh Boyer wrote:
> > On Wed, 11 Jun 2008 17:49:08 -0400
> >
> > Mike Frysinger <vapier at gentoo.org> wrote:
> > > diff --git a/ubi-utils/Makefile b/ubi-utils/Makefile
> > > index 0394eee..062cc32 100644
> > > --- a/ubi-utils/Makefile
> > > +++ b/ubi-utils/Makefile
> > > @@ -2,7 +2,6 @@
> > >  # Makefile for ubi-utils
> > >  #
> > >
> > > -OPTFLAGS := -O2 -g -Wall
> > >  KERNELHDR := ../include
> > >  DESTDIR := /usr/local
> > >  SBINDIR=/usr/sbin
> > > @@ -10,8 +9,10 @@ MANDIR=/usr/share/man
> > >  INCLUDEDIR=/usr/include
> > >
> > >  CC := $(CROSS)gcc
> > > -CFLAGS := -I./inc -I./src -I$(KERNELHDR) $(OPTFLAGS) -Werror \
> > > -	-Wwrite-strings -W -std=gnu99 -DPACKAGE_VERSION=\"1.0\"
> > > +CFLAGS ?= -O2 -g -Werror
> > > +CFLAGS += -Wall -Wwrite-strings -W
> > > +CPPFLAGS += -I./inc -I./src -I$(KERNELHDR) \
> > > +	-std=gnu99 -DPACKAGE_VERSION=\"1.0\"
> > >
> > >  PERLPROGS = mkpfi ubicrc32.pl
> > >
> > > @@ -26,7 +27,7 @@ vpath   %.c ./src
> > >  	$(CC) $(LDFLAGS) -g -o $@ $^
> > >
> > >  %.o: %.c
> > > -	$(CC) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,.$(shell basename $<).dep
> > > +	$(CC) $(CPPFLAGS) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,.$(shell basename
> > > $<).dep
> >
> > Should either remove the unconditional -g here, or not specify it in
> > the default CFLAGS above, correct?
> 
> moving -g in both Makefiles to the default CFLAGS makes the most sense to 
> me ... i just figured someone liked it the way it was and i didnt really care 
> to fight em for it.

Yeah, default CFLAGS makes sense.  I'll fix that up and get this
committed shortly.  Thanks.

josh



More information about the linux-mtd mailing list