Skip to content

Instantly share code, notes, and snippets.

@MitchRatquest
Created December 10, 2020 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MitchRatquest/cf6f68d421a3e3319e38a6b8ca79cef8 to your computer and use it in GitHub Desktop.
Save MitchRatquest/cf6f68d421a3e3319e38a6b8ca79cef8 to your computer and use it in GitHub Desktop.
sdcc and stm8gal install
#!/bin/bash
set -e
cd /tmp
#get the sdcc master branch, make, and install to /opt/sdcc
git clone https://github.com/swegener/sdcc.git && cd sdcc
export CFLAGS=-static; export LDFLAGS=-static;
./configure --disable-mcs51-port --disable-z80-port --disable-z180-port --disable-r2k-port --disable-r2ka-port --disable-r3ka-port --disable-gbz80-port --disable-tlcs90-port --disable-ez80_z80-port --disable-z80n-port --disable-ds390-port --disable-ds400-port --disable-pic14-port --disable-pic16-port --disable-hc08-port --disable-s08-port --disable-pdk13-port --disable-pdk14-port --disable-pdk15-port --prefix=/opt/sdcc
make -j$(nproc)
sudo mkdir -p /opt/sdcc
sudo make install
cd /tmp
rm -rf sdcc/
git clone https://github.com/gicking/stm8gal.git && cd stm8gal
#re-encode for sed
dos2unix Makefile
#static flags
line=$(grep -E "^CFLAGS" Makefile)
sed -i "s|$line|$line -static|g" Makefile
line=$(grep -E "^LDFLAGS" Makefile)
sed -i "s|$line|$line -static|g" Makefile
make -j$(nproc)
sudo cp stm8gal /usr/bin/stm8gal
cd /tmp
rm -rf stm8gal
echo "done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment