From c5e718976a49ede9d15a635c4772fa1aa6ca335a Mon Sep 17 00:00:00 2001 From: Slava Date: Thu, 31 Mar 2016 13:30:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20so?= =?UTF-8?q?uth=20=D0=B2=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8d97df39..800fb2f8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: requirements requirements-upgrade freeze syncdb run run-public makemessages compilemessages collectstatic cloc clean user +.PHONY: requirements requirements-upgrade freeze syncdb run run-public makemessages compilemessages collectstatic cloc clean user south project_name=proj @@ -37,6 +37,17 @@ collectstatic: user: -@ipython manage.py createsuperuser +# If the first argument is "south"... +ifeq (south,$(firstword $(MAKECMDGOALS))) + # use the rest as arguments for "south" + RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) + # ...and turn them into do-nothing targets + $(eval $(RUN_ARGS):;@:) +endif +south: + -@python manage.py schemamigration $(RUN_ARGS) --auto + -@python manage.py migrate $(RUN_ARGS) + cloc: -@echo "### Counting lines of code within the project" -@echo "# Total:" ; find . -iregex '.*\.py\|.*\.js\|.*\.html\|.*\.css' -type f -exec cat {} + | wc -l