From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 6/6] mk: add "make examples" target in root makefile Date: Wed, 14 May 2014 16:04:39 +0200 Message-ID: <2778792.5qLN2XeAKZ@xps13> References: <1399631530-24956-1-git-send-email-olivier.matz@6wind.com> <1399631530-24956-7-git-send-email-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Olivier Matz Return-path: In-Reply-To: <1399631530-24956-7-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 [..] > +# 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