]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - Makefile
Merge branch 'master' of rtime.felk.cvut.cz:rpp-test-sw
[pes-rpp/rpp-test-sw.git] / Makefile
1 # This makefile tries to build all RPP projects by calling various
2 # Eclipse commands from command line.
3 #
4 # See http://processors.wiki.ti.com/index.php/Projects_-_Command_Line_Build/Create
5 # and https://bugs.eclipse.org/bugs/show_bug.cgi?id=186847
6
7 include rpp-lib/common.mk
8
9 all: rpp-test-sw
10         $(call rmdir,$(TMP_WORKSPACE))
11
12 rpp-test-sw: $(TMP_WORKSPACE)
13         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-test-sw
14         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-lib
15         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.projects rpp-test-sw
16 # Previous commands do not always return non-zero exit code on build failure - invoke make directly to not miss a potential error
17         $(MAKE) -C $(CURDIR)/rpp-test-sw/Debug all
18
19 define RM_OLD_WORKSPACES
20 $(foreach i,$(wildcard $(TMP_WORKSPACE) $(basename $(TMP_WORKSPACE)).*),$(call rmdir,$(i))
21 )
22 endef
23
24 clean:
25         -$(RM_OLD_WORKSPACES)
26
27 $(TMP_WORKSPACE):
28         $(call mkdir,$(TMP_WORKSPACE))
29
30 ccs-help: $(TMP_WORKSPACE)
31         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.help
32         $(call rmdir,$(TMP_WORKSPACE))
33
34 UNCRUSTIFY_FILES = $(shell git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$$/ {print $$1}')
35 define UNCRUSTIFY_ALL
36 $(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c rpp-lib/etc/uncrustify.cfg -o $i
37 )
38 endef
39
40 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
41 # changes you agree with.
42 uncrustify:
43         git diff --quiet # Check that the tree is clean
44         $(UNCRUSTIFY_ALL)