From dd3f7b40b4b53bca37b41697bb424b145b9fcf96 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 5 Jun 2016 13:29:06 +0200 Subject: o Adding a formatting target, reformatting all. --- Makefile | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d88fa9c..d547c60 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,26 @@ -PY=BoxerPanelWidget.py BoxerDockWidget.py +UI=BoxerDockWidget.ui +GEN_PY=$(patsubst %.ui,%.py,$(UI)) +SRC_PY=$(filter-out $(GEN_PY), $(wildcard *.py)) +FORMATTED_COOKIE=$(patsubst %,.formatted.%,$(SRC_PY)) -all: $(PY) +all: $(GEN_PY) -clean: - rm -f $(PY) +reformat: clean-formatted-cookie format -#BoxerPanelWidget.py: BoxerPanelWidget.ui +format: $(FORMATTED_COOKIE) + +clean: clean-gen clean-formatted-cookie + +clean-formatted-cookie: + rm -f $(FORMATTED_COOKIE) + +clean-gen: + rm -f $(GEN_PY) %.py: %.ui pyside-uic -o $@ $< + +.formatted.%.py: %.py .style.yapf + @echo yapf -i $(filter %.py,$<) + @yapf -i $(filter %.py,$<); if [ "$$?" = 2 ]; then exit 0; fi + @touch $@ -- cgit v1.2.3