Skip to content

Commit 32756c1

Browse files
ytcoodeNobody
authored and
Nobody
committed
bpftool: Remove redundant slashes
Because the OUTPUT variable ends with a slash but CURDIR doesn't, to keep the _OUTPUT value consistent, we add a trailing slash to CURDIR when defining _OUTPUT variable. Since the _OUTPUT variable holds a value ending with a trailing slash, there is no need to add another one when defining BOOTSTRAP_OUTPUT and LIBBPF_OUTPUT variables. When defining LIBBPF_INCLUDE and LIBBPF_BOOTSTRAP_INCLUDE, we shouldn't add an extra slash either for the same reason. When building libbpf, the value of the DESTDIR argument should also not end with a trailing slash. Signed-off-by: Yuntao Wang <[email protected]> Reviewed-by: Quentin Monnet <[email protected]>
1 parent 29cc20c commit 32756c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/bpf/bpftool/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ BPF_DIR = $(srctree)/tools/lib/bpf
1818
ifneq ($(OUTPUT),)
1919
_OUTPUT := $(OUTPUT)
2020
else
21-
_OUTPUT := $(CURDIR)
21+
_OUTPUT := $(CURDIR)/
2222
endif
23-
BOOTSTRAP_OUTPUT := $(_OUTPUT)/bootstrap/
23+
BOOTSTRAP_OUTPUT := $(_OUTPUT)bootstrap/
2424

25-
LIBBPF_OUTPUT := $(_OUTPUT)/libbpf/
25+
LIBBPF_OUTPUT := $(_OUTPUT)libbpf/
2626
LIBBPF_DESTDIR := $(LIBBPF_OUTPUT)
27-
LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)/include
27+
LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)include
2828
LIBBPF_HDRS_DIR := $(LIBBPF_INCLUDE)/bpf
2929
LIBBPF := $(LIBBPF_OUTPUT)libbpf.a
3030

3131
LIBBPF_BOOTSTRAP_OUTPUT := $(BOOTSTRAP_OUTPUT)libbpf/
3232
LIBBPF_BOOTSTRAP_DESTDIR := $(LIBBPF_BOOTSTRAP_OUTPUT)
33-
LIBBPF_BOOTSTRAP_INCLUDE := $(LIBBPF_BOOTSTRAP_DESTDIR)/include
33+
LIBBPF_BOOTSTRAP_INCLUDE := $(LIBBPF_BOOTSTRAP_DESTDIR)include
3434
LIBBPF_BOOTSTRAP_HDRS_DIR := $(LIBBPF_BOOTSTRAP_INCLUDE)/bpf
3535
LIBBPF_BOOTSTRAP := $(LIBBPF_BOOTSTRAP_OUTPUT)libbpf.a
3636

@@ -44,15 +44,15 @@ $(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT) $(LIBBPF_BOOTSTRAP_OUTPUT) $(LIBBPF_HDRS_DI
4444

4545
$(LIBBPF): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_OUTPUT)
4646
$(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_OUTPUT) \
47-
DESTDIR=$(LIBBPF_DESTDIR) prefix= $(LIBBPF) install_headers
47+
DESTDIR=$(LIBBPF_DESTDIR:/=) prefix= $(LIBBPF) install_headers
4848

4949
$(LIBBPF_INTERNAL_HDRS): $(LIBBPF_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_HDRS_DIR)
5050
$(call QUIET_INSTALL, $@)
5151
$(Q)install -m 644 -t $(LIBBPF_HDRS_DIR) $<
5252

5353
$(LIBBPF_BOOTSTRAP): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_BOOTSTRAP_OUTPUT)
5454
$(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) \
55-
DESTDIR=$(LIBBPF_BOOTSTRAP_DESTDIR) prefix= \
55+
DESTDIR=$(LIBBPF_BOOTSTRAP_DESTDIR:/=) prefix= \
5656
ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) $@ install_headers
5757

5858
$(LIBBPF_BOOTSTRAP_INTERNAL_HDRS): $(LIBBPF_BOOTSTRAP_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_BOOTSTRAP_HDRS_DIR)

0 commit comments

Comments
 (0)