From: Jiri Olsa <jolsa@redhat.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andriin@fb.com>,
Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@chromium.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH bpf-next 1/4] tools/resolve_btfids: Build libbpf and libsubcmd in separate directories
Date: Fri, 5 Feb 2021 11:35:07 +0100 [thread overview]
Message-ID: <YB0fW+zEPHa/XKsq@krava> (raw)
In-Reply-To: <CAEf4BzYhnm2tfnuGWXDOAZZmYBnboSZ3JsWjDHM5ortCbaeEjw@mail.gmail.com>
On Thu, Feb 04, 2021 at 04:39:38PM -0800, Andrii Nakryiko wrote:
> On Thu, Feb 4, 2021 at 1:20 PM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > Setting up separate build directories for libbpf and libpsubcmd,
> > so it's separated from other objects and we don't get them mixed
> > in the future.
> >
> > It also simplifies cleaning, which is now simple rm -rf.
> >
> > Also there's no need for FEATURE-DUMP.libbpf and bpf_helper_defs.h
> > files in .gitignore anymore.
> >
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> > tools/bpf/resolve_btfids/.gitignore | 2 --
> > tools/bpf/resolve_btfids/Makefile | 26 +++++++++++---------------
> > 2 files changed, 11 insertions(+), 17 deletions(-)
> >
> > diff --git a/tools/bpf/resolve_btfids/.gitignore b/tools/bpf/resolve_btfids/.gitignore
> > index a026df7dc280..25f308c933cc 100644
> > --- a/tools/bpf/resolve_btfids/.gitignore
> > +++ b/tools/bpf/resolve_btfids/.gitignore
> > @@ -1,4 +1,2 @@
> > -/FEATURE-DUMP.libbpf
> > -/bpf_helper_defs.h
> > /fixdep
> > /resolve_btfids
> > diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile
> > index bf656432ad73..b780b3a9fb07 100644
> > --- a/tools/bpf/resolve_btfids/Makefile
> > +++ b/tools/bpf/resolve_btfids/Makefile
> > @@ -28,22 +28,22 @@ OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
> > LIBBPF_SRC := $(srctree)/tools/lib/bpf/
> > SUBCMD_SRC := $(srctree)/tools/lib/subcmd/
> >
> > -BPFOBJ := $(OUTPUT)/libbpf.a
> > -SUBCMDOBJ := $(OUTPUT)/libsubcmd.a
> > +BPFOBJ := $(OUTPUT)/libbpf/libbpf.a
> > +SUBCMDOBJ := $(OUTPUT)/libsubcmd/libsubcmd.a
> >
> > BINARY := $(OUTPUT)/resolve_btfids
> > BINARY_IN := $(BINARY)-in.o
> >
> > all: $(BINARY)
> >
> > -$(OUTPUT):
> > +$(OUTPUT) $(OUTPUT)/libbpf $(OUTPUT)/libsubcmd:
> > $(call msg,MKDIR,,$@)
> > - $(Q)mkdir -p $(OUTPUT)
> > + $(Q)mkdir -p $(@)
> >
> > -$(SUBCMDOBJ): fixdep FORCE
> > - $(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(OUTPUT)
> > +$(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd
> > + $(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
> >
> > -$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT)
> > +$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT)/libbpf
> > $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
> >
> > CFLAGS := -g \
> > @@ -57,23 +57,19 @@ LIBS = -lelf -lz
> > export srctree OUTPUT CFLAGS Q
> > include $(srctree)/tools/build/Makefile.include
> >
> > -$(BINARY_IN): fixdep FORCE
> > +$(BINARY_IN): fixdep FORCE | $(OUTPUT)
> > $(Q)$(MAKE) $(build)=resolve_btfids
> >
> > $(BINARY): $(BPFOBJ) $(SUBCMDOBJ) $(BINARY_IN)
> > $(call msg,LINK,$@)
> > $(Q)$(CC) $(BINARY_IN) $(LDFLAGS) -o $@ $(BPFOBJ) $(SUBCMDOBJ) $(LIBS)
> >
> > -libsubcmd-clean:
> > - $(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(OUTPUT) clean
> > -
> > -libbpf-clean:
> > - $(Q)$(MAKE) -C $(LIBBPF_SRC) OUTPUT=$(OUTPUT) clean
> > -
> > -clean: libsubcmd-clean libbpf-clean fixdep-clean
> > +clean: fixdep-clean
> > $(call msg,CLEAN,$(BINARY))
> > $(Q)$(RM) -f $(BINARY); \
> > $(RM) -rf $(if $(OUTPUT),$(OUTPUT),.)/feature; \
> > + $(RM) -rf $(OUTPUT)libbpf; \
> > + $(RM) -rf $(OUTPUT)libsubcmd; \
>
> If someone specifies OUTPUT=bla, you will attempt to delete blalibbpf,
> not bla/libbpf
will add missing '/', thanks
jirka
next prev parent reply other threads:[~2021-02-05 10:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210129134855.195810-1-jolsa@redhat.com>
2021-02-04 21:18 ` [PATCH bpf-next 0/4] kbuild/resolve_btfids: Invoke resolve_btfids clean in root Makefile Jiri Olsa
2021-02-04 21:18 ` [PATCH bpf-next 1/4] tools/resolve_btfids: Build libbpf and libsubcmd in separate directories Jiri Olsa
2021-02-04 23:33 ` Song Liu
2021-02-05 0:39 ` Andrii Nakryiko
2021-02-05 10:35 ` Jiri Olsa [this message]
2021-02-04 21:18 ` [PATCH bpf-next 2/4] tools/resolve_btfids: Check objects before removing Jiri Olsa
2021-02-04 23:41 ` Song Liu
2021-02-05 0:42 ` Andrii Nakryiko
2021-02-05 10:40 ` Jiri Olsa
2021-02-04 21:18 ` [PATCH bpf-next 3/4] tools/resolve_btfids: Set srctree variable unconditionally Jiri Olsa
2021-02-04 23:41 ` Song Liu
2021-02-05 1:24 ` Andrii Nakryiko
2021-02-04 21:18 ` [PATCH bpf-next 4/4] kbuild: Add resolve_btfids clean to root clean target Jiri Olsa
2021-02-04 23:42 ` Song Liu
2021-02-05 12:40 [PATCHv2 bpf-next 0/4] kbuild/resolve_btfids: Invoke resolve_btfids clean in root Makefile Jiri Olsa
2021-02-05 12:40 ` [PATCH bpf-next 1/4] tools/resolve_btfids: Build libbpf and libsubcmd in separate directories Jiri Olsa
2021-02-05 22:24 ` Andrii Nakryiko
2021-03-10 17:27 ` Viktor Jägersküpper
2021-03-10 19:27 ` Andrii Nakryiko
2021-03-10 22:42 ` Jiri Olsa
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=YB0fW+zEPHa/XKsq@krava \
--to=jolsa@redhat.com \
--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=jolsa@kernel.org \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).