OSDN Git Service

la der de der
[fast-forth/master.git] / config / Preprocess.bat
1 ::Preprocess.bat
2 ::used to preprocess source.f files, from PreprocessSourceFile.bat or scite editor Tools menu
3
4 ::@ECHO OFF
5
6 ::echo %2
7 ::echo %~dp1..\inc\%~n2.pat
8
9 IF "%2" == "" ( 
10 echo no file to be preprocessed!
11 goto badend 
12 )
13
14 IF NOT EXIST %~dpn1.f (
15 echo %~dpn1.f not found!
16 goto badend 
17 )
18
19 IF NOT EXIST %~dp0..\inc\%~n2.pat (
20 echo %~dp0..\inc\%~n2.pat not found!
21 goto badend 
22 )
23
24 IF "%3" == "" GOTO preprocess
25
26 echo unexpected third parameter!
27
28 :badend
29 pause > nul
30 exit
31
32
33 :preprocess
34 %~dp0..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp0..\inc\%~n2.pat  %~dpn1.f %~dp1LAST.4TH
35 set target=%~n2
36 call %~dp0Select.bat SelectDevice %%target%%
37 if not exist  %~dp1SD_%device:~3% MD %~dp1SD_%device:~3% > NUL 
38 COPY /y %~dp1LAST.4TH %~dp1SD_%device:~3%\%~n1.4TH > NUL
39 ::pause > NUL
40 exit
41
42 :: %~dp0 is the path of this file.bat
43 :: %~dpn1.f is the symbolic source file
44 :: %~dp0..\inc\%~n2.pat is the pattern file for preprocessor gema.exe
45 :: %~dp1LAST.4TH is the output source file (ready to send to the target)
46 :: %~d1 is the drive of arg %1
47 :: %~n2 is your selected template by SelectTarget.bat or your scite $(1)
48
49 rem your git copy must be the root of a virtual drive
50