All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Olivier Matz <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH v2 6/6] mk: add "make examples" target in root makefile
Date: Wed, 14 May 2014 16:04:39 +0200	[thread overview]
Message-ID: <2778792.5qLN2XeAKZ@xps13> (raw)
In-Reply-To: <1399631530-24956-7-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>

Hi Olivier,

2014-05-09 12:32, Olivier Matz:
> It is now possible to build all projects from the examples/ directory
> using one command from root directory.
> 
> Some illustration of what is possible:
> 
> - build examples in the DPDK tree for one target
> 
>   # install the x86_64-default-linuxapp-gcc in
>   # ${RTE_SDK}/x86_64-default-linuxapp-gcc directory
>   user@droids:~/dpdk.org$ make install T=x86_64-default-linuxapp-gcc
>   # build examples for this new installation in
>   # ${RTE_SDK}/examples directory
>   user@droids:~/dpdk.org$ make examples T=x86_64-default-linuxapp-gcc
> 
> - build examples outside DPDK tree for several targets
> 
>   # install all targets matching x86_64-*-linuxapp-gcc in
>   # ${RTE_SDK}/x86_64-*-linuxapp-gcc directories
>   user@droids:~/dpdk.org$ make install T=x86_64-*-linuxapp-gcc
>   # build examples for these installations in /tmp/foobar
>   user@droids:~/dpdk.org$ make examples T=x86_64-*-linuxapp-gcc
> O=/tmp/foobar
> 
> Signed-off-by: Olivier Matz <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
[..]
> +# Build directory is given with O=
> +ifndef O
> +O = $(RTE_SDK)/examples
> +endif
> +
> +# Target for which examples should be built.
> +ifndef T
> +T = *
> +endif

Using "?=" should be cleaner than "ifndef" I think.

[...]
> +	$(Q)if [ ! -d "${RTE_SDK}/${*}" ]; then \
> +		echo "Target ${*} does not exist in ${RTE_SDK}/${*}." ; \
> +		echo -n "Please install DPDK first (make install) or use another " ; 
\
> +		echo "target argument (T=target)." ; \

You should stop make execution with "false" on such error.

> +	else \
> +		$(MAKE) -C examples O=$(O) RTE_TARGET=$(*); \
> +	fi

We should use "abspath $O" here when changing directory.

Last comment: I cannot use
	make examples T=x86_64-default-linuxapp-gcc O=build
because of
	RTE_SDK := $(CURDIR)
in GNUmakefile

Thanks
-- 
Thomas

  parent reply	other threads:[~2014-05-14 14:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 10:32 [PATCH v2 0/6] examples: add a new makefile to build all examples Olivier Matz
     [not found] ` <1399631530-24956-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-05-09 10:32   ` [PATCH v2 1/6] mk: introduce rte.extsubdir.mk Olivier Matz
2014-05-09 10:32   ` [PATCH v2 2/6] examples: use rte.extsubdir.mk to process subdirectories Olivier Matz
     [not found]     ` <1399631530-24956-3-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-05-13 13:51       ` [PATCH v3 " Olivier Matz
2014-05-09 10:32   ` [PATCH v2 3/6] examples: add a makefile to build all examples Olivier Matz
2014-05-09 10:32   ` [PATCH v2 4/6] examples: fix qos_sched makefile Olivier Matz
2014-05-09 10:32   ` [PATCH v2 5/6] examples: fix netmap_compat example Olivier Matz
2014-05-09 10:32   ` [PATCH v2 6/6] mk: add "make examples" target in root makefile Olivier Matz
     [not found]     ` <1399631530-24956-7-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-05-14 14:04       ` Thomas Monjalon [this message]
2014-05-15 16:03         ` Olivier MATZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2778792.5qLN2XeAKZ@xps13 \
    --to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.