::Preprocess.bat
-::used by PreprocessSourceFile.bat or by scite editor Tools menu
+::used to preprocess source.f files, from PreprocessSourceFile.bat or scite editor Tools menu
::@ECHO OFF
goto badend
)
-IF NOT EXIST %~dp1..\inc\%~n2.pat (
-echo %~dp1..\inc\%~n2.pat not found!
+IF NOT EXIST %~dp0..\inc\%~n2.pat (
+echo %~dp0..\inc\%~n2.pat not found!
goto badend
)
:preprocess
-%~dp1..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp1..\inc\%~n2.pat %~dpn1.f %~dp1LAST.4TH
+%~dp0..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp0..\inc\%~n2.pat %~dpn1.f %~dp1LAST.4TH
set target=%~n2
-call %~dp1..\config\Select.bat SelectDevice %%target%%
+call %~dp0Select.bat SelectDevice %%target%%
if not exist %~dp1SD_%device:~3% MD %~dp1SD_%device:~3% > NUL
COPY /y %~dp1LAST.4TH %~dp1SD_%device:~3%\%~n1.4TH > NUL
-::pause
+::pause > NUL
exit
+:: %~dp0 is the path of this file.bat
:: %~dpn1.f is the symbolic source file
-:: %~dp1..\inc\%~n2.pat is the pattern file for preprocessor gema.exe
+:: %~dp0..\inc\%~n2.pat is the pattern file for preprocessor gema.exe
:: %~dp1LAST.4TH is the output source file (ready to send to the target)
:: %~d1 is the drive of arg %1
:: %~n2 is your selected template by SelectTarget.bat or your scite $(1)