From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v2 6/6] mk: add "make examples" target in root makefile Date: Thu, 15 May 2014 18:03:27 +0200 Message-ID: <5374E54F.1020303@6wind.com> References: <1399631530-24956-1-git-send-email-olivier.matz@6wind.com> <1399631530-24956-7-git-send-email-olivier.matz@6wind.com> <2778792.5qLN2XeAKZ@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Thomas Monjalon Return-path: In-Reply-To: <2778792.5qLN2XeAKZ@xps13> 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 Thomas, Thank you for your comments. On 05/14/2014 04:04 PM, Thomas Monjalon wrote: >> +# 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. Agree, I'll fix that. > [...] >> + $(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. The idea was to be able to build the examples for all installed targets, skipping those which are not installed: make install T=x86_64-default-linuxapp-gcc # build for x86_64-default-linuxapp-gcc only make examples But if you prefer, I can change it so the user has to specify the target explicitly. >> + else \ >> + $(MAKE) -C examples O=$(O) RTE_TARGET=$(*); \ >> + fi > > We should use "abspath $O" here when changing directory. Yes, I'll fix that too. > Last comment: I cannot use > make examples T=x86_64-default-linuxapp-gcc O=build > because of > RTE_SDK := $(CURDIR) > in GNUmakefile This works fine if you do: # install the x86_64-default-linuxapp-gcc target in RTE_SDK=. make install T=x86_64-default-linuxapp-gcc # compile examples in build, using the installed target # x86_64-default-linuxapp-gcc from RTE_SDK=. make examples T=x86_64-default-linuxapp-gcc O=build Indeed, I would say that all makefile commands called from DPDK root directory assume that RTE_SDK=. so that's the expected behavior. I'll send a v3 with the fixes tomorrow. Regards, Olivier