]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blob - rpp/blocks/Makefile
Add Matlab script for generation of target specific rpp_lib.slx library
[jenkicar/rpp-simulink.git] / rpp / blocks / Makefile
1 SF=$(wildcard sfunction_*.c)
2
3 HTML = $(SF:%.c=%.html)
4 MEX = $(SF:%.c=%.mexa64)
5
6 all: $(MEX) $(HTML)
7
8 %.mexa64: %.c
9         mex $(CFLAGS) $^
10
11 MATLAB=$(shell cd $(dir $(shell readlink -f $$(which mex)))/..; pwd)
12 CAN_BLOCKS=sfunction_cantransmit.mexa64 sfunction_canreceive.mexa64
13 $(CAN_BLOCKS): CFLAGS=-I$(MATLAB)/toolbox/shared/can/src/scanutil -I$(MATLAB)/toolbox/rtw/targets/common/can/datatypes
14 $(CAN_BLOCKS): $(MATLAB)/toolbox/rtw/targets/common/can/datatypes/sfun_can_util.c $(MATLAB)/toolbox/rtw/targets/common/can/datatypes/can_msg.c
15
16 %.html: %.c
17         scripts/doc_parse.py --printhelp --html $< > $@
18
19 diff-doc: $(HTML)
20         matlab -nodesktop -nojvm -r "exit(rpp_update_doc('diff') > 0)"
21
22 update-doc: $(HTML)
23         matlab -nodesktop -nojvm -r "try, rpp_update_doc('update'); catch ME, disp(getReport(ME)); exit(1); end; exit(0)" | sed -e "s/\x1b\(\[?1[hl]\|[=>]\)//g" | tee update-doc.log
24
25 include ../lib/Makefile.config
26 generate-lib:
27         matlab -nodesktop -nojvm -r "try, rpp_generate_lib(); catch ME, disp(getReport(ME)); exit(1); end; exit(0)" | sed -e "s/\x1b\(\[?1[hl]\|[=>]\)//g" | tee generate-lib.log
28         cp --force ./_$(TARGET)/rpp_lib.slx ./rpp_lib.slx
29         
30 define PRINT_COMMIT_MSG
31 (echo "Update block masks by running rpp_update_doc.m"; echo; echo "Changelog:"; sed -n -e '/^Processing rpp_lib/,$$ p' update-doc.log)
32 endef
33
34 commit-doc: update-doc
35         $(PRINT_COMMIT_MSG) | git commit -F - rpp_lib.slx