[dpdk-dev] [PATCH v2 6/6] mk: add "make examples" target in root makefile

Thomas Monjalon thomas.monjalon at 6wind.com
Wed May 14 16:04:39 CEST 2014


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 at droids:~/dpdk.org$ make install T=x86_64-default-linuxapp-gcc
>   # build examples for this new installation in
>   # ${RTE_SDK}/examples directory
>   user at 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 at droids:~/dpdk.org$ make install T=x86_64-*-linuxapp-gcc
>   # build examples for these installations in /tmp/foobar
>   user at droids:~/dpdk.org$ make examples T=x86_64-*-linuxapp-gcc
> O=/tmp/foobar
> 
> Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
[..]
> +# 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


More information about the dev mailing list