Skip to content

Commit e8a9d96

Browse files
committed
Merge branch 'bpf-libbpf-cleanups'
Jesper Dangaard Brouer says: ==================== This patchset contains some small improvements and cleanup for the Makefile in tools/lib/bpf/. It worries me that the libbpf.so shared library is not versioned, but it not addressed in this patchset. ==================== Signed-off-by: Daniel Borkmann <[email protected]>
2 parents f2f742f + 7110d80 commit e8a9d96

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

tools/lib/bpf/Makefile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export prefix libdir src obj
9393
# Shell quotes
9494
libdir_SQ = $(subst ','\'',$(libdir))
9595
libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
96-
plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
9796

9897
LIB_FILE = libbpf.a libbpf.so
9998

@@ -150,7 +149,7 @@ CMD_TARGETS = $(LIB_FILE)
150149

151150
TARGETS = $(CMD_TARGETS)
152151

153-
all: fixdep $(VERSION_FILES) all_cmd
152+
all: fixdep all_cmd
154153

155154
all_cmd: $(CMD_TARGETS)
156155

@@ -169,21 +168,11 @@ $(OUTPUT)libbpf.so: $(BPF_IN)
169168
$(OUTPUT)libbpf.a: $(BPF_IN)
170169
$(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
171170

172-
define update_dir
173-
(echo $1 > $@.tmp; \
174-
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
175-
rm -f $@.tmp; \
176-
else \
177-
echo ' UPDATE $@'; \
178-
mv -f $@.tmp $@; \
179-
fi);
180-
endef
181-
182171
define do_install
183172
if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
184173
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
185174
fi; \
186-
$(INSTALL) $1 '$(DESTDIR_SQ)$2'
175+
$(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2'
187176
endef
188177

189178
install_lib: all_cmd
@@ -192,7 +181,8 @@ install_lib: all_cmd
192181

193182
install_headers:
194183
$(call QUIET_INSTALL, headers) \
195-
$(call do_install,bpf.h,$(prefix)/include/bpf,644)
184+
$(call do_install,bpf.h,$(prefix)/include/bpf,644); \
185+
$(call do_install,libbpf.h,$(prefix)/include/bpf,644);
196186

197187
install: install_lib
198188

@@ -203,7 +193,7 @@ config-clean:
203193
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
204194

205195
clean:
206-
$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
196+
$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so .*.d .*.cmd \
207197
$(RM) LIBBPF-CFLAGS
208198
$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
209199

0 commit comments

Comments
 (0)