Skip to content

Instantly share code, notes, and snippets.

Created December 10, 2020 03:58
What would you like to do?
sdcc and stm8gal install
set -e
cd /tmp
#get the sdcc master branch, make, and install to /opt/sdcc
git clone && 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 && 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