BPF List
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Martin Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	john fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>
Subject: Re: [PATCH bpf-next v2 5/6] tools/runqslower: Enable out-of-tree build
Date: Tue, 10 Nov 2020 13:43:42 +0100	[thread overview]
Message-ID: <20201110124342.GC1521675@myrica> (raw)
In-Reply-To: <CAEf4BzbdnJPr0FjdQmzNEYmUj8fTwVGu6ihqRB44L8ZS7FLVug@mail.gmail.com>

On Mon, Nov 09, 2020 at 12:23:28PM -0800, Andrii Nakryiko wrote:
> On Mon, Nov 9, 2020 at 3:11 AM Jean-Philippe Brucker
> <jean-philippe@linaro.org> 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@linaro.org>
> > ---
> >  tools/bpf/runqslower/Makefile | 45 +++++++++++++++++++++++------------
> >  1 file changed, 30 insertions(+), 15 deletions(-)
> >
> > diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile
> > index bcc4a7396713..861f4dcde960 100644
> > --- a/tools/bpf/runqslower/Makefile
> > +++ b/tools/bpf/runqslower/Makefile
> > @@ -1,15 +1,20 @@
> >  # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
> >  include ../../scripts/Makefile.include
> >
> > -OUTPUT := .output
> > +ifeq ($(OUTPUT),)
> > +  OUTPUT = $(abspath .output)/
> > +endif
> 
> OUTPUT ?= .. didn't work?

Yes it should, I'll change it. The difference is when make is invoked with
OUTPUT explicitly set to "", then ?= wouldn't override it. But I didn't
see any external Makefile passing OUTPUT= to this one, and the user-facing
option is O=

> 
> > +
> >  CLANG ?= clang
> >  LLC ?= llc
> >  LLVM_STRIP ?= llvm-strip
> > -DEFAULT_BPFTOOL := $(OUTPUT)/sbin/bpftool
> > +BPFTOOL_OUTPUT := $(OUTPUT)bpftool/
> > +DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bpftool
> >  BPFTOOL ?= $(DEFAULT_BPFTOOL)
> >  LIBBPF_SRC := $(abspath ../../lib/bpf)
> > -BPFOBJ := $(OUTPUT)/libbpf.a
> > -BPF_INCLUDE := $(OUTPUT)
> > +BPFOBJ_OUTPUT := $(OUTPUT)libbpf/
> > +BPFOBJ := $(BPFOBJ_OUTPUT)libbpf.a
> > +BPF_INCLUDE := $(BPFOBJ_OUTPUT)
> >  INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../lib)        \
> >         -I$(abspath ../../include/uapi)
> >  CFLAGS := -g -Wall
> > @@ -20,7 +25,6 @@ VMLINUX_BTF_PATHS := /sys/kernel/btf/vmlinux /boot/vmlinux-$(KERNEL_REL)
> >  VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword                           \
> >                                           $(wildcard $(VMLINUX_BTF_PATHS))))
> >
> > -abs_out := $(abspath $(OUTPUT))
> >  ifeq ($(V),1)
> >  Q =
> >  else
> > @@ -36,9 +40,13 @@ all: runqslower
> >
> >  runqslower: $(OUTPUT)/runqslower
> >
> > -clean:
> > +clean: $(DEFAULT_BPFTOOL)-clean $(BPFOBJ)-clean
> 
> why separate targets for $(DEFAULT_BPFTOOL)-clean and $(BPFOBJ)-clean?
> Are they intended to be called separately? I don't think
> parallelization is that important for the clean up. Let's just keep
> all the cleaning in one place, not spreading it across Makefile?

Ok

Thanks,
Jean

  reply	other threads:[~2020-11-10 12:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 11:09 [PATCH bpf-next v2 0/6] tools/bpftool: Fix cross and out-of-tree builds Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 1/6] tools: Factor HOSTCC, HOSTLD, HOSTAR definitions Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 2/6] tools/bpftool: Force clean of out-of-tree build Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 3/6] tools/bpftool: Fix cross-build Jean-Philippe Brucker
2020-11-09 20:17   ` Andrii Nakryiko
2020-11-10 12:43     ` Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 4/6] tools/runqslower: Use Makefile.include Jean-Philippe Brucker
2020-11-09 11:09 ` [PATCH bpf-next v2 5/6] tools/runqslower: Enable out-of-tree build Jean-Philippe Brucker
2020-11-09 20:23   ` Andrii Nakryiko
2020-11-10 12:43     ` Jean-Philippe Brucker [this message]
2020-11-09 11:09 ` [PATCH bpf-next v2 6/6] tools/runqslower: Build bpftool using HOSTCC Jean-Philippe Brucker
2020-11-09 18:11 ` [PATCH bpf-next v2 0/6] tools/bpftool: Fix cross and out-of-tree builds Andrii Nakryiko
2020-11-10 12:42   ` Jean-Philippe Brucker
2020-11-10 18:38     ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201110124342.GC1521675@myrica \
    --to=jean-philippe@linaro.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox