Advertisement
Ham62

avr-gcc build.bat

Feb 16th, 2019
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.10 KB | None | 0 0
  1. @echo off
  2.  
  3. rem ******************************
  4. rem * Set paths to binaries here *
  5. rem *                            *
  6. rem ******************************
  7.  
  8. SET GCC_PATH=E:\Programming\Arduino\avr-gcc\bin\avr-gcc.exe
  9. SET OBJCOPY_PATH=E:\Programming\Arduino\avr-gcc\bin\avr-objcopy.exe
  10.  
  11.  
  12.  
  13. rem *****************************
  14. rem *  Begin compiling process  *
  15. rem *                           *
  16. rem *****************************
  17.  
  18. ECHO Compiling .c to .o...
  19. %GCC_PATH% -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o %~dpn1.o %~dpnx1
  20.  
  21. IF ERRORLEVEL 1 ECHO Failed to compile...
  22. IF ERRORLEVEL 1 GOTO :eof
  23.  
  24. rem IF not ERRORLEVEL 1 ECHO no error
  25.  
  26.  
  27. rem -------------------------
  28.  
  29. ECHO linking libraries...
  30. %GCC_PATH% -mmcu=atmega328p %~dpn1.o -o %~dpn1
  31.  
  32. IF ERRORLEVEL 1 ECHO Linking failed...
  33. IF ERRORLEVEL 1 GOTO :eof
  34.  
  35.  
  36. rem ------------------------
  37.  
  38. ECHO Extracting hex data...
  39. %OBJCOPY_PATH% -O ihex -R .eeprom %~dpn1 %~dpn1.hex
  40.  
  41. IF ERRORLEVEL 1 ECHO Error extracting hex data...
  42. IF ERRORLEVEL 1 GOTO :eof
  43.  
  44.  
  45. rem -------------------------
  46.  
  47. ECHO Cleaning up temp files...
  48. del %~dpn1.o
  49. del %~dpn1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement