- 下载sdcc源码
- 解压
1
2tar -xjvf sdcc-src-4.0.0.tar.bz2
cd sdcc-4.0.0 - 安装依赖
1
sudo apt install flex bison texinfo libboost1.62-dev
- configure 禁用不必要的芯片支持,只保留mcs51和stm8
1
./configure --disable-z80-port --disable-z180-port --disable-r2k-port --disable-r3ka-port --disable-gbz80-port --disable-tlcs90-port --disable-ez80_z80-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
- 编译安装
1
2make
sudo make install