Makefile 1.56 KB
Newer Older
1
# Makefile for DjNRO
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
2 3 4 5
#

# You can set these variables from the command line.

6
VERSION	        = $(shell git describe --abbrev=0 | egrep -o '([0-9]+\.){1,10}[0-9]+')
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
7 8 9 10 11 12 13 14 15 16 17
SPHINXOPTS      = -D version=$(VERSION) -D release=$(VERSION)
SPHINXBUILD     = sphinx-build
PAPER           =
DOCSDIR			= docs
SRCDIR          = source
BUILDDIR        = docbuild
# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS)
SPHINXFILES     = $(DOCSDIR)/$(SRCDIR)/*
18 19
djnropytag = $(shell git describe --abbrev=0)
djnropyver = $(shell git describe --abbrev=0 | egrep -o '([0-9]+\.){1,10}[0-9]+' | sed -e 's/\./_/g')
20
name   	   = $(shell basename $(shell pwd))
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
21

22
.PHONY: help doc docclean dist distclean
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
23 24 25

help:
	@echo "Please use \`make <target>' where <target> is one of"
26 27
	@echo "  doc		to make html doc"
	@echo "  docclean	to clean up HTML docuentation"
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
28
	@echo "  html      	to make standalone sphinx HTML files"
29 30
	@echo "  dist      	to make tar dist file"
	@echo "  distclean  to delete tar dist file"
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
31
	
32
dist: 
33 34
	git archive --format tar --prefix $(name)-$(djnropyver)/ -o $(name)-$(djnropyver).tar $(djnropytag)
	gzip -f $(name)-$(djnropyver).tar
35 36
distclean:
	@rm -f *tar.gz
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
37 38 39 40 41 42 43 44 45 46 47 48 49
	
docclean:
	@rm -rf $(BUILDDIR)
	@echo "Removed $(BUILDDIR)"

doc:	$(BUILDDIR)/html

$(BUILDDIR)/html: $(SPHINXFILES)
	@mkdir -p $(BUILDDIR)
	@test -n "sphinx-build" || \
		{ echo 'sphinx-build' not found during configure; exit 1; }
	sphinx-build -b html \
		$(ALLSPHINXOPTS) -d $(BUILDDIR)/doctrees $(DOCSDIR)/$(SRCDIR) $(BUILDDIR)/html