forked from YosysHQ/fpga-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·151 lines (121 loc) · 4.11 KB
/
build.sh
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/bin/env bash
##################################
# FPGA toolchain builder #
##################################
set -e
# -- Toolchain name
export NAME=fpga-toolchain
# Use the following variables to enable and disable parts of the build
# If you place a .env file in the root of the repo
# then _common.sh will source it - you can use this to
# locally override these variables without accidentally committing
# changes.
# Note that these variables are also overridden from their defaults
# in azure-pipelines.yml
# Enable to install deps automatically (warning, will run the package manager)
INSTALL_DEPS="${INSTALL_DEPS:-1}"
# Enable to delete intermediate files as we go
# (keeps disk space usage lower in CI runs)
CLEAN_AFTER_BUILD="${CLEAN_AFTER_BUILD:-1}"
# Enable each individual tool
COMPILE_DFU_UTIL="${COMPILE_DFU_UTIL:-1}"
COMPILE_YOSYS="${COMPILE_YOSYS:-1}"
COMPILE_SBY="${COMPILE_SBY:-1}"
COMPILE_ICESTORM="${COMPILE_ICESTORM:-1}"
COMPILE_NEXTPNR_ICE40="${COMPILE_NEXTPNR_ICE40:-1}"
COMPILE_NEXTPNR_ECP5="${COMPILE_NEXTPNR_ECP5:-0}"
COMPILE_ECPPROG="${COMPILE_ECPPROG:-1}"
COMPILE_OPENFPGALOADER="${COMPILE_OPENFPGALOADER:-1}"
COMPILE_IVERILOG="${COMPILE_IVERILOG:-0}"
COMPILE_GHDL="${COMPILE_GHDL:-1}"
COMPILE_Z3="${COMPILE_Z3:-1}"
COMPILE_BOOLECTOR="${COMPILE_BOOLECTOR:-1}"
COMPILE_AVY="${COMPILE_AVY:-0}" # deliberately disabled - does not yet work
COMPILE_YICES2="${COMPILE_YICES2:-1}"
# Required for nextpnr's embedded interpreter to work
# also required for symbiyosys on windows.
# May be disabled during dev to speed things up
BUNDLE_PYTHON="${BUNDLE_PYTHON:-1}"
# Only affects windows builds - a make.exe is
# included for convenience
# (existing Makefiles using unix utils generally need
# to be adjusted to work with this)
BUNDLE_MAKE="${BUNDLE_MAKE:-1}"
# Enable to compress the resulting build into a package.
# May be disabled during dev to speed things up.
CREATE_PACKAGE="${CREATE_PACKAGE:-1}"
. scripts/_common.sh $1
build_setup
if [ $BUNDLE_PYTHON == "1" ]; then
print ">> Bundle Python"
. $WORK_DIR/scripts/bundle_python.sh
fi
if [ $BUNDLE_MAKE == "1" ]; then
print ">> Bundle GNU Make"
. $WORK_DIR/scripts/bundle_make.sh
fi
if [ $COMPILE_NEXTPNR_ECP5 == "1" ]; then
print ">> Compile nextpnr-ecp5"
. $WORK_DIR/scripts/compile_nextpnr_ecp5.sh
fi
if [ $COMPILE_DFU_UTIL == "1" ]; then
print ">> Compile dfu-utils"
. $WORK_DIR/scripts/compile_dfu_util.sh
fi
if [ $COMPILE_GHDL == "1" ]; then
print ">> Compile ghdl"
. $WORK_DIR/scripts/compile_ghdl.sh
fi
if [ $COMPILE_YOSYS == "1" ]; then
print ">> Compile yosys"
. $WORK_DIR/scripts/compile_yosys.sh
fi
if [ $COMPILE_SBY == "1" ]; then
print ">> Compile SymbiYosys"
. $WORK_DIR/scripts/compile_sby.sh
fi
if [ $COMPILE_YICES2 == "1" ]; then
print ">> Compile Yices2"
. $WORK_DIR/scripts/compile_yices2.sh
fi
if [ $COMPILE_Z3 == "1" ]; then
print ">> Compile Z3"
. $WORK_DIR/scripts/compile_z3.sh
fi
if [ $COMPILE_BOOLECTOR == "1" ]; then
print ">> Compile Boolector"
. $WORK_DIR/scripts/compile_boolector.sh
fi
if [ $COMPILE_AVY == "1" ]; then
print ">> Compile Avy"
. $WORK_DIR/scripts/compile_avy.sh
fi
if [ $COMPILE_ICESTORM == "1" ]; then
print ">> Compile icestorm"
. $WORK_DIR/scripts/compile_icestorm.sh
fi
if [ $COMPILE_NEXTPNR_ICE40 == "1" ]; then
print ">> Compile nextpnr-ice40"
. $WORK_DIR/scripts/compile_nextpnr_ice40.sh
fi
if [ $COMPILE_ECPPROG == "1" ]; then
print ">> Compile ecpprog"
. $WORK_DIR/scripts/compile_ecpprog.sh
fi
if [ $COMPILE_OPENFPGALOADER == "1" ]; then
print ">> Compile openFPGALoader"
. $WORK_DIR/scripts/compile_openfpgaloader.sh
fi
if [ $COMPILE_IVERILOG == "1" ]; then
print ">> Compile iverilog"
. $WORK_DIR/scripts/compile_iverilog.sh
fi
if [ $CREATE_PACKAGE == "1" ]; then
print ">> Create package"
mkdir -p $PACKAGE_DIR/publish $PACKAGE_DIR/publish_symbols
create_package "$PACKAGE_DIR" "$NAME" "publish/$NAME-$ARCH-$VERSION"
create_package "$PACKAGE_DIR" "${NAME}_symbols" "publish_symbols/symbols_${NAME}-$ARCH-$VERSION"
if [ ${ARCH:0:7} = "windows" ]; then
create_package "$PACKAGE_DIR" "${NAME}-progtools" "publish/${NAME}-progtools-$ARCH-$VERSION"
fi
fi