summaryrefslogtreecommitdiffstats
path: root/test_build.sh
diff options
context:
space:
mode:
authorFelix Singer <felixsinger@posteo.net>2022-07-22 22:52:08 +0200
committerThomas Heijligen <src@posteo.de>2022-08-09 21:28:22 +0000
commitdb026ea281bc36972c3a4fdc6009407180bf28d3 (patch)
treee7fcb7e80d20e3a075084754d9229c0e8d91e270 /test_build.sh
parentce971c6ce42983cda1d77003a2597d25290024df (diff)
downloadflashrom-db026ea281bc36972c3a4fdc6009407180bf28d3.tar.gz
flashrom-db026ea281bc36972c3a4fdc6009407180bf28d3.tar.bz2
flashrom-db026ea281bc36972c3a4fdc6009407180bf28d3.zip
test_build.sh: Build all programmers individually using Make
While testing CB:63724, which reworks the Meson build system, it showed that some programmers have dependency issues, which were invisible since test_build.sh builds flashrom with all programmers enabled and thus all sources are included. Building flashrom with each programmer individually made these issues visible. However, as commit 877b7741fcf9 and commit b6a439e45ef2 show, the Make build system also had some similar issues, which were invisible for the same reason. Thus, in addition to building all programmers at once using the Make build system, build each programmer individually. Also, when clang analyzer is used, it's not needed to run it on each programmer individually. Just return after flashrom was built with all programmers enabled in this case. An equivalent patch for the Meson build system is made separately. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I3bacb3ba9c6708f1e7ef5a111290d0ea3af36f1d Reviewed-on: https://review.coreboot.org/c/flashrom/+/66094 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'test_build.sh')
-rwxr-xr-xtest_build.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/test_build.sh b/test_build.sh
index 2b5d89f2f..68b00adac 100755
--- a/test_build.sh
+++ b/test_build.sh
@@ -1,9 +1,38 @@
#!/usr/bin/env sh
set -e
+# This script will only work on Linux with all dependencies installed.
+
+is_scan_build_env=0
+
+make_programmer_opts="INTERNAL INTERNAL_X86 SERPROG RAYER_SPI RAIDEN_DEBUG_SPI PONY_SPI NIC3COM \
+ GFXNVIDIA SATASII ATAHPT ATAVIA ATAPROMISE FT2232_SPI USBBLASTER_SPI MSTARDDC_SPI \
+ PICKIT2_SPI STLINKV3_SPI PARADE_LSPCON MEDIATEK_I2C_SPI REALTEK_MST_I2C_SPI DUMMY \
+ DRKAISER NICREALTEK NICNATSEMI NICINTEL NICINTEL_SPI NICINTEL_EEPROM OGP_SPI \
+ BUSPIRATE_SPI DEDIPROG DEVELOPERBOX_SPI SATAMV LINUX_MTD LINUX_SPI IT8212 \
+ CH341A_SPI DIGILENT_SPI JLINK_SPI"
+
+
+if [ $(basename "${CC}") = "ccc-analyzer" ]; then
+ is_scan_build_env=1
+fi
+
build_make () {
+ make clean
make CONFIG_EVERYTHING=yes
+
+ # In case of clang analyzer we don't want to run it on
+ # each programmer individually. Thus, just return here.
+ if [ ${is_scan_build_env} -eq 1 ]; then
+ return
+ fi
+
+ for option in ${make_programmer_opts}; do
+ echo "Building ${option}"
+ make clean
+ make CONFIG_NOTHING=yes CONFIG_${option}=yes
+ done
}