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. ====================
Unified · Split
| @@ -93,7 +93,6 @@ export prefix libdir src obj · 92 unmodified lines | ||
| 93 | 93 | # Shell quotes |
| 94 | 94 | libdir_SQ = $(subst ','\'',$(libdir)) |
| 95 | 95 | libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) |
| 96 | −plugin_dir_SQ = $(subst ','\'',$(plugin_dir)) | |
| 97 | 96 | |
| 98 | 97 | LIB_FILE = libbpf.a libbpf.so |
| 99 | 98 | |
| @@ -150,7 +149,7 @@ CMD_TARGETS = $(LIB_FILE) · 50 unmodified lines | ||
| 150 | 149 | |
| 151 | 150 | TARGETS = $(CMD_TARGETS) |
| 152 | 151 | |
| 153 | −all: fixdep $(VERSION_FILES) all_cmd | |
| 152 | +all: fixdep all_cmd | |
| 154 | 153 | |
| 155 | 154 | all_cmd: $(CMD_TARGETS) |
| 156 | 155 | |
| @@ -169,21 +168,11 @@ $(OUTPUT)libbpf.so: $(BPF_IN) · 12 unmodified lines | ||
| 169 | 168 | $(OUTPUT)libbpf.a: $(BPF_IN) |
| 170 | 169 | $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^ |
| 171 | 170 | |
| 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 | − | |
| 182 | 171 | define do_install |
| 183 | 172 | if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ |
| 184 | 173 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \ |
| 185 | 174 | fi; \ |
| 186 | − $(INSTALL) $1 '$(DESTDIR_SQ)$2' | |
| 175 | + $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2' | |
| 187 | 176 | endef |
| 188 | 177 | |
| 189 | 178 | install_lib: all_cmd |
| @@ -192,7 +181,8 @@ install_lib: all_cmd · 2 unmodified lines | ||
| 192 | 181 | |
| 193 | 182 | install_headers: |
| 194 | 183 | $(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); | |
| 196 | 186 | |
| 197 | 187 | install: install_lib |
| 198 | 188 | |
| @@ -203,7 +193,7 @@ config-clean: · 4 unmodified lines | ||
| 203 | 193 | $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null |
| 204 | 194 | |
| 205 | 195 | 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 \ | |
| 207 | 197 | $(RM) LIBBPF-CFLAGS |
| 208 | 198 | $(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf |
| 209 | 199 | |