Skip to content

Instantly share code, notes, and snippets.

@tschm
Created September 2, 2016 13:59
Show Gist options
  • Save tschm/b441e4d499aae6fc1ba4bb8bf35c34cc to your computer and use it in GitHub Desktop.
Save tschm/b441e4d499aae6fc1ba4bb8bf35c34cc to your computer and use it in GitHub Desktop.
Makefile to document a python project
# Makefile
#
ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SPHINXBUILD = sphinx-build
BUILDDIR = ${ROOT_DIR}/build
SOURCEDIR = ${ROOT_DIR}/source
PROJECT = pylobnek
.PHONY: html
html:
rm -rf $(BUILDDIR)/*
$(SPHINXBUILD) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html
.PHONY: publish
publish:
@$(MAKE) html
ssh thomas@quantsrv "rm -rf /var/www/html/$(PROJECT)/*"
scp -r build/html/* thomas@quantsrv:/var/www/html/$(PROJECT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment