those are just warning (#warning “Cannot detect board type”) suggesting that the board is not listed in the DeviceDetect file. the issue here is the avrdude: butterfly_recv(): programmer is not responding
with the leonardo. there are many post w.r.t this topic avrdude butterfly_recv() programmer is not responding arduino leonardo - Google Search and some suggest that double pressing reset while uploading fixes it while other suggest to use an UNO as ISP, wired into the Leonardos ICSP and burned the bootloader.