1 # Copyright (C) 2013, 2015 Czech Technical University in Prague
4 # - Michal Sojka <sojkam1@fel.cvut.cz>
6 # This document contains proprietary information belonging to Czech
7 # Technical University in Prague. Passing on and copying of this
8 # document, and communication of its contents is not permitted
9 # without prior written authorization.
15 include ../lib/Makefile.config
17 SF = $(wildcard sfunction_*.c)
18 HTML = $(SF:%.c=%.html)
19 MEX = $(SF:%.c=%.mexa64)
21 all: $(MEX) $(HTML) rpp_lib.slx
24 rm -rf $(MEX) $(HTML) rpp_lib.slx
26 ################################
27 # S-functions and documentation
28 ################################
33 MATLAB=$(shell cd $(dir $(shell readlink -f $$(which mex)))/..; pwd)
34 CAN_BLOCKS=sfunction_cantransmit.mexa64 sfunction_canreceive.mexa64
35 $(CAN_BLOCKS): CFLAGS=-I$(MATLAB)/toolbox/shared/can/src/scanutil -I$(MATLAB)/toolbox/rtw/targets/common/can/datatypes
36 $(CAN_BLOCKS): $(MATLAB)/toolbox/rtw/targets/common/can/datatypes/sfun_can_util.c $(MATLAB)/toolbox/rtw/targets/common/can/datatypes/can_msg.c
39 scripts/doc_parse.py --printhelp --html $< > $@
42 matlab -nodesktop -nojvm -r "exit(rpp_update_doc('diff') > 0)"
45 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
48 matlab -nodesktop -nojvm -r "try, rpp_generate_lib('_$(TARGET)', $(rpp_blocks_set)); catch ME, disp(getReport(ME)); exit(1); end; exit(0)" | sed -e "s/\x1b\(\[?1[hl]\|[=>]\)//g" | tee generate-lib.log
49 cp --force ./_$(TARGET)/rpp_lib.slx ./rpp_lib.slx
51 define PRINT_COMMIT_MSG
52 (echo "Update block masks by running rpp_update_doc.m"; echo; echo "Changelog:"; sed -n -e '/^Processing /,$$ p' update-doc.log)
55 commit-doc: update-doc
56 $(PRINT_COMMIT_MSG) | git commit -F - $$(git ls-files -m '*.slx')
58 ################################
60 ################################
63 matlab -nodesktop -nojvm -r "try, rpp_generate_lib $(BLOCKS); catch ME, disp(getReport(ME)); exit(1); end; exit(0)"