@echo off
REM
REM "Compile" the web resources folder into code modules.
REM
REM Command  : MakeByteArray -ESP -ROOT -DIR *.* -o=..\Web_Resources.h
REM From cwd : C:/Projects/SmartSwitch/Firmware/Resources
REM Run script in command shell, not PowerShell
REM 
REM External Dependency:
REM MakeByteArray - Converts 1 or more files into a .h file byte array.
REM
REM       +------------------------------------------------+
REM       |  MakeResourceFiles.cmd                         |
REM       +------------------------------------------------+
REM                               ||
REM         +----------+     +-----------+     +-----------+
REM       +----------+ |     |Make       |     |           |
REM       |source    | |     |Byte       |     |Resources.h|
REM       |.htm      | | ==> |Array.pl   | ==> |           |
REM       |.js       | |     |           |     |           |
REM       |.jpg      | |     |           |     |           |
REM       |etc...    |-+     |           |     |           |
REM       +----------+       +-----------+     +-----------+
setlocal

REM ######################################################################
REM
REM  Configuration Options
REM 

set SRC=..\Firmware\Resources
set TARG=..\Web_Resources.h

REM
REM	End of Configuration
REM
REM ######################################################################

echo.
echo.Make Resource Files
echo.Change to %SRC% ...
pushd %SRC%

echo.Show web resources
dir /b

echo.
echo.Compiling the web resources into code modules...
MakeByteArray -ESP -ROOT -DIR *.* -o=%TARG%

echo.
echo.Done. %TARG% has been updated and returning to prior folder.
dir %TARG%
popd
endlocal
