@echo off
REM Backup
make clean
copy makefile makefile.bak
copy main.h main.h.bak
md Hex-Files
REM DX7-644
sed s/"
^MCU = atmega1284p"/"#MCU = atmega1284p"/g makefile.bak
| sed s/"
^MCU = atmega644p"/"#MCU = atmega644p"/g
| sed s/"#MCU = atmega644p"/"MCU = atmega644p"/g
> makefile
sed s/"\/\/#define RECEIVER_SPEKTRUM_DX7EXP"/"#define RECEIVER_SPEKTRUM_DX7EXP"/g main.h.bak
> main.h
make
ren *_SVN.hex *_DX7Patched.hex
move *.hex Hex-Files
make clean
REM DX8-644
sed s/"
^MCU = atmega1284p"/"#MCU = atmega1284p"/g makefile.bak
| sed s/"
^MCU = atmega644p"/"#MCU = atmega644p"/g
| sed s/"#MCU = atmega644p"/"MCU = atmega644p"/g
> makefile
sed s/"\/\/#define RECEIVER_SPEKTRUM_DX8EXP"/"#define RECEIVER_SPEKTRUM_DX8EXP"/g main.h.bak
> main.h
make
ren *_SVN.hex *_DX8Patched.hex
move *.hex Hex-Files
make clean
REM DX7-1284
sed s/"
^MCU = atmega1284p"/"#MCU = atmega1284p"/g makefile.bak
| sed s/"
^MCU = atmega644p"/"#MCU = atmega644p"/g
| sed s/"#MCU = atmega1284p"/"MCU = atmega1284p"/g
> makefile
sed s/"\/\/#define RECEIVER_SPEKTRUM_DX7EXP"/"#define RECEIVER_SPEKTRUM_DX7EXP"/g main.h.bak
> main.h
make
ren *_SVN.hex *_DX7Patched.hex
move *.hex Hex-Files
make clean
REM DX8-1284
sed s/"
^MCU = atmega1284p"/"#MCU = atmega1284p"/g makefile.bak
| sed s/"
^MCU = atmega644p"/"#MCU = atmega644p"/g
| sed s/"#MCU = atmega1284p"/"MCU = atmega1284p"/g
> makefile
sed s/"\/\/#define RECEIVER_SPEKTRUM_DX8EXP"/"#define RECEIVER_SPEKTRUM_DX8EXP"/g main.h.bak
> main.h
make
ren *_SVN.hex *_DX8Patched.hex
move *.hex Hex-Files
make clean
REM Cleanup
del makefile
ren makefile.bak makefile
del main.h
ren main.h.bak main.h