DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mk: add debug target
@ 2017-12-16  0:13 Ferruh Yigit
  2018-01-30 23:40 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2017-12-16  0:13 UTC (permalink / raw)
  To: Thomas Monjalon, John McNamara; +Cc: dev, 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@intel.com>
---
 doc/build-sdk-quick.txt | 1 +
 mk/rte.sdkroot.mk       | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index ff297806a..619430e1b 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -7,6 +7,7 @@ Build commands
 	defconfig        auto-select target template based on arch, OS, etc.
 	all              same as build (default rule)
 	build            build in a configured directory
+	debug            build library with debug symbols
 	clean            remove files but keep configuration
 	install T=       configure, build and install a target in DESTDIR
 	install          install optionally staged in DESTDIR
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e2e3effa8..c55680420 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -123,6 +123,10 @@ gcov gcovclean:
 examples examples_clean:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkexamples.mk $@
 
+.PHONY: debug
+debug:
+	$(Q)$(MAKE) EXTRA_CFLAGS="-O0 -g3"
+
 # all other build targets
 %:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk checkconfig
-- 
2.14.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] mk: add debug target
  2017-12-16  0:13 [dpdk-dev] [PATCH] mk: add debug target Ferruh Yigit
@ 2018-01-30 23:40 ` Thomas Monjalon
  2018-02-01 17:04   ` Ferruh Yigit
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2018-01-30 23:40 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, John McNamara

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@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.

I think the cons are higher than the pros.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] mk: add debug target
  2018-01-30 23:40 ` Thomas Monjalon
@ 2018-02-01 17:04   ` Ferruh Yigit
  2018-02-02  9:07     ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2018-02-01 17:04 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, John McNamara

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@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 think the cons are higher than the pros.
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] mk: add debug target
  2018-02-01 17:04   ` Ferruh Yigit
@ 2018-02-02  9:07     ` Thomas Monjalon
  2018-02-05  9:23       ` Olivier Matz
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2018-02-02  9:07 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, John McNamara

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@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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] mk: add debug target
  2018-02-02  9:07     ` Thomas Monjalon
@ 2018-02-05  9:23       ` Olivier Matz
  0 siblings, 0 replies; 5+ messages in thread
From: Olivier Matz @ 2018-02-05  9:23 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Ferruh Yigit, dev, John McNamara

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@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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-05  9:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-16  0:13 [dpdk-dev] [PATCH] mk: add debug target Ferruh Yigit
2018-01-30 23:40 ` Thomas Monjalon
2018-02-01 17:04   ` Ferruh Yigit
2018-02-02  9:07     ` Thomas Monjalon
2018-02-05  9:23       ` Olivier Matz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).