1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
--- docs/Makefile
+++ docs/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-include ../../../scripts/Makefile.include
+include ../src/Makefile.include
INSTALL ?= install
RM ?= rm -f
--- src/.gitignore
+++ src/.gitignore
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+*.o
*.d
/bootstrap/
/bpftool
-bpftool*.8
FEATURE-DUMP.bpftool
feature
libbpf
--- src/Makefile
+++ src/Makefile
@@ -1,10 +1,8 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-include ../../scripts/Makefile.include
+include Makefile.include
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
-srctree := $(patsubst %/,%,$(dir $(srctree)))
-srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
ifeq ($(V),1)
@@ -13,7 +11,7 @@
Q = @
endif
-BPF_DIR = $(srctree)/tools/lib/bpf
+BPF_DIR = $(srctree)/libbpf/src
ifneq ($(OUTPUT),)
_OUTPUT := $(OUTPUT)
@@ -43,16 +41,16 @@
$(QUIET_MKDIR)mkdir -p $@
$(LIBBPF): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_OUTPUT)
- $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_OUTPUT) \
- DESTDIR=$(LIBBPF_DESTDIR:/=) prefix= $(LIBBPF) install_headers
+ $(Q)$(MAKE) -C $(BPF_DIR) OBJDIR=$(patsubst %/,%,$(LIBBPF_OUTPUT)) \
+ PREFIX=$(LIBBPF_DESTDIR:/=) $(LIBBPF) install_headers
$(LIBBPF_INTERNAL_HDRS): $(LIBBPF_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_HDRS_DIR)
$(call QUIET_INSTALL, $@)
$(Q)install -m 644 -t $(LIBBPF_HDRS_DIR) $<
$(LIBBPF_BOOTSTRAP): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_BOOTSTRAP_OUTPUT)
- $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) \
- DESTDIR=$(LIBBPF_BOOTSTRAP_DESTDIR:/=) prefix= \
+ $(Q)$(MAKE) -C $(BPF_DIR) OBJDIR=$(patsubst %/,%,$(LIBBPF_BOOTSTRAP_OUTPUT)) \
+ PREFIX=$(LIBBPF_BOOTSTRAP_DESTDIR:/=) \
ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) AR=$(HOSTAR) $@ install_headers
$(LIBBPF_BOOTSTRAP_INTERNAL_HDRS): $(LIBBPF_BOOTSTRAP_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_BOOTSTRAP_HDRS_DIR)
@@ -76,9 +74,9 @@
CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
-I$(or $(OUTPUT),.) \
-I$(LIBBPF_INCLUDE) \
- -I$(srctree)/kernel/bpf/ \
- -I$(srctree)/tools/include \
- -I$(srctree)/tools/include/uapi
+ -I$(srctree)/src/kernel/bpf/ \
+ -I$(srctree)/include \
+ -I$(srctree)/include/uapi
ifneq ($(BPFTOOL_VERSION),)
CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
endif
@@ -107,11 +105,7 @@
endif
ifeq ($(check_feat),1)
-ifeq ($(FEATURES_DUMP),)
-include $(srctree)/tools/build/Makefile.feature
-else
-include $(FEATURES_DUMP)
-endif
+include Makefile.feature
endif
ifeq ($(feature-disassembler-four-args), 1)
@@ -181,7 +175,7 @@
$(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP)
$(QUIET_CLANG)$(CLANG) \
-I$(or $(OUTPUT),.) \
- -I$(srctree)/tools/include/uapi/ \
+ -I$(srctree)/include/uapi/ \
-I$(LIBBPF_BOOTSTRAP_INCLUDE) \
-g -O2 -Wall -target bpf -c $< -o $@
$(Q)$(LLVM_STRIP) -g $@
@@ -198,10 +192,10 @@
CFLAGS += $(if $(BUILD_BPF_SKELS),,-DBPFTOOL_WITHOUT_SKELETONS)
-$(BOOTSTRAP_OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c
+$(BOOTSTRAP_OUTPUT)disasm.o: $(srctree)/src/kernel/bpf/disasm.c
$(QUIET_CC)$(HOSTCC) $(HOST_CFLAGS) -c -MMD $< -o $@
-$(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c
+$(OUTPUT)disasm.o: $(srctree)/src/kernel/bpf/disasm.c
$(QUIET_CC)$(CC) $(CFLAGS) -c -MMD $< -o $@
$(OUTPUT)feature.o:
@@ -225,7 +219,7 @@
$(call QUIET_CLEAN, feature-detect)
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
-clean: $(LIBBPF)-clean $(LIBBPF_BOOTSTRAP)-clean feature-detect-clean
+clean: $(LIBBPF)-clean $(LIBBPF_BOOTSTRAP)-clean
$(call QUIET_CLEAN, bpftool)
$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
$(Q)$(RM) -- $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
@@ -241,7 +235,7 @@
install: install-bin
$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(bash_compdir)
- $(Q)$(INSTALL) -m 0644 bash-completion/bpftool $(DESTDIR)$(bash_compdir)
+ $(Q)$(INSTALL) -m 0644 $(srctree)/bash-completion/bpftool $(DESTDIR)$(bash_compdir)
uninstall:
$(call QUIET_UNINST, bpftool)
@@ -249,16 +243,16 @@
$(Q)$(RM) -- $(DESTDIR)$(bash_compdir)/bpftool
doc:
- $(call descend,Documentation)
+ $(call descend,$(srctree)/docs)
doc-clean:
- $(call descend,Documentation,clean)
+ $(call descend,$(srctree)/docs,clean)
doc-install:
- $(call descend,Documentation,install)
+ $(call descend,$(srctree)/docs,install)
doc-uninstall:
- $(call descend,Documentation,uninstall)
+ $(call descend,$(srctree)/docs,uninstall)
FORCE:
|