X-Git-Url: http://rtime.felk.cvut.cz/gitweb/rpp-test-sw.git/blobdiff_plain/22d0289af5d154016e69a69873fa2ebd3bac2c08..HEAD:/Makefile diff --git a/Makefile b/Makefile index 6314899..165a428 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,18 @@ # 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/Makefile.var + all: rpp-test-sw $(call rmdir,$(TMP_WORKSPACE)) -RELEASE_PREFIX = rpp-test-sw include rpp-lib/common.mk +TARGET ?= $(error TARGET variable not defined) + 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/$(TARGET) $(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 @@ -44,23 +47,33 @@ uncrustify: git diff --quiet # Check that the tree is clean $(UNCRUSTIFY_ALL) +$(eval $(call release_rules,rpp-test-sw)) + release: $(RELEASE_BASENAME).zip +RELEASE_TARGET = $(TARGET) + +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/ + +RELEASE_LIB_GEN_FILES = Makefile.config build/$(RELEASE_TARGET)/Debug/rpp-lib.lib + $(RELEASE_BASENAME):: lib - @echo 'Get version from git' + @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 - - mkdir -p $@/rpp-lib/rpp/ - mkdir -p $@/rpp-lib/os/7.0.2_tms570 - mkdir -p $@/rpp-lib/lwip/src - - cp --parents rpp-lib/rpp-lib.lib rpp-lib/common.mk $@/ - cp --parents rpp-lib/.ccsproject rpp-lib/.cproject rpp-lib/.project $@/ - cp -r rpp-lib/rpp/include $@/rpp-lib/rpp/include - cp rpp-lib/rpp/TMS570LS313xFlashLnk.cmd $@/rpp-lib/rpp/TMS570LS313xFlashLnk.cmd - cp -r rpp-lib/os/7.0.2_tms570/include $@/rpp-lib/os/7.0.2_tms570/include - cp -r rpp-lib/lwip/src/include $@/rpp-lib/lwip/src/include + git --git-dir=rpp-lib/.git archive --worktree-attributes --prefix=$@/rpp-lib/ HEAD $(RELEASE_LIB_GIT_FILES) | tar xf - +ifneq ($(filter lwip/src/include,$(rpp_lib_INCLUDES)),) + git --git-dir=rpp-lib/lwip/.git archive --worktree-attributes --prefix=$@/rpp-lib/lwip/ HEAD src/include/ | tar xf - +endif + cp --parents $(RELEASE_LIB_GEN_FILES:%=rpp-lib/%) $@/ lib: - $(MAKE) -C rpp-lib/Release + $(MAKE) -C rpp-lib .git/info/attributes # Setup ignored files + $(MAKE) -C rpp-lib/build/$(RELEASE_TARGET)/Debug