1 # This makefile tries to build all RPP projects by calling various
2 # Eclipse commands from command line.
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
7 include rpp-lib/Makefile.var
10 $(call rmdir,$(TMP_WORKSPACE))
12 RELEASE_PREFIX = rpp-test-sw
13 include rpp-lib/common.mk
15 rpp-test-sw: $(TMP_WORKSPACE)
16 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-test-sw
17 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-lib/build/tms570_hdk
18 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.projects rpp-test-sw
19 # Previous commands do not always return non-zero exit code on build failure - invoke make directly to not miss a potential error
20 $(MAKE) -C $(CURDIR)/rpp-test-sw/Debug all
22 define RM_OLD_WORKSPACES
23 $(foreach i,$(wildcard $(TMP_WORKSPACE) $(basename $(TMP_WORKSPACE)).*),$(call rmdir,$(i))
31 $(call mkdir,$(TMP_WORKSPACE))
33 ccs-help: $(TMP_WORKSPACE)
34 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.help
35 $(call rmdir,$(TMP_WORKSPACE))
37 UNCRUSTIFY_FILES = $(shell git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$$/ {print $$1}')
39 $(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c rpp-lib/etc/uncrustify.cfg -o $i
43 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
44 # changes you agree with.
46 git diff --quiet # Check that the tree is clean
49 release: $(RELEASE_BASENAME).zip
51 RELEASE_TARGET ?= tms570_hdk
52 include rpp-lib/build/$(RELEASE_TARGET)/Makefile.config
54 $(RELEASE_BASENAME):: lib
55 @echo 'Get version from git'
56 mkdir -p $@/rpp-test-sw/Debug
57 $(MAKE) -C $@/rpp-test-sw/Debug -f $(CURDIR)/rpp-test-sw/Makefile.version version.h
59 mkdir -p $@/rpp-lib/build/$(RELEASE_TARGET)/
60 mkdir -p $@/rpp-lib/rpp/
61 mkdir -p $@/rpp-lib/os/$(rpp_lib_OS)
62 ifneq ($(filter lwip/src/include,$(rpp_lib_INCLUDES)),)
63 mkdir -p $@/rpp-lib/lwip/src
66 cp --parents rpp-lib/rpp-lib.lib rpp-lib/common.mk rpp-lib/Makefile.config $@/
67 cp --parents rpp-lib/.ccsproject rpp-lib/.cproject rpp-lib/.project $@/
68 cp -r rpp-lib/rpp/include $@/rpp-lib/rpp/include
69 cp --parents rpp-lib/build/$(RELEASE_TARGET)/$(TARGET_LDCMD) $@/
70 cp -r rpp-lib/os/$(rpp_lib_OS)/include $@/rpp-lib/os/$(rpp_lib_OS)/include
71 ifneq ($(filter lwip/src/include,$(rpp_lib_INCLUDES)),)
72 cp -r rpp-lib/lwip/src/include $@/rpp-lib/lwip/src/include
76 $(MAKE) -C rpp-lib/build/$(RELEASE_TARGET)/Release