]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - Makefile
Fix version in release package
[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 all: rpp-test-sw
8         $(call rmdir,$(TMP_WORKSPACE))
9
10 RELEASE_PREFIX = rpp-test-sw
11 include rpp-lib/common.mk
12
13 rpp-test-sw: $(TMP_WORKSPACE)
14         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-test-sw
15         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-lib
16         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.projects rpp-test-sw
17 # Previous commands do not always return non-zero exit code on build failure - invoke make directly to not miss a potential error
18         $(MAKE) -C $(CURDIR)/rpp-test-sw/Debug all
19
20 define RM_OLD_WORKSPACES
21 $(foreach i,$(wildcard $(TMP_WORKSPACE) $(basename $(TMP_WORKSPACE)).*),$(call rmdir,$(i))
22 )
23 endef
24
25 clean:
26         -$(RM_OLD_WORKSPACES)
27
28 $(TMP_WORKSPACE):
29         $(call mkdir,$(TMP_WORKSPACE))
30
31 ccs-help: $(TMP_WORKSPACE)
32         $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.help
33         $(call rmdir,$(TMP_WORKSPACE))
34
35 UNCRUSTIFY_FILES = $(shell git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$$/ {print $$1}')
36 define UNCRUSTIFY_ALL
37 $(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c rpp-lib/etc/uncrustify.cfg -o $i
38 )
39 endef
40
41 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
42 # changes you agree with.
43 uncrustify:
44         git diff --quiet # Check that the tree is clean
45         $(UNCRUSTIFY_ALL)
46
47 release: $(RELEASE_BASENAME).zip
48
49 $(RELEASE_BASENAME):: lib
50         @echo 'Get version from git'
51         $(MAKE) -f $(CURDIR)/rpp-test-sw/Makefile.version version.h
52         @echo ' '
53
54         mkdir -p $@/rpp-lib/rpp/
55         mkdir -p $@/rpp-lib/os/7.0.2_rm48
56
57         cp --parents rpp-lib/rpp-lib.lib rpp-lib/common.mk $@/
58         cp --parents rpp-lib/.ccsproject rpp-lib/.cproject rpp-lib/.project $@/
59         cp -r rpp-lib/rpp/include $@/rpp-lib/rpp/include
60         cp rpp-lib/rpp/RM48L952FlashLnk.cmd $@/rpp-lib/rpp/RM48L952FlashLnk.cmd
61         cp -r rpp-lib/os/7.0.2_rm48/include $@/rpp-lib/os/7.0.2_rm48/include
62         mv version.h $@/rpp-test-sw/cmdproc/include/version.h
63         rm $@/rpp-test-sw/Makefile.version
64
65 lib:
66         $(MAKE) -C rpp-lib/Release