+ $(Q)$(LN_S) -f $< $@
+
+libbtrfsutil/%.o: libbtrfsutil/%.c
+ @echo " [CC] $@"
+ $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) -o $@ -c $< -o $@
+
+libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects)
+ @echo " [LD] $@"
+ $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) $(libbtrfsutil_objects) \
+ -shared -Wl,-soname,libbtrfsutil.so.$(libbtrfsutil_major) -o $@
+
+libbtrfsutil.a: $(libbtrfsutil_objects)
+ @echo " [AR] $@"
+ $(Q)$(AR) cr $@ $^
+
+libbtrfsutil.so.$(libbtrfsutil_major) libbtrfsutil.so: libbtrfsutil.so.$(libbtrfsutil_version)
+ @echo " [LN] $@"
+ $(Q)$(LN_S) -f $< $@
+
+ifeq ($(PYTHON_BINDINGS),1)
+libbtrfsutil_python: libbtrfsutil.so libbtrfsutil/btrfsutil.h
+ @echo " [PY] libbtrfsutil"
+ $(Q)cd libbtrfsutil/python; \
+ CFLAGS= LDFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build
+
+.PHONY: libbtrfsutil_python
+endif