Revision 1085 trunk/scripts/admb/admb.bat

admb.bat (revision 1085)
80 80

  
81 81
for %%a in (!tpls!) do (
82 82
  set model=%%~na
83
  if not exist %%~na.tpl goto ERROR1
83
  if not exist %%~na.tpl (
84
    echo.&echo Error: !model!.tpl not found
85
    goto EOF
86
  )
84 87
  del classdef.tmp xxdata.tmp xxhtop.tmp xxhtopm.tmp xxglobal.tmp xxtopm.tmp 2> NUL
85 88
  del xxalloc.tmp xxalloc1.tmp xxalloc2.tmp xxalloc3.tmp xxalloc4.tmp xxalloc5.tmp xxalloc6.tmp header.tmp 2> NUL
86 89
  del tfile1 tfile2 tfile3 tfile4 tfile5 2> NUL
......
88 91
  set CMD=!parser! !bounds! !dll! !model!
89 92
  echo.&echo *** !CMD!
90 93
  call !CMD!
91
  if not exist !model!.cpp goto ERROR2
92
  if not exist !model!.htp goto ERROR2
94
  if not exist !model!.cpp goto ERROR
95
  if not exist !model!.htp goto ERROR
93 96
)
94 97

  
95 98
for %%b in (!tpls!) do (
......
107 110
)
108 111
for %%a in (!srcs!) do (
109 112
  set src=%%~na
110
  set objs=!objs! !src!.obj
111
)
112
for %%a in (!tpls!) do (
113
  set model=%%~na
114
  set CMD=adlink !d! !g! !r! !s! !model!.obj !objs!
113
  set CMD=adcomp !d! !g! !r! !s! !src!
115 114
  echo.&echo *** !CMD!
116 115
  call !CMD!
117
  if defined dll (
118
    if not exist %%~na.dll goto ERROR2
119
  ) else (
120
    if not exist %%~na.exe goto ERROR2
116
  if exist !src!.obj (
117
    set objs=!objs! !src!.obj
121 118
  )
119
  if not exist !src!.obj (
120
    echo.&echo Error: Unable to build !src!.obj
121
    goto ERROR
122
  )
122 123
)
124
if not defined tpls (
125
  for %%a in (!objs!) do (
126
    set model=%%~na
127
    set CMD=adlink !d! !g! !r! !s! !objs!
128
    echo.&echo *** !CMD!
129
    call !CMD!
130
    if not exist !model!.exe (
131
      goto ERROR
132
    )
133
    goto SUCCESS
134
  )
135
) else (
136
  for %%a in (!tpls!) do (
137
    set model=%%~na
138
    set CMD=adlink !d! !g! !r! !s! !model!.obj !objs!
139
    echo.&echo *** !CMD!
140
    call !CMD!
141
    if defined dll (
142
      if not exist !model!.dll (
143
        goto ERROR
144
      )
145
    ) else (
146
      if not exist !model!.exe (
147
        goto ERROR
148
      )
149
    )
150
  )
151
)
123 152

  
153
:SUCCESS
124 154
echo.&echo Successfully built executable.
125 155
goto EOF
126 156

  
157
:ERROR
158
echo.&echo Error: Unable to build executable.
159
goto EOF
160

  
127 161
:HELP
128 162
echo Usage: admb [-d] [-g] [-r] [-s] model
129 163
echo.
......
138 172
echo.
139 173
goto EOF
140 174

  
141
:ERROR1
142
echo.&echo Error: !model!.tpl not found
143
goto EOF
144

  
145
:ERROR2
146
echo.&echo Error: Could not parse !model!.tpl
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff