Skip to content

Commit

Permalink
tools: bpf: consistent make bpf_install
Browse files Browse the repository at this point in the history
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: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Jiri Benc authored and Daniel Borkmann committed Mar 9, 2018
1 parent 5a8997f commit fde68c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/bpf/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# SPDX-License-Identifier: GPL-2.0
include ../scripts/Makefile.include

prefix = /usr
prefix ?= /usr/local

CC = gcc
LEX = flex
YACC = bison
MAKE = make
INSTALL ?= install

CFLAGS += -Wall -O2
CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/include/uapi -I$(srctree)/include
Expand Down Expand Up @@ -67,9 +68,10 @@ clean: bpftool_clean
$(OUTPUT)bpf_asm $(OUTPUT)bpf_exp.yacc.* $(OUTPUT)bpf_exp.lex.*

install: bpftool_install
install $(OUTPUT)bpf_jit_disasm $(prefix)/bin/bpf_jit_disasm
install $(OUTPUT)bpf_dbg $(prefix)/bin/bpf_dbg
install $(OUTPUT)bpf_asm $(prefix)/bin/bpf_asm
$(INSTALL) -m 0755 -d $(DESTDIR)$(prefix)/bin
$(INSTALL) $(OUTPUT)bpf_jit_disasm $(DESTDIR)$(prefix)/bin/bpf_jit_disasm
$(INSTALL) $(OUTPUT)bpf_dbg $(DESTDIR)$(prefix)/bin/bpf_dbg
$(INSTALL) $(OUTPUT)bpf_asm $(DESTDIR)$(prefix)/bin/bpf_asm

bpftool:
$(MAKE) -C bpftool
Expand Down

0 comments on commit fde68c5

Please sign in to comment.