Makefile 1.34 KB
Newer Older
1 2
#!/usr/bin/make
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
Maykel Moya committed
3
FORMATTER=../hacking/module_formatter.py
4 5 6

all: clean docs

7
docs: clean modules staticmin
8
	./build-site.py
Michael DeHaan committed
9 10 11
	-(cp *.ico htmlout/)
	-(cp *.jpg htmlout/)
	-(cp *.png htmlout/)
12

13 14 15 16
variables:
	(mkdir -p htmlout/)
	dot variables.dot -Tpng -o htmlout/variables.png

17
viewdocs: clean staticmin
18 19
	./build-site.py view

20
htmldocs: staticmin
Michael DeHaan committed
21
	./build-site.py rst
22 23

clean:
Michael DeHaan committed
24
	-rm -rf htmlout
25 26 27
	-rm -f .buildinfo
	-rm -f *.inv
	-rm -rf *.doctrees
28 29
	@echo "Cleaning up minified css files"
	find . -type f -name "*.min.css" -delete
30 31 32 33 34
	@echo "Cleaning up byte compiled python stuff"
	find . -regex ".*\.py[co]$$" -delete
	@echo "Cleaning up editor backup files"
	find . -type f \( -name "*~" -or -name "#*" \) -delete
	find . -type f \( -name "*.swp" \) -delete
35 36 37 38
	@echo "Cleaning up generated rst"
	-rm rst/list_of_*.rst
	-rm rst/*_by_category.rst
	-rm rst/*_module.rst
39 40 41

.PHONEY: docs clean

Maykel Moya committed
42
modules: $(FORMATTER) ../hacking/templates/rst.j2
43
	PYTHONPATH=../lib $(FORMATTER) -t rst --template-dir=../hacking/templates --module-dir=../lib/ansible/modules -o rst/
44

45
staticmin:
46
	cat _themes/srtd/static/css/theme.css | sed -e 's/^[ \t]*//g; s/[ \t]*$$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$$/d' | sed -e :a -e '$$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css