source: CMT/v1r25/mgr/cmt_make_shlib.bat

Last change on this file was 469, checked in by rybkin, 16 years ago

See C.L. 370

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1
2
3@echo off
4
5rem #
6rem set bin=..\%1%
7
8if not defined bin (
9  for /f "usebackq" %%i in (`cmt show macro_value bin`) do set bin=%%i
10)
11set name=%2%
12
13if not exist %bin%\%name%.arc exit
14
15rem # Retreive other arguments in one "tmplinkopts" file :
16
17set tmplinkopts=%bin%\%name%\tmplinkopts.dat
18
19if exist %tmplinkopts% del %tmplinkopts% 
20
21shift 
22shift
23set empty=''
24
25:next
26set x='%1'
27IF %x% EQU %empty% goto end 
28echo %1 >> %tmplinkopts%
29shift
30goto next
31
32:end
33set empty=
34set x=
35
36set indirectlinkopts=
37if exist %tmplinkopts% set indirectlinkopts=@%tmplinkopts% 
38
39rem
40rem  Different detections for "component" libraries
41rem  this is not very clean in the sense that it is linked
42rem  to project-specific implementation.
43rem   We need to define a better way to specify that option
44rem
45
46if exist %bin%\%name%\%name%_dll.obj goto component
47if exist %bin%\%name%\%name%_entries.obj goto componentnew
48
49:linker
50
51%CMTROOT%\%CMTBIN%\cmt.exe build windefs %bin%\%name%.arc >%bin%\%name%.def
52
53lib.exe /nologo /machine:ix86 /def:%bin%\%name%.def /out:%bin%\%name%.lib
54
55if exist %bin%\%name%.dll del %bin%\%name%.dll
56
57link.exe /nologo /dll /out:%bin%\%name%.dll %bin%\%name%.exp %bin%\%name%.arc %indirectlinkopts%
58
59goto return
60
61:component
62
63link.exe /nologo /dll /out:%bin%\%name%.dll %bin%\%name%\%name%_dll.obj %bin%\%name%.arc /machine:ix86 %indirectlinkopts%
64
65goto return
66 
67:componentnew
68 
69echo hello
70link.exe /nologo /dll /out:%bin%\%name%.dll %bin%\%name%\%name%_load.obj %bin%\%name%.arc /machine:ix86 %indirectlinkopts%
71
72:return
73if exist %tmplinkopts% del %tmplinkopts%
74set tmplinkopts=
75
Note: See TracBrowser for help on using the repository browser.