]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/commitdiff
Add Makefile for command line compilation
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Aug 2014 18:04:56 +0000 (20:04 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Aug 2014 18:04:56 +0000 (20:04 +0200)
Currently, we use Eclipse driven build. This is a quick way for our
buildbot to do something useful. Later, we should write Makefile by hand
in the same way as for rpp-lib.

Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..713a8a6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+# This makefile tries to build all RPP projects by calling various
+# Eclipse commands from command line.
+#
+# See http://processors.wiki.ti.com/index.php/Projects_-_Command_Line_Build/Create
+# and https://bugs.eclipse.org/bugs/show_bug.cgi?id=186847
+
+ECLIPSE=/opt/ti/ccsv5/eclipse/eclipse
+
+WORKSPACE:=$(shell mktemp --dry-run --tmpdir -d rpp-test-sw-workspace.XXXXXXXXXX)
+
+all: rpp-test-sw
+       rm -rf $(WORKSPACE)
+
+rpp-test-sw: $(WORKSPACE)
+       $(ECLIPSE) -noSplash -data $(WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-test-sw
+       $(ECLIPSE) -noSplash -data $(WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-lib
+       $(ECLIPSE) -noSplash -data $(WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.projects rpp-test-sw
+# Previous commands do not always return non-zero exit code on build failure - invoke make directly to not miss a potential error
+       $(MAKE) -C $(CURDIR)/rpp-test-sw/Debug all
+
+clean:
+       rm -rf $(wildcard $(dir $(WORKSPACE))rpp-test-sw-workspace.*)
+
+$(WORKSPACE):
+       mkdir -p $(WORKSPACE)
+
+# Usage: $(call build_ccs,project directory) or
+#       $(call build_ccs,,project name) for project in current directory
+define build_ccs
+all: $(or $2,$(notdir $1))
+$(or $2,$(notdir $1)): $(WORKSPACE)
+       $(ECLIPSE) -noSplash -data $(WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(if $1,$(CURDIR)/$1,$(CURDIR))
+       $(ECLIPSE) -noSplash -data $(WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.projects $(or $2,$(notdir $1))
+# Previous commands do not always return non-zero exit code on build failure - invoke make directly to not miss a potential error
+       $(MAKE) -C $(CURDIR)/$1/Debug all
+endef
+
+ccs-help: $(WORKSPACE)
+       $(ECLIPSE) -noSplash -data $(WORKSPACE) -application com.ti.ccstudio.apps.projectBuild -ccs.help