11# Usage:
2- # make <MATLAB release version ex: R2018b> <HDL git branch ex: hdl_2018_r1>
2+ # make <target> MLRELEASE=< MATLAB release version ex: R2018b> HDLBRANCH= <HDL git branch ex: hdl_2018_r1>
33# Example
4- # make R2018b hdl_2018_r1
4+ # make build MLRELEASE= R2018b HDLBRANCH= hdl_2018_r1
55
66ifeq ($(MLRELEASE ) ,)
77MLRELEASE := R2018b
@@ -11,6 +11,19 @@ ifeq ($(HDLBRANCH),)
1111HDLBRANCH := hdl_2018_r1
1212endif
1313
14+ ifeq ($(OS ) ,Windows_NT)
15+ $(error Build system does not currently support Windows)
16+ else
17+ UNAME_S := $(shell uname -s)
18+ ifeq ($(UNAME_S ) ,Linux)
19+ MLPATH := /usr/local/MATLAB
20+ endif
21+ ifeq ($(UNAME_S ) ,Darwin)
22+ MLPATH := /Applications
23+ MLRELEASE := MATLAB_${MLRELEASE}.app
24+ endif
25+ endif
26+
1427GITTAG := $(shell git describe --tags HEAD)
1528
1629.ONESHELL :
@@ -19,59 +32,65 @@ build:
1932 bash build_bsp.sh
2033
2134add_libad9361 :
22- cd ../..
23- mkdir deps
24- cd deps
25- # Linux
26- mkdir linux
27- cd linux
28- # curl --silent "https://api.github.com/repos/analogdevicesinc/libad9361-iio/releases/latest" | jq -r ".assets[] | select(.name | test(\"${spruce_type}\")) | .browser_download_url" | grep tar.gz | wget -i -
29- wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-trusty.tar.gz
30- tar xvf * .tar.gz
31- mv usr/local/lib/* .
32- mv usr/local/include ../
33- rm -rf usr
34- rm * .tar.gz
35- cd ..
36- # Windows
37- mkdir win
38- cd win
39- wget " https://ci.appveyor.com/api/projects/analogdevicesinc/libad9361-iio/artifacts/libad9361-win64.zip?branch=master" -O lib.zip
40- unzip lib.zip
41- mv libad9361-win64/* .
42- rm -rf libad9361-win64
43- rm * .h
35+ cd ../.. ; \
36+ mkdir deps ; \
37+ cd deps ; \
38+ mkdir linux ; \
39+ cd linux ; \
40+ wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-trusty.tar.gz ; \
41+ tar xvf * .tar.gz ; \
42+ mv usr/local/lib/* . ; \
43+ mv usr/local/include ../ ; \
44+ rm -rf usr ; \
45+ rm * .tar.gz ; \
46+ cd .. ; \
47+ mkdir osx ; \
48+ cd osx ; \
49+ wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-osx_10.12.tar.gz ; \
50+ tar xvf * .tar.gz ; \
51+ cd ad9361* ; \
52+ mv usr/local/lib/ad9361.framework/Versions/Current/ad9361 ../libad9361.dylib ; \
53+ cd .. ; \
54+ rm -rf ad9361-* -Darwin ; \
55+ rm * .tar.gz ; \
56+ cd .. ; \
57+ mkdir win ; \
58+ cd win ; \
59+ wget " https://ci.appveyor.com/api/projects/analogdevicesinc/libad9361-iio/artifacts/libad9361-win64.zip?branch=master" -O lib.zip ; \
60+ unzip lib.zip ; \
61+ mv libad9361-win64/* . ; \
62+ rm -rf libad9361-win64 ; \
63+ rm * .h ; \
4464 rm lib.zip
4565
4666test_installer :
47- cd ../..
48- cp * .mltbx test/
49- cp hdl_wa_bsp/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m
50- sed -i " s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m
51- /usr/local/MATLAB /$(MLRELEASE ) /bin/matlab -nodisplay -r " cd('test');runInstallerTests;"
67+ cd ../.. ; \
68+ cp * .mltbx test/ ; \
69+ cp hdl_wa_bsp/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m ; \
70+ sed -i " s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m ; \
71+ ${MLPATH} /$(MLRELEASE ) /bin/matlab -nodisplay -r " cd('test');runInstallerTests;"
5272
5373test :
54- cd ../..
55- cp hdl_wa_bsp/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m
56- sed -i " s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m
57- /usr/local/MATLAB /$(MLRELEASE ) /bin/matlab -nodisplay -r " cd('test');runTests;"
74+ cd ../.. ; \
75+ cp hdl_wa_bsp/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m ; \
76+ sed -i " s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m ; \
77+ ${MLPATH} /$(MLRELEASE ) /bin/matlab -nodisplay -r " cd('test');runTests;"
5878
5979test_streaming :
60- cd ../..
61- /usr/local/MATLAB /$(MLRELEASE ) /bin/matlab -nodisplay -r " addpath(genpath('test'));addpath(genpath('deps'));hwTestRunner;"
80+ cd ../.. ; \
81+ ${MLPATH} /$(MLRELEASE ) /bin/matlab -nodisplay -r " addpath(genpath('test'));addpath(genpath('deps'));hwTestRunner;"
6282
6383test_modem :
64- cd ../..
65- /usr/local/MATLAB /$(MLRELEASE ) /bin/matlab -nodisplay -r " addpath(genpath('hdl_wa_bsp'));cd('targeting_models');addpath(genpath('modem-qpsk'))"
84+ cd ../.. ; \
85+ ${MLPATH} /$(MLRELEASE ) /bin/matlab -nodisplay -r " addpath(genpath('hdl_wa_bsp'));cd('targeting_models');addpath(genpath('modem-qpsk'))"
6686
6787gen_tlbx :
68- /usr/local/MATLAB /$(MLRELEASE ) /bin/matlab -nodisplay -r " genTlbx;exit();"
88+ ${MLPATH} /$(MLRELEASE ) /bin/matlab -nodisplay -r " genTlbx;exit();"
6989
7090linter :
71- /usr/local/MATLAB /$(MLRELEASE ) /bin/matlab -nodisplay -r " linter;exit();"
91+ ${MLPATH} /$(MLRELEASE ) /bin/matlab -nodisplay -r " linter;exit();"
7292
7393zip :
74- cd ../..
75- mkdir zip
94+ cd ../.. ; \
95+ mkdir zip ; \
7696 zip -r zip/AnalogDevicesBSP_$(GITTAG ) .zip deps doc hdl_wa_bsp hil_models targeting_models info.xml LICENSE README.md test/* .log
77-
0 commit comments