+$(DOCS_GENERATED_DIR)/.siphon.done: $(SIPHON_DOCS)
+ @cp $(DOCS_GENERATED_DIR)/clicmd.rst $(BUILDDIR_SRC)/cli-reference/index.rst
+ @mkdir -p $(BUILDDIR_SRC)/cli-reference/clis
+ @cp -r $(DOCS_GENERATED_DIR)/clicmd.rst.dir/* $(BUILDDIR_SRC)/cli-reference/clis
+ @touch $(DOCS_GENERATED_DIR)/.siphon.done
+
+.PHONY: clean-siphons
+clean-siphons:
+ @( \
+ echo "find $(SIPHON_INPUT) -newer $(DOCS_GENERATED_DIR)/.siphon.done" ; \
+ cd $(WS_ROOT); \
+ if [ -f $(DOCS_GENERATED_DIR)/.siphon.done ] && \
+ [ $$(find $(SIPHON_INPUT) -type f -newer $(DOCS_GENERATED_DIR)/.siphon.done \
+ -not -name '*.md' \
+ -not -name '*.rst' | wc -l) -gt 0 ]; then \
+ rm -r $(DOCS_GENERATED_DIR); \
+ echo "removing... $(DOCS_GENERATED_DIR)"; \
+ fi; \
+ )
+
+${BUILDDIR}/.docsrc.sync.ok:
+ @echo "Copying docs files..."
+ @cp -r $(DOCS_DIR) ${BUILDDIR_SRC}
+ @cd ${BUILDDIR_SRC} && find . -type l -exec cp --remove-destination -L ${DOCS_DIR}/{} {} \;
+ @touch $(BUILDDIR)/.docsrc.sync.ok
+
+.PHONY: copy-src
+copy-src: ${BUILDDIR}/.docsrc.sync.ok
+ @echo "Syncing changed files..."
+ @cd $(DOCS_DIR) && find . -type f -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp {} ${BUILDDIR_SRC}/{} \;
+ @cd ${DOCS_DIR} && find . -type l -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp --remove-destination -L ${DOCS_DIR}/{} ${BUILDDIR_SRC}/{} \;
+ @cd ${DOCS_DIR} && find -L . -type f -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp --remove-destination -L ${DOCS_DIR}/{} ${BUILDDIR_SRC}/{} \;
+ @touch $(BUILDDIR)/.docsrc.sync.ok