Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
improve makefile dependencies
libbpftune should depend on headers so that if they change we
rebuild bpftune.  Also include the git SHA string in the version
where an explicit version is not provided.

Signed-off-by: Alan Maguire <[email protected]>
  • Loading branch information
alan-maguire committed Nov 25, 2024
commit fc0af43a2eb4405e39b61cc3535cbd58bc0748ed
8 changes: 6 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ CONF = $(DESTDIR)/$(confprefix)
CONFPATH = $(CONF)/ld.so.conf.d

KERNEL_REL := $(shell uname -r)
GIT_SHA := $(shell git rev-parse HEAD)

ifeq ($(BPFTUNE_VERSION),)
BPFTUNE_VERSION := $(KERNEL_REL)
BPFTUNE_VERSION := $(KERNEL_REL)-$(GIT_SHA)
endif

VERSION = 0.1.3
Expand Down Expand Up @@ -104,6 +105,9 @@ BPF_SKELS = $(patsubst %,%.skel.h,$(TUNERS)) probe.skel.h
LEGACY_BPF_SKELS = $(patsubst %.skel.h,%.skel.legacy.h,$(BPF_SKELS))
NOBTF_BPF_SKELS = $(patsubst %.skel.h,%.skel.nobtf.h,$(BPF_SKELS))

BPFTUNE_HDRS = ../include/bpftune/libbpftune.h \
../include/bpftune/bpftune.h

.DELETE_ON_ERROR:

.PHONY: clean
Expand Down Expand Up @@ -147,7 +151,7 @@ $(OPATH)bpftune: bpftune.c $(OPATH)bpftune.o $(OPATH)libbpftune.so
$(QUIET_LINK)$(CC) $(CFLAGS) $(OPATH)bpftune.o -o $@ \
$(LDFLAGS) $(LDLIBS) -lbpftune

$(OPATH)libbpftune.so: libbpftune.c ../include/bpftune/libbpftune.h $(OPATH)libbpftune.o
$(OPATH)libbpftune.so: libbpftune.c $(BPFTUNE_HDRS) $(OPATH)libbpftune.o
$(CC) $(CFLAGS) -Wl,--version-script=$(VERSION_SCRIPT) \
-Wl,--soname,$(notdir $@).$(VERSION) \
-shared -o $(@).$(VERSION) \
Expand Down