diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-06-05 13:29:06 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-06-05 13:29:06 +0200 |
commit | dd3f7b40b4b53bca37b41697bb424b145b9fcf96 (patch) | |
tree | f4e2dcb903ad3d95e988c94202703f4362ea968d /Makefile | |
parent | 3bae56c3ed2bb948b5946b5b4f98366ec0784ed4 (diff) | |
download | freecad-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-- | Makefile | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -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 $@ |