OSDN Git Service

V300 beautified
[fast-forth/master.git] / config / SendSource.bat
1 ::SendSource.bat
2 ::used by SendSourceFileToTarget.bat or by scite editor Tools menu
3
4 ::echo %2
5 ::echo %~d1\inc\%~n2.pat
6
7 @ECHO OFF
8
9 ::first select part .4TH or .f
10
11 IF /I "%~x1" == ".4TH" GOTO 4TH
12
13 :: ==============================================================================================
14 :: source file.f part
15 :: %~dpn1.f is the symbolic source file.f described as drive\path\name.f
16 :: %~d1\config\gema\%~n2.pat is the pattern file for preprocessor gema.exe
17 :: %~dpn1.4TH is the source file.4TH to be sent to the target
18 :: %~d1 is the drive of arg %1
19 :: %~n2 is your selected template by SelectTarget.bat or your scite $(1)
20
21 IF "%~x1" == "" (
22 echo no file to be preprocessed!
23 goto badend
24 )
25
26 IF NOT EXIST %~dpn1.f (
27 echo %~dpn1.f not found!
28 goto badend
29 )
30
31 IF NOT EXIST %~d1\inc\%~n2.pat (
32 echo %~d1\inc\%~n2.pat not found!
33 goto badend
34 )
35
36 IF /I "%3" == "" GOTO preprocessF
37 IF /I "%3" == "ECHO" GOTO preprocessF
38 IF /I "%3" == "NOECHO" GOTO preprocessF
39 IF /I "%3" == "HALF" GOTO preprocessF
40
41 echo unexpected third parameter %3 !
42
43 :badend
44 pause > nul
45 exit
46
47
48 :preprocessF
49 ::@%~d1\prog\gema.exe -nobackup -line -t '\n=\r\n;\r\n=\r\n' -f  %~d1\inc\%~n2.pat %~dpn1.f %~dpn1.4TH
50 @%~d1\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f  %~d1\inc\%~n2.pat %~dpn1.f %~dpn1.4TH
51
52 :DownloadF
53 @taskkill /F /IM ttermpro.exe 1> NUL 2>&1
54
55 :Win32F
56 @"C:\Program Files\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C  %3  1> NUL 2>&1
57 @IF NOT ERRORLEVEL 1 GOTO EndF
58
59 :Win64F
60 @"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C %3
61
62 :EndF
63 @MOVE "%~dpn1.4TH" "%~dp1\LAST.4TH" > NUL
64 exit
65
66
67 :: ==============================================================================================
68 :: source file.4TH part
69 :: %~dpn1.4TH is the file to be sent described as drive\path\name.4TH
70 :: %~d1 is the drive of param %1
71 :: %~nx0 is name.ext of this bat file
72
73 :4TH
74
75 shift /3
76
77 ::echo %1
78 ::echo %2
79 ::echo %3
80 ::pause
81
82 IF NOT EXIST %~dpn1.4TH (
83 echo %~dpn1.4TH not found!
84 goto badend
85 )
86
87 if /I "%2"=="" GOTO Download4th
88 if /I "%2"=="ECHO" GOTO Download4th
89 if /I "%2"=="NOECHO" GOTO Download4th
90 if /I "%2"=="HALF" GOTO Download4th
91
92 echo unexpected 2th parameter %2 !
93 goto badend
94
95
96 :Download4th
97
98 @taskkill /F /IM ttermpro.exe 1> NUL 2>&1
99
100 :Win324th
101 @"C:\Program Files\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C %2  1> NUL 2>&1
102 @IF NOT ERRORLEVEL 1 GOTO End4th
103
104 :Win644th
105 @"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C %2
106
107 :End4th
108 ::@COPY "%~dpn1.4TH" "%~dp1\LAST.4TH" > NUL
109 exit
110