History

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. ====================

Daniel Borkmann committed 8 years ago

Commit e8a9d962 parents f2f742f 7110d801 file · +5 −15Browse files

Unified · Split

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