%.gz: %
rm -f $@ && gzip --stdout $^ > $@
+ifeq ($(WITH_EMACS),1)
+$(DOCBUILDDIR)/.roff.stamp sphinx-html sphinx-texinfo: docstring.stamp
+endif
+
# Sequentialize the calls to sphinx-build to avoid races with
# reading/writing cached state. This uses GNU make specific
# "order-only" prerequisites.