-define build_cdt
-all: $1
-$1: .workspace
- $(ECLIPSE) -noSplash -data .workspace -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import $(CURDIR)/apps/$1
- $(ECLIPSE) -noSplash -data .workspace -application org.eclipse.cdt.managedbuilder.core.headlessbuild -build $1
+.PHONY: all clean lib
+
+# Multiple submakes are invoked in the same directory - e.g.
+# rpp-test-suite/Debug/GNUmakefile invokes Debug/GNUmakefile. We don't
+# want these targets to be invoked twice so we forbid parallel
+# invocation in this Makefile. Note that the submakes still run in
+# parallel.
+.NOTPARALLEL:
+
+subdir-build/%: print-targets
+ $(MAKE) -C $(@:subdir-%=%) $(MAKECMDGOALS)
+
+
+UNCRUSTIFY_FILES = $(shell etc/git-ls-files-attr uncrustify)
+UNCRUSTIFY_CFG = etc/uncrustify.cfg
+define UNCRUSTIFY_ALL
+$(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c $(UNCRUSTIFY_CFG) -o $i
+)