UCTRONICS_Smart_Robot_Car_RaspberryPi
UCTRONICS_Smart_Robot_Car_RaspberryPi copied to clipboard
/etc/rc.local fails to compile robot car when 'make clean' has error
The /etc/rc.local script contains this section of code:
cd /home/pi/UCTRONICS_Smart_Robot_Car_RaspberryPi/C/ sudo make clean sudo make sudo ./UCTRONICS_Smart_Robot_Car_RaspberryPi
When running sudo make clean it tries to delete a number of files from a previous compilation. If it doesn't find the file UCTRONICS_Smart_Robot_Car_RaspberryPi it will return an error and the next step 'sudo make' won't work.
Sometimes my robot car fails to compile the program upon boot-up and when I try to manually run the /etc/rc.local script, it gives this error. I'm not sure why this happens -- perhaps it was due to an improper shutdown.
Perhaps the makefile needs to ignore nonexistent files for clean targets. Or the workaround I used was to modify rc.local to simply execute the existing binary application instead of re-compiling it each time.