[dpdk-dev] [PATCH 0/5] examples: add a new makefile to build all examples

Neil Horman nhorman at tuxdriver.com
Fri Apr 25 20:39:18 CEST 2014


On Fri, Apr 25, 2014 at 06:24:48PM +0200, Olivier MATZ wrote:
> Hi Neil,
> 
> First, thank you for your reviews.
> 
You're welcome, glad to do it.

> On Friday, April 25, 2014 10:05:26 AM Neil Horman wrote:
> > > After applying the patches, it is possible to build all examples by doing
> > > the following:
> > >   user at droids:~/dpdk.org$ cd examples
> > >   user at droids:~/dpdk.org/examples$ make RTE_SDK=${PWD}/.. \
> > >       RTE_TARGET=x86_64-default-linuxapp-gcc
> > 
> > What you actually want here is RTE_TARGET=build, as the Makefile looks for
> > the ${RTE_TARGET}/.config file, it doesn't just parse whatever target file
> > you specify.
> > 
> > That begs the bigger point, RTE_TARGET will always be =build, so why not
> > just add a top level make rule for the examples subdirectory, then RTE_SDK
> > and RTE_TARGET will just be automatically set.
> 
> When we compile an example or an external application, RTE_SDK references
> a binary DPDK, or more precisely a DPDK source workspace that has been
> compiled with "make install T=my-targets".
> 
> You're right that RTE_TARGET corresponds to the name of the build directory
> but the logic is that the name of the directory is the name of the target.
> 
> To be clearer, the commit log should probably be updated with the
> following list of commands:
> 
>   user at droids:~/dpdk.org$ make install T=x86_64-default-linuxapp-gcc
>   user at droids:~/dpdk.org$ cd examples
>   user at droids:~/dpdk.org/examples$ make RTE_SDK=${PWD}/.. \
>         RTE_TARGET=x86_64-default-linuxapp-gcc
> 
Ah, I see, yes, that does make it more clear.  You're moving the built files to
a private directory so that you can target multiple platforms in parallel.
Please add the install step to the log file, I think that helps alot.

> About adding a top level makefile rule, it's a good idea as it can
> be documented in "make help", but I wasn't very confident about where
> to put the output files. I can check if doing something like below is
> possible or too complex:
> 
>   user at droids:~/dpdk.org$ make install T=x86_64-default-linuxapp-gcc
>   user at droids:~/dpdk.org$ cd x86_64-default-linuxapp-gcc
>   user at droids:~/dpdk.org/x86_64-default-linuxapp-gcc$ make examples
>   # generate examples in $PWD/examples
> 
That might work.  My thought was to simply add an examples rule like this to the
top level make file

examples:
	ifeq ($(T),)
	T := build
	endif
	$MAKE -C examples

The syntax isn't perfect, but you get the idea, basically just a rule to hand
off control to the examples subdirectory, that defaults the target directory to
build, should no other be specified.  The result is that the examples are built
for the last compiled target.

Regards
Neil
 
> Regards,
> Olivier
> 
> 


More information about the dev mailing list