From 2d5158d31cd6de5b53a9c1622bc42be170a23869 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Mon, 5 Sep 2016 22:38:41 -0300 Subject: [PATCH] Makefile: add support for setup.py in targets link/clean The `link` and `clean` targets, very useful under development environments, have supported directories containing `Makefiles`. It turns out that for some plugins it may be enough (and more Pythonic) to just have `setup.py` files, so let's support that. Signed-off-by: Cleber Rosa --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 71fea1ee..fc4a4a53 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,10 @@ clean: rm -rf docs/build find docs/source/api/ -name '*.rst' -delete for MAKEFILE in $(AVOCADO_PLUGINS); do\ - if test -f $$MAKEFILE/Makefile; then AVOCADO_DIRNAME=$(AVOCADO_DIRNAME) make -C $$MAKEFILE unlink &>/dev/null && echo ">> UNLINK $$MAKEFILE" || echo ">> SKIP $$MAKEFILE"; fi;\ + if test -f $$MAKEFILE/Makefile -o -f $$MAKEFILE/setup.py; then echo ">> UNLINK $$MAKEFILE";\ + if test -f $$MAKEFILE/Makefile; then AVOCADO_DIRNAME=$(AVOCADO_DIRNAME) make -C $$MAKEFILE unlink &>/dev/null;\ + elif test -f $$MAKEFILE/setup.py; then cd $$MAKEFILE; $(PYTHON) setup.py develop --uninstall $(shell $(PYTHON26) || echo --user); cd -; fi;\ + else echo ">> SKIP $$MAKEFILE"; fi;\ done $(PYTHON) setup.py develop --uninstall $(shell $(PYTHON26) || echo --user) rm -rf avocado.egg-info @@ -152,7 +155,10 @@ develop: link: develop for MAKEFILE in $(AVOCADO_PLUGINS); do\ - if test -f $$MAKEFILE/Makefile; then AVOCADO_DIRNAME=$(AVOCADO_DIRNAME) make -C $$MAKEFILE link &>/dev/null && echo ">> LINK $$MAKEFILE" || echo ">> SKIP $$MAKEFILE"; fi;\ + if test -f $$MAKEFILE/Makefile -o -f $$MAKEFILE/setup.py; then echo ">> LINK $$MAKEFILE";\ + if test -f $$MAKEFILE/Makefile; then AVOCADO_DIRNAME=$(AVOCADO_DIRNAME) make -C $$MAKEFILE link &>/dev/null;\ + elif test -f $$MAKEFILE/setup.py; then cd $$MAKEFILE; $(PYTHON) setup.py develop $(shell $(PYTHON26) || echo --user); cd -; fi;\ + else echo ">> SKIP $$MAKEFILE"; fi;\ done spell: -- GitLab