]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/commitdiff
Add uncrustify target to the toplevel Makefile
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 25 Nov 2014 21:44:02 +0000 (22:44 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 25 Nov 2014 22:27:35 +0000 (23:27 +0100)
.gitattributes [new file with mode: 0644]
Makefile
rpp-lib
rpp-test-sw/cmdproc/.gitattributes [new file with mode: 0644]

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..3b67e28
--- /dev/null
@@ -0,0 +1 @@
+*.[ch] uncrustify
index d5ab5eda8f6ba77dbd9799c623e275ce280bca91..af67834a6a43307553287e25c8f2626b66584b51 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,3 +25,15 @@ $(TMP_WORKSPACE):
 ccs-help: $(TMP_WORKSPACE)
        $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.help
        $(call rmdir,$(TMP_WORKSPACE))
+
+UNCRUSTIFY_FILES = $(shell git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$$/ {print $$1}')
+define UNCRUSTIFY_ALL
+$(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c rpp-lib/etc/uncrustify.cfg -o $i
+)
+endef
+
+# Usage: Run 'make uncrustify' and then 'git add -p' to commit the
+# changes you agree with.
+uncrustify:
+       git diff --quiet # Check that the tree is clean
+       $(UNCRUSTIFY_ALL)
diff --git a/rpp-lib b/rpp-lib
index 1421295dac56f67cf6860742156598e76406851c..4f70b517b84800ce7ba1326156ae278c4601a83f 160000 (submodule)
--- a/rpp-lib
+++ b/rpp-lib
@@ -1 +1 @@
-Subproject commit 1421295dac56f67cf6860742156598e76406851c
+Subproject commit 4f70b517b84800ce7ba1326156ae278c4601a83f
diff --git a/rpp-test-sw/cmdproc/.gitattributes b/rpp-test-sw/cmdproc/.gitattributes
new file mode 100644 (file)
index 0000000..5261dee
--- /dev/null
@@ -0,0 +1,3 @@
+* -uncrustify
+*tisci* uncrustify
+*tms570* uncrustify