Revision 1433 trunk/scripts/admb/admb.bat

admb.bat (revision 1433)
111 111
) else (
112 112
  set CXXFLAGS= -c
113 113
)
114
if defined d (
115
  if defined LDFLAGS (
116
    set LDFLAGS= -shared !LDFLAGS!
117
  ) else (
118
    set LDFLAGS= -shared
119
  )
120
)
114 121
if defined LDFLAGS (
115 122
  set LDFLAGS= -static !LDFLAGS!
116 123
) else (
......
140 147
  if not defined d (
141 148
    set LL=g++
142 149
  ) else (
143
    set LL=dllwrap
150
    set LL=g++
144 151
  )
145 152
)
146 153
if defined g (
......
266 273
      set main=%%~na
267 274
      @REM set CMD=adlink!d!!g!!r!!fast! !objs!
268 275
      if defined d (
269
        set CMD=!LL!!LDFLAGS! -def !main!.def --driver-name !CXX! --output-lib !main!.dll --output-lib lib!main!.a -o !main!.dll !objs! !libs!
276
        set CMD=!LL!!LDFLAGS! -o !main!.dll !objs! !libs!
270 277
      ) else (
271 278
        set CMD=!LL!!LDFLAGS! -o !main!.exe !objs! !libs!
272 279
      )
273 280
      echo.&echo *** Linking !objs!:
274 281
      echo !CMD!
275 282
      call !CMD!
276
      if not exist !main!.exe (
277
        goto ERROR
283
      if defined d (
284
        if not exist !main!.dll (
285
          goto ERROR
286
        )
287
        echo.&echo Successfully built '!main!.dll'.
288
        goto SUCCESS
289
      ) else (
290
        if not exist !main!.exe (
291
          goto ERROR
292
        )
293
        echo.&echo Successfully built '!main!.exe'.
294
        goto EOF
278 295
      )
279
      echo.&echo Successfully built executable '!main!.exe'.
280
      goto EOF
281 296
    )
282 297
  )
283 298
) else (
......
285 300
    set tpl=%%~na
286 301
    @REM set CMD=adlink!d!!g!!r!!fast! !tpl!.obj !objs!
287 302
    if defined d (
288
      set CMD=!LL!!LDFLAGS! -def !tpl!.def --driver-name !CXX! --output-lib !tpl!.dll --output-lib lib!tpl!.a -o !tpl!.dll !objs! !libs!
303
      set CMD=!LL!!LDFLAGS! -o !tpl!.dll !objs! !libs!
289 304
    ) else (
290 305
      if defined objs (
291 306
        set CMD=!LL!!LDFLAGS! -o !tpl!.exe !tpl!.obj !objs! !libs!
......
304 319
      if not exist !tpl!.dll (
305 320
        goto ERROR
306 321
      )
307
      echo.&echo Successfully built executable '!tpl!.dll'.
322
      echo.&echo Successfully built '!tpl!.dll'.
308 323
      goto SUCCESS
309 324
    ) else (
310 325
      if not exist !tpl!.exe (
311 326
        goto ERROR
312 327
      )
313
      echo.&echo Successfully built executable '!tpl!.exe'.
328
      echo.&echo Successfully built '!tpl!.exe'.
314 329
      goto SUCCESS
315 330
    )
316 331
  )
......
318 333
:SUCCESS
319 334
goto EOF
320 335
:ERROR
321
echo.&echo Error: Unable to build executable.
336
echo.&echo Error: Unable to build.
322 337
echo.&echo COMSPEC=%COMSPEC%.
323 338
echo.&echo PATH=%PATH%.
324 339
goto EOF

Also available in: Unified diff