forked from ulx3s/ulx3s-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_fujprog.sh
executable file
·66 lines (53 loc) · 2.75 KB
/
install_fujprog.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
#!/bin/bash
#"***************************************************************************************************"
# common initialization
#"***************************************************************************************************"
#
# select master or some GitHub hash version, and whether or not to force a clean
THIS_CHECKOUT=master
THIS_CLEAN=true
# ff78bd2f3
# perform some version control checks on this file
./gitcheck.sh $0
# initialize some environment variables and perform some sanity checks
. ./init.sh
# we don't want tee to capture exit codes
set -o pipefail
#"***************************************************************************************************"
# Install fujprog from f32c (used to upload binaries to ULX3S)
#"***************************************************************************************************"
echo "***************************************************************************************************"
echo " fujprog. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
if [ "$APTGET" == 1 ]; then
sudo apt-get install libftdi1-dev libusb-dev cmake make build-essential --assume-yes 2>&1 | tee -a "$THIS_LOG"
fi
pushd .
cd "$WORKSPACE"
$SAVED_CURRENT_PATH/fetch_github.sh https://github.com/kost/fujprog.git fujprog $THIS_CHECKOUT 2>&1 | tee -a "$THIS_LOG"
$SAVED_CURRENT_PATH/check_for_error.sh $? "$THIS_LOG"
cd "$WORKSPACE"/fujprog
# There's no point to making the linux version of fujprog in WSL, as native USB devices are not supported.
# but we can compile the Windows version, amd actually call it from WSL (call from /mnt/c... not ~/...)
if grep -q Microsoft /proc/version; then
echo "***************************************************************************************************"
echo " ming32_64. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
wget --no-hsts https://www.ftdichip.com/Drivers/CDM/CDM%20v2.12.28%20WHQL%20Certified.zip
mkdir -p build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=`pwd`/../cmake/Toolchain-cross-mingw32.cmake ..
make
echo "fujprog.exe is in $WORKSPACE/fujprog/build"
$SAVED_CURRENT_PATH/check_for_error.sh $? "$THIS_LOG"
else
mkdir -p build
cd build
cmake .. 2>&1 | tee -a "$THIS_LOG"
make -j$(nproc) 2>&1 | tee -a "$THIS_LOG"
sudo make install 2>&1 | tee -a "$THIS_LOG"
$SAVED_CURRENT_PATH/check_for_error.sh $? "$THIS_LOG"
fi
popd
echo "Completed $0" | tee -a "$THIS_LOG"
echo "----------------------------------"