]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blob - rpp/blocks/Makefile
a55e1134346310691ee17f13197e7407c8247e65
[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 define PRINT_COMMIT_MSG
26 (echo "Update block masks by running rpp_update_doc.m"; echo; echo "Changelog:"; sed -n -e '/^Processing rpp_lib/,$$ p' update-doc.log)
27 endef
28
29 commit-doc: update-doc
30         $(PRINT_COMMIT_MSG) | git commit -F - rpp_lib.slx