Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem ******************************
- rem * Set paths to binaries here *
- rem * *
- rem ******************************
- SET GCC_PATH=E:\Programming\Arduino\avr-gcc\bin\avr-gcc.exe
- SET OBJCOPY_PATH=E:\Programming\Arduino\avr-gcc\bin\avr-objcopy.exe
- rem *****************************
- rem * Begin compiling process *
- rem * *
- rem *****************************
- ECHO Compiling .c to .o...
- %GCC_PATH% -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o %~dpn1.o %~dpnx1
- IF ERRORLEVEL 1 ECHO Failed to compile...
- IF ERRORLEVEL 1 GOTO :eof
- rem IF not ERRORLEVEL 1 ECHO no error
- rem -------------------------
- ECHO linking libraries...
- %GCC_PATH% -mmcu=atmega328p %~dpn1.o -o %~dpn1
- IF ERRORLEVEL 1 ECHO Linking failed...
- IF ERRORLEVEL 1 GOTO :eof
- rem ------------------------
- ECHO Extracting hex data...
- %OBJCOPY_PATH% -O ihex -R .eeprom %~dpn1 %~dpn1.hex
- IF ERRORLEVEL 1 ECHO Error extracting hex data...
- IF ERRORLEVEL 1 GOTO :eof
- rem -------------------------
- ECHO Cleaning up temp files...
- del %~dpn1.o
- del %~dpn1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement