Newbie question - Custom compiler flags in Makefile

John Baldwin jhb at freebsd.org
Wed Jul 10 16:05:45 UTC 2013


On Tuesday, July 02, 2013 4:53:50 am Arjun wrote:
> Hey,
> 
> I am writing a memory driver and i am using the standard freebsd driver
> Makefile which includes .bsd.kmod.mk
> 
> So, this comes with its own compiler flags. Specifically, i dont want the
> -Wmissing-prototypes option. How do i remove it.
> 
> In general, how can one change the default compiler flags for compilation. ?
> 
> I read bsd.sys.mk file and it seems that for the above option to be
> removed, i need to have WARNS <3. But i want all other -W options except
> for this.
> 
> How do i do this.?
> 
> Any help is appreciated.

Well, you could just add the missing prototypes. :)

However, you can probably manipulate CFLAGS using the modifiers make supports?

Something like:

CFLAGS = ${CFLAGS:N-Wmissing-prototype}

(might need := rather than =)

-- 
John Baldwin


More information about the freebsd-drivers mailing list