REM @ECHO OFF
SETLOCAL
SET BATDIR=%~dp0

cat.exe %BATDIR%..\sound.h ^
 | gawk.exe --re-interval -f %BATDIR%MkSndSeq.awk ^
 > %BATDIR%__tmp__.txt
cat.exe %BATDIR%__tmp__.txt %BATDIR%SndSeq.txt ^
 | cpp.exe -P ^
 | dSndSeqC.exe ^
 > %BATDIR%..\SndSeq.c
cat.exe %BATDIR%..\SndSeq.c ^
 | onigsed.exe -n ^
 -e "/#define/{ p; }" ^
 -e "/const unsigned char TBL_SndSeq\[[[:digit:]]\+\]={/{ s/^/extern /; s/={/;/; p; }" ^
 > %BATDIR%..\SndSeq.h
DEL %BATDIR%__tmp__.txt
