Commit fde68c5b authored by Jiri Benc's avatar Jiri Benc Committed by Daniel Borkmann

tools: bpf: consistent make bpf_install

Currently, make bpf_install in tools/ does not respect DESTDIR. Moreover, it
installs to /usr/bin/ unconditionally.

Let it respect DESTDIR and allow prefix to be specified. Also, to be more
consistent with bpftool and with the usual customs, default the prefix to
/usr/local instead of /usr.
Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 5a8997f2
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
include ../scripts/Makefile.include include ../scripts/Makefile.include
prefix = /usr prefix ?= /usr/local
CC = gcc CC = gcc
LEX = flex LEX = flex
YACC = bison YACC = bison
MAKE = make MAKE = make
INSTALL ?= install
CFLAGS += -Wall -O2 CFLAGS += -Wall -O2
CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/include/uapi -I$(srctree)/include CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/include/uapi -I$(srctree)/include
...@@ -67,9 +68,10 @@ clean: bpftool_clean ...@@ -67,9 +68,10 @@ clean: bpftool_clean
$(OUTPUT)bpf_asm $(OUTPUT)bpf_exp.yacc.* $(OUTPUT)bpf_exp.lex.* $(OUTPUT)bpf_asm $(OUTPUT)bpf_exp.yacc.* $(OUTPUT)bpf_exp.lex.*
install: bpftool_install install: bpftool_install
install $(OUTPUT)bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm $(INSTALL) -m 0755 -d $(DESTDIR)$(prefix)/bin
install $(OUTPUT)bpf_dbg $(prefix)/bin/bpf_dbg $(INSTALL) $(OUTPUT)bpf_jit_disasm $(DESTDIR)$(prefix)/bin/bpf_jit_disasm
install $(OUTPUT)bpf_asm $(prefix)/bin/bpf_asm $(INSTALL) $(OUTPUT)bpf_dbg $(DESTDIR)$(prefix)/bin/bpf_dbg
$(INSTALL) $(OUTPUT)bpf_asm $(DESTDIR)$(prefix)/bin/bpf_asm
bpftool: bpftool:
$(MAKE) -C bpftool $(MAKE) -C bpftool
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment