forked from Unity-Technologies/mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libmono.bat
97 lines (69 loc) · 2.29 KB
/
libmono.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@ECHO off
SET SOURCE_ROOT=%1
SET TARGET_ROOT=%2
SET ARGUMENTS=%3
SET XCOPY_COMMAND=%windir%\system32\xcopy
SET TARGET_ROOT=%TARGET_ROOT:"=%
SET TARGET_ROOT=%TARGET_ROOT:/=\%
SET SOURCE_ROOT=%SOURCE_ROOT:"=%
SET SOURCE_ROOT=%SOURCE_ROOT:/=\%
IF "" == "%SOURCE_ROOT%" (
ECHO Error: No source root parameter set.
GOTO ON_ERROR
)
IF "" == "%TARGET_ROOT%" (
ECHO Error: No target root parameter set.
GOTO ON_ERROR
)
IF NOT EXIST %SOURCE_ROOT% (
ECHO Error: source directory '%SOURCE_ROOT%', directory doesn't eixst.
GOTO ON_ERROR
)
IF NOT EXIST %TARGET_ROOT% (
ECHO Target directory '%TARGET_ROOT%', directory doesn't eixst, creating....
mkdir %TARGET_ROOT%
ECHO Target directory '%TARGET_ROOT%' created.
)
IF "\" == "%SOURCE_ROOT:~-1%" (
SET SOURCE_ROOT=%SOURCE_ROOT:~0,-1%
)
IF "\" == "%TARGET_ROOT:~-1%" (
SET TARGET_ROOT=%TARGET_ROOT:~0,-1%
)
SET OPTIONS=/y
IF "-v" == "%ARGUMENTS%" (
SET OPTIONS=/f /y
)
IF "-q" == "%ARGUMENTS%" (
SET "OPTIONS=/q /y"
)
ECHO Copying mono include files from %SOURCE_ROOT% to %TARGET_ROOT% ...
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\cil\opcode.def" "%TARGET_ROOT%\cil\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\mini\jit.h" "%TARGET_ROOT%\jit\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\metadata\*.h" "%TARGET_ROOT%\metadata\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-counters.h" "%TARGET_ROOT%\utils\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-dl-fallback.h" "%TARGET_ROOT%\utils\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-error.h" "%TARGET_ROOT%\utils\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-logger.h" "%TARGET_ROOT%\utils\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-publib.h" "%TARGET_ROOT%\utils\" %OPTIONS%
call :runCommand "%RUN%" %ARGUMENTS%
ECHO Copying mono include files from %SOURCE_ROOT% to %TARGET_ROOT% DONE.
EXIT /b 0
:ON_ERROR
ECHO "libmono.bat [SOURCE_ROOT] [TARGET_ROOT] [ARGUMENTS]"
EXIT /b 1
@ECHO on
:runCommand
IF "-q" == "%~2" (
%~1 >nul 2>&1
) ELSE (
%~1
)
goto :EOF