$(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym
$(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
-notmuch.sym: lib/notmuch.h
- printf "{\nglobal:\n" > notmuch.sym
- sed -n 's/^[[:space:]]*\(notmuch_[a-z_]*\)[[:space:]]*(.*/'"`printf "\t"`"'\1;/p' $< >> notmuch.sym
- printf "local: *;\n};\n" >> notmuch.sym
+notmuch.sym: lib/notmuch.h $(libnotmuch_modules)
+ sh lib/gen-version-script.sh $< $(libnotmuch_modules) > $@
$(dir)/$(SONAME): $(dir)/$(LIBNAME)
ln -sf $(LIBNAME) $@