X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=Makefile;h=df7847bfd201c4666851495dfa6962a4355d0c18;hb=HEAD;hp=c0a4e20ab01e8ed9ae2936d81e0f9a1e62004971;hpb=74a237a62c680e8b6e544cf887cd4e5c37a0547b;p=xnet diff --git a/Makefile b/Makefile index c0a4e20..df7847b 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,84 @@ MANAGE_PY = python manage.py +ROOT_DIR = xnet +APPS = $(shell find $(ROOT_DIR) -name 'models.py' | sed 's,/models.py$$,,; s:.*/::') +# In order to help newcomers, this variable holds a full doc of the current Makefile. +# Please keep it up to date with regard to new commands. +# +# Structure: +# - Group commands in sections +# - Align command descriptions + +define help +Makefile command help + +Available targets are: + +Running: + run: Start a development server on http://127.0.0.1:8000/ + shell: Open a development Python shell using the current database + +Database: + resetdb: Reinitialize the database schema + +Testing: + test: Run the test suite + +Misc: + clean: Cleanup all temporary files (*.pyc, ...) + doc: Generate the documentation + help: Display this help message +endef + default: all all: +help: + @echo -n "" # Don't display extra lines. + $(info $(help)) + + +.PHONY: all default help + + +# Running +# ======= + run: $(MANAGE_PY) runserver +shell: + $(MANAGE_PY) shell + + +.PHONY: run shell + +# Development +# =========== + test: - $(MANAGE_PY) test example + $(MANAGE_PY) test $(APPS) resetdb: rm -f xnet/db.sqlite $(MANAGE_PY) syncdb --noinput + +.PHONY: resetdb test + +# Misc +# ==== + +clean: + find . "(" -name "*.pyc" -or -name "*.pyo" -or -name "*.mo" ")" -delete + find . -type d -empty -delete + +doc: + $(MAKE) -C doc html + + +.PHONY: clean doc