]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blobdiff - Makefile
One more rpp-lib update
[pes-rpp/rpp-test-sw.git] / Makefile
index be01ef347ff9f411940775004258093660107871..c48c42582af96b54c1c78be47801e5c5c9d07f7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,14 +4,17 @@
 # See http://processors.wiki.ti.com/index.php/Projects_-_Command_Line_Build/Create
 # and https://bugs.eclipse.org/bugs/show_bug.cgi?id=186847
 
-include rpp-lib/common.mk
+include rpp-lib/Makefile.var
 
 all: rpp-test-sw
        $(call rmdir,$(TMP_WORKSPACE))
 
+RELEASE_PREFIX = rpp-test-sw
+include rpp-lib/common.mk
+
 rpp-test-sw: $(TMP_WORKSPACE)
        $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-test-sw
-       $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-lib
+       $(ECLIPSE) -noSplash -data $(TMP_WORKSPACE) -application com.ti.ccstudio.apps.projectImport -ccs.location $(CURDIR)/rpp-lib/build/tms570_hdk
        $(ECLIPSE) -noSplash -data $(TMP_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
@@ -42,3 +45,34 @@ endef
 uncrustify:
        git diff --quiet # Check that the tree is clean
        $(UNCRUSTIFY_ALL)
+
+release: $(RELEASE_BASENAME).zip
+
+RELEASE_TARGET ?= tms570_hdk
+include rpp-lib/build/$(RELEASE_TARGET)/Makefile.config
+
+RELEASE_LIB_GIT_FILES = \
+       Makefile.var \
+       build/$(RELEASE_TARGET)/$(TARGET_LDCMD) \
+       build/Makefile.rules \
+       build/Makefile.rules.arm \
+       common.mk \
+       os/$(rpp_lib_OS)/include/ \
+       rpp/include/
+
+ifneq ($(filter lwip/src/include,$(rpp_lib_INCLUDES)),)
+RELEASE_LIB_GIT_FILES += lwip/src/include/
+endif
+
+RELEASE_LIB_GEN_FILES = Makefile.config build/$(RELEASE_TARGET)/Debug/rpp-lib.lib
+
+$(RELEASE_BASENAME):: lib
+       @echo 'Generate version.h from git'
+       mkdir -p $@/rpp-test-sw/Debug
+       $(MAKE) -C $@/rpp-test-sw/Debug -f $(CURDIR)/rpp-test-sw/Makefile.version version.h
+
+       git --git-dir=rpp-lib/.git archive --worktree-attributes --prefix=$@/rpp-lib/ HEAD $(RELEASE_LIB_GIT_FILES) | tar xf -
+       cp --parents  $(RELEASE_LIB_GEN_FILES:%=rpp-lib/%) $@/
+
+lib:
+       $(MAKE) -C rpp-lib/build/$(RELEASE_TARGET)/Debug