Re: [PATCH bpf-next v3 5/7] tools/runqslower: Enable out-of-tree build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 10, 2020 at 09:11:05PM -0800, Andrii Nakryiko wrote:
> On Tue, Nov 10, 2020 at 8:46 AM Jean-Philippe Brucker
> <jean-philippe@xxxxxxxxxx> wrote:
> >
> > Enable out-of-tree build for runqslower. Only set OUTPUT=.output if it
> > wasn't already set by the user.
> >
> > Signed-off-by: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
> > ---
> > v3:
> > * Drop clean recipe for bpftool and libbpf, since the whole output
> >   directories are removed by the clean recipe.
> > * Use ?= for $(OUTPUT)
> > ---
> >  tools/bpf/runqslower/Makefile | 32 ++++++++++++++++++--------------
> >  1 file changed, 18 insertions(+), 14 deletions(-)
> >
> 
> [...]
> 
> >  clean:
> >         $(call QUIET_CLEAN, runqslower)
> > -       $(Q)rm -rf $(OUTPUT) runqslower
> > +       $(Q)$(RM) -r $(BPFOBJ_OUTPUT) $(BPFTOOL_OUTPUT)
> > +       $(Q)$(RM) $(OUTPUT)*.o $(OUTPUT)*.d
> > +       $(Q)$(RM) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
> > +       $(Q)$(RM) $(OUTPUT)runqslower
> > +       $(Q)$(RM) -r .output
> 
> hard-coding .output here doesn't seem right, didn't all the other
> lines clean up everything already?

Yes, but to clean the source tree, the .output directory needs to be
removed. On the other hand when $(OUTPUT) is out-of-tree, we only want to
remove its content but not the dir itself, because it was created by the
user.

Thanks,
Jean

> 
> >
> >  $(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ)
> >         $(QUIET_LINK)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
> > @@ -59,8 +65,8 @@ $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT)
> >  $(OUTPUT)/%.o: %.c | $(OUTPUT)
> >         $(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@
> >
> 
> [...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux