]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blobdiff - Makefile
Change license to MIT
[pes-rpp/rpp-test-sw.git] / Makefile
index c2d41f622487ff69fe9ca6e61df1195a34bd0605..165a428bc743feafdc7ac1808572b0c4e26fd8ea 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,12 +9,13 @@ 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/build/tms570_hdk
+       $(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
@@ -46,10 +47,11 @@ 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 ?= tms570_hdk
-include rpp-lib/build/$(RELEASE_TARGET)/Makefile.config
+RELEASE_TARGET = $(TARGET)
 
 RELEASE_LIB_GIT_FILES = \
        Makefile.var \
@@ -60,19 +62,18 @@ RELEASE_LIB_GIT_FILES = \
        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 -
+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/build/$(RELEASE_TARGET)/Release
+       $(MAKE) -C rpp-lib .git/info/attributes # Setup ignored files
+       $(MAKE) -C rpp-lib/build/$(RELEASE_TARGET)/Debug