[dpdk-dev] [PATCH] mk: add debug target

Olivier Matz olivier.matz at 6wind.com
Mon Feb 5 10:23:02 CET 2018


On Fri, Feb 02, 2018 at 10:07:31AM +0100, Thomas Monjalon wrote:
> 01/02/2018 18:04, Ferruh Yigit:
> > On 1/30/2018 11:40 PM, Thomas Monjalon wrote:
> > > 16/12/2017 01:13, Ferruh Yigit:
> > >> Add "debug" target to build library with debug symbols and optimization
> > >> disabled.
> > >>
> > >> This is shortcut for exiting method to compile with
> > >> EXTRA_CFLAGS="-O0 -g3"
> > >>
> > >> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
> > >> ---
> > >> +	debug            build library with debug symbols
> > > [...]
> > >> +.PHONY: debug
> > >> +debug:
> > >> +	$(Q)$(MAKE) EXTRA_CFLAGS="-O0 -g3"
> > > 
> > > This target will override any EXTRA_CFLAGS,
> > > so we cannot build in debug mode with more extra cflags this way.
> > 
> > How about EXTRA_CFLAGS+="-O0 -g3"
> > which is not override EXTRA_CFLAGS but merge them, can be ok?
> 
> I am not sure it works. Have you tested?

Instead of adding a new target, what about, having:

  make DEBUG=1

The DEBUG variable could be used by the rte.*.mk to set the specific
flags, before the EXTRA_* flags.


More information about the dev mailing list