-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
121 lines (100 loc) · 3.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Usage:
# make <target> MLRELEASE=<MATLAB release version ex: R2018b> HDLBRANCH=<HDL git branch ex: hdl_2018_r1>
# Example
# make build MLRELEASE=R2018b HDLBRANCH=hdl_2018_r1
SHELL := /bin/bash
MLFLAGS := -nodisplay -nodesktop -nosplash
ifeq ($(MLRELEASE),)
MLRELEASE := R2022a
endif
ifeq ($(HDLBRANCH),)
HDLBRANCH := master
endif
ifeq ($(OS),Windows_NT)
MLPATH := /cygdrive/c/Program\ Files/MATLAB
MLFLAGS := $(MLFLAGS) -wait
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
MLPATH := /usr/local/MATLAB
endif
ifeq ($(UNAME_S),Darwin)
MLPATH := /Applications
MLRELEASE := MATLAB_${MLRELEASE}.app
endif
endif
ifeq ($(BOARD),)
BOARD :=
endif
ifeq ($(INCLUDE_EXAMPLES),)
INCLUDE_EXAMPLES := 1
endif
GITTAG := $(shell git describe --tags HEAD)
.ONESHELL:
build:
# Uses the HDLBRANCH variable
bash build_bsp.sh
add_libad9361:
cd ../.. ; \
mkdir deps ; \
cd deps ; \
mkdir linux ; \
cd linux ; \
wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-trusty.tar.gz ; \
tar xvf *.tar.gz ; \
mv usr/local/lib/* . ; \
mv usr/local/include ../ ; \
rm -rf usr ; \
rm *.tar.gz ; \
cd .. ; \
mkdir osx ; \
cd osx ; \
wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-osx_10.12.tar.gz ; \
tar xvf *.tar.gz ; \
cd ad9361* ; \
mv usr/local/lib/ad9361.framework/Versions/Current/ad9361 ../libad9361.dylib ; \
cd .. ; \
rm -rf ad9361-*-Darwin ; \
rm *.tar.gz ; \
cd .. ; \
mkdir win ; \
cd win ; \
wget "https://github.com/analogdevicesinc/libad9361-iio/releases/download/v0.2/libad9361-0.2-win64.zip" -O lib.zip ; \
unzip lib.zip ; \
mv libad9361-win64/* . ; \
rm -rf libad9361-win64 ; \
rm *.h ; \
rm lib.zip
test_installer:
cd ../.. ; \
cp *.mltbx test/ ; \
cp hdl/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m ; \
sed -i "s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m ; \
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "cd('test');runInstallerTests('$(BOARD)');"
test:
cd ../.. ; \
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "cd('test');runTests('$(BOARD)');"
test_streaming:
cd ../.. ; \
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "addpath(genpath('test'));addpath(genpath('deps'));runHWTests;"
run_NonHWTests:
cd ../.. ; \
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "addpath(genpath('test'));runNonHWTest;"
test_evm:
cd ../.. ; \
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "addpath(genpath('test'));addpath(genpath('deps'));hwTestRunner;"
test_modem:
cd ../.. ; \
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "addpath(genpath('hdl'));cd('targeting');addpath(genpath('modem-qpsk'))"
test_synth:
bash synth_designs.sh $(BOARD)
gen_tlbx:
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "genTlbx($(INCLUDE_EXAMPLES));exit();"
linter:
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "linter;exit();"
doc:
${MLPATH}/$(MLRELEASE)/bin/matlab $(MLFLAGS) -r "cd('../doc');genhtml();exit();"
zip:
cd ../.. ; \
mkdir zip ; \
zip -r zip/AnalogDevicesBSP_$(GITTAG).zip deps doc hdl hil_models targeting info.xml LICENSE README.md test/*.log