# Copyright (C) 2013, 2015 Czech Technical University in Prague # # Authors: # - Michal Sojka # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, # copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following # conditions: # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # File : Makefile # Abstract: # Build documentation include ../lib/Makefile.config SF = $(wildcard sfunction_*.c) HTML = $(SF:%.c=%.html) MEX = $(SF:%.c=%.mexa64) all: $(MEX) $(HTML) rpp_lib.slx clean:: rm -rf $(MEX) $(HTML) rpp_lib.slx ################################ # S-functions and documentation ################################ %.mexa64: %.c mex $(CFLAGS) $^ MATLAB=$(shell cd $(dir $(shell readlink -f $$(which mex)))/..; pwd) CAN_BLOCKS=sfunction_cantransmit.mexa64 sfunction_canreceive.mexa64 $(CAN_BLOCKS): CFLAGS=-I$(MATLAB)/toolbox/shared/can/src/scanutil -I$(MATLAB)/toolbox/rtw/targets/common/can/datatypes $(CAN_BLOCKS): $(MATLAB)/toolbox/rtw/targets/common/can/datatypes/sfun_can_util.c $(MATLAB)/toolbox/rtw/targets/common/can/datatypes/can_msg.c %.html: %.c scripts/doc_parse.py --printhelp --html $< > $@ diff-doc: $(HTML) matlab -nodesktop -nojvm -r "exit(rpp_update_doc('diff') > 0)" update-doc: $(HTML) 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 generate-lib: 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 cp --force ./_$(TARGET)/rpp_lib.slx ./rpp_lib.slx define PRINT_COMMIT_MSG (echo "Update block masks by running rpp_update_doc.m"; echo; echo "Changelog:"; sed -n -e '/^Processing /,$$ p' update-doc.log) endef commit-doc: update-doc $(PRINT_COMMIT_MSG) | git commit -F - $$(git ls-files -m '*.slx') ################################ # Block library ################################ rpp_lib.slx: matlab -nodesktop -nojvm -r "try, rpp_generate_lib $(BLOCKS); catch ME, disp(getReport(ME)); exit(1); end; exit(0)"