aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-06-05 13:29:06 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-06-05 13:29:06 +0200
commitdd3f7b40b4b53bca37b41697bb424b145b9fcf96 (patch)
treef4e2dcb903ad3d95e988c94202703f4362ea968d /Makefile
parent3bae56c3ed2bb948b5946b5b4f98366ec0784ed4 (diff)
downloadfreecad-boxer-dd3f7b40b4b53bca37b41697bb424b145b9fcf96.tar.gz
freecad-boxer-dd3f7b40b4b53bca37b41697bb424b145b9fcf96.tar.bz2
freecad-boxer-dd3f7b40b4b53bca37b41697bb424b145b9fcf96.tar.xz
freecad-boxer-dd3f7b40b4b53bca37b41697bb424b145b9fcf96.zip
o Adding a formatting target, reformatting all.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 20 insertions, 5 deletions
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 $@