Skip to content

Commit

Permalink
Add install target to libbpf-tools
Browse files Browse the repository at this point in the history
We plan to put those tools in separate rpm,
so we need a way to install them.

Adding install target with standard DESTDIR
and prefix make variables.

Signed-off-by: Jiri Olsa <[email protected]>
  • Loading branch information
olsajiri authored and yonghong-song committed Feb 6, 2021
1 parent bdd7337 commit b639f02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libbpf-tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ LIBBPF_OBJ := $(abspath $(OUTPUT)/libbpf.a)
INCLUDES := -I$(OUTPUT)
CFLAGS := -g -O2 -Wall
ARCH := $(shell uname -m | sed 's/x86_64/x86/')
INSTALL ?= install
prefix ?= /usr/local

APPS = \
biolatency \
Expand Down Expand Up @@ -92,6 +94,11 @@ $(LIBBPF_OBJ): $(wildcard $(LIBBPF_SRC)/*.[ch]) | $(OUTPUT)/libbpf
INCLUDEDIR= LIBDIR= UAPIDIR= \
install

install: $(APPS)
$(call msg, INSTALL libbpf-tools)
$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(prefix)/bin
$(Q)$(INSTALL) $(APPS) $(DESTDIR)$(prefix)/bin

# delete failed targets
.DELETE_ON_ERROR:
# keep intermediate (.skel.h, .bpf.o, etc) targets
Expand Down

0 comments on commit b639f02

Please sign in to comment.