]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blobdiff - Makefile
Synchronize library versions
[pes-rpp/rpp-simulink.git] / Makefile
index 3851d72a95e452d1c1f57414375fb2c9a96ddbd1..d39196544ecb4b0c939accc6139d4c4d7c9f6b8e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,22 @@
-RELEASE_PREFIX = rpp-simulink
+
+release4eaton:
+       $(MAKE) release RELEASE_TARGET=tms570_hydctr RELEASE_ATTR=eaton
+
+release4us:
+       $(MAKE) release RELEASE_TARGET=tms570_rpp RELEASE_ATTR=
+
+ifeq ($(or $(release_in_progress),$(MAKECMDGOALS)),release)
+export release_in_progress = release
 
 include rpp/lib/Makefile.var   # for rpp_lib_* variables
 include rpp/lib/common.mk
 
+RELEASE_TARGET = $(error Please set RELEASE_TARGET variable on command line)
+
+include rpp/lib/build/$(RELEASE_TARGET)/Makefile.config
+
+$(eval $(call release_rules,rpp-simulink))
+
 TESTSW_LIB_COMMIT = git --git-dir=doc/test-sw/rpp-lib/.git rev-parse HEAD
 SIMULINK_LIB_COMMIT = git --git-dir=rpp/lib/.git rev-parse HEAD
 
@@ -13,14 +27,8 @@ release: $(RELEASE_BASENAME).zip
        cp doc/test-sw/$(shell make -C doc/test-sw --silent print-release-basename).zip .
        cp doc/rpp_simulink.pdf rpp_simulink-$(RELEASE_VERSION).pdf
 
-
-ifneq ($(RELEASE_TARGET),)
-include rpp/lib/build/$(RELEASE_TARGET)/Makefile.config
-endif
-
-RELEASE_TARGET = $(error Please set RELEASE_TARGET variable on command line)
-
 RELEASE_LIB_GIT_FILES = \
+       common.mk \
        Makefile.var \
        build/$(RELEASE_TARGET)/$(TARGET_CCXML) \
        build/$(RELEASE_TARGET)/$(TARGET_LDCMD) \
@@ -29,16 +37,15 @@ 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 rpp-lib.lib
 
 $(RELEASE_BASENAME):: LIB_RELEASE_BASENAME:=$(shell make -C rpp/lib --silent print-release-basename)
 $(RELEASE_BASENAME):: release-lib
 # Copy library headers and binaries
        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/%) $@/
 # Compile and include the PDF documentation
        $(MAKE) -C doc
@@ -46,5 +53,11 @@ $(RELEASE_BASENAME):: release-lib
        cp doc/rpp_simulink.pdf $@/doc
 
 release-lib:
-       $(MAKE) -C rpp/lib/build/$(RELEASE_TARGET)/Release # Compile the lib
-       $(MAKE) -C rpp/lib release # Create release zip and directory
+# Compile the lib
+       $(MAKE) -C rpp/lib/build/$(RELEASE_TARGET)/Release
+# Create release zip and directory. Note that this also setups ignored
+# files, which is required for correct function of $(RELEASE_BASENAME)
+# target.
+       $(MAKE) -C rpp/lib release
+
+endif # release