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 include rpp-lib/common.mk
14 TARGET ?= $(error TARGET variable not defined)
16 rpp-test-sw: $(TMP_WORKSPACE)
17 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-test-sw
18 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-lib/build/$(TARGET)
19 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.projects rpp-test-sw
20 # Previous commands do not always return non-zero exit code on build failure - invoke make directly to not miss a potential error
21 $(MAKE) -C $(CURDIR)/rpp-test-sw/Debug all
23 define RM_OLD_WORKSPACES
24 $(foreach i,$(wildcard $(TMP_WORKSPACE) $(basename $(TMP_WORKSPACE)).*),$(call rmdir,$(i))
32 $(call mkdir,$(TMP_WORKSPACE))
34 ccs-help: $(TMP_WORKSPACE)
35 $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.help
36 $(call rmdir,$(TMP_WORKSPACE))
38 UNCRUSTIFY_FILES = $(shell git ls-files|git check-attr --stdin uncrustify|awk -F: '/uncrustify: set$$/ {print $$1}')
40 $(foreach i,$(UNCRUSTIFY_FILES),git show HEAD:$i | uncrustify -c rpp-lib/etc/uncrustify.cfg -o $i
44 # Usage: Run 'make uncrustify' and then 'git add -p' to commit the
45 # changes you agree with.
47 git diff --quiet # Check that the tree is clean
50 $(eval $(call release_rules,rpp-test-sw))
52 release: $(RELEASE_BASENAME).zip
54 RELEASE_TARGET = $(TARGET)
56 RELEASE_LIB_GIT_FILES = \
58 build/$(RELEASE_TARGET)/$(TARGET_LDCMD) \
59 build/Makefile.rules \
60 build/Makefile.rules.arm \
62 os/$(rpp_lib_OS)/include/ \
65 RELEASE_LIB_GEN_FILES = Makefile.config build/$(RELEASE_TARGET)/Debug/rpp-lib.lib
67 $(RELEASE_BASENAME):: lib
68 @echo 'Generate version.h from git'
69 mkdir -p $@/rpp-test-sw/Debug
70 $(MAKE) -C $@/rpp-test-sw/Debug -f $(CURDIR)/rpp-test-sw/Makefile.version version.h
71 git --git-dir=rpp-lib/.git archive --worktree-attributes --prefix=$@/rpp-lib/ HEAD $(RELEASE_LIB_GIT_FILES) | tar xf -
72 ifneq ($(filter lwip/src/include,$(rpp_lib_INCLUDES)),)
73 git --git-dir=rpp-lib/lwip/.git archive --worktree-attributes --prefix=$@/rpp-lib/lwip/ HEAD src/include/ | tar xf -
75 cp --parents $(RELEASE_LIB_GEN_FILES:%=rpp-lib/%) $@/
78 $(MAKE) -C rpp-lib .git/info/attributes # Setup ignored files
79 $(MAKE) -C rpp-lib/build/$(RELEASE_TARGET)/Debug