-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
127 lines (104 loc) · 2.5 KB
/
build.bat
File metadata and controls
127 lines (104 loc) · 2.5 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@echo off
::源文件设置
set sourcefile[0]=xxxx
::程序文件输出目录设置
set OUTFILE=%xxxx%
::包文件输出目录及文件名
set EPKFILE=%xxxx%
::系统包含目录设置
set INCLUDEPATH=%xxxx%
::设备文件目录及文件名
set DDBLIBFILE=%xxxx%
::要引用的功能模块文件目录及文件名
set MODULELIBS=%xxxx%
echo *************** start of precompiler ************************
set "x=0"
:PrecompileLoop
if not defined sourcefile[%x%] goto :endPrecompileLoop
call set cppfile=%%sourcefile[%x%]%%.cpp
call set dpcfile=temp/%%sourcefile[%x%]%%.dpc
dp -DEXTERNC -DCPLUS -I %INCLUDEPATH% %cppfile% %dpcfile%
if not "%errorlevel%"=="0" (goto dperror)
echo precompile file %cppfile% OK!!!
SET /a "x+=1"
goto :PrecompileLoop
:endPrecompileLoop
goto dpcompile
:dperror
echo precompiler error!
pause
exit
:dpcompile
echo precompiler complete!
echo *************** start of cplus ************************
set "x=0"
:cplusLoop
if not defined sourcefile[%x%] goto :endcplusLoop
call set _filename=%%sourcefile[%x%]%%
call set ccfile=temp/%%sourcefile[%x%]%%.cc
call set dpcfile=temp/%%sourcefile[%x%]%%.dpc
cplus -s %_filename% < %dpcfile% > %ccfile%
if not "%errorlevel%"=="0" (goto cpluserror)
echo cplus file %ccfile% OK!!!
SET /a "x+=1"
goto :cplusLoop
:endcplusLoop
goto cpluscompile
:cpluserror
echo cplus error!
pause
exit
:cpluscompile
echo cplus complete!
echo *************** start of compiler ************************
set "x=0"
:CompileLoop
if not defined sourcefile[%x%] goto :endCompileLoop
call set dpcfile=temp/%%sourcefile[%x%]%%.cc
call set asmfile=lib/%%sourcefile[%x%]%%.asm
call set cfile=%%sourcefile[%x%]%%.c
echo compile file %cfile%
dc %dpcfile% %asmfile%
echo compile file %cfile% OK!!!
if not "%errorlevel%"=="0" (goto dcerror)
SET /a "x+=1"
goto :CompileLoop
:endCompileLoop
goto dccompile
:dcerror
echo compiler error!
pause
exit
:dccompile
echo compiler complete!
echo *************** start of link ************************
set "x=0"
SET LinkFile=
:LinkLoop
if not defined sourcefile[%x%] goto :endLinkLoop
call set asmfile=lib/%%sourcefile[%x%]%%.asm
SET LinkFile=%LinkFile% %asmfile%
SET /a "x+=1"
goto :LinkLoop
:endLinkLoop
dlbc1 -O -o %OUTFILE% %DDBLIBFILE% %MODULELIBS% %LinkFile%
if not "%errorlevel%"=="0" (goto dlerror)
goto dlcompile
:dlerror
echo link error!
pause
exit
:dlcompile
echo link complete!
echo *************** start of pack ************************
packfile -build bin %EPKFILE%
if not "%errorlevel%"=="0" (goto packerror)
goto packcompile
:packerror
echo pack error!
pause
exit
:packcompile
echo pack complete!
echo all complete!
exit