1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: tg_shl.mk,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 #######################################################
36 .IF
"$(SHL$(TNR)TARGETN)"!=""
42 .IF
"$(SHLLINKARCONLY)" != ""
50 .IF
"$(SHL$(TNR)CODETYPE)"=="C"
51 SHL
$(TNR
)LINKER
=$(LINKC
)
52 SHL
$(TNR
)STDSHL
=$(subst,CPPRUNTIME
, $(STDSHL
))
53 SHL
$(TNR
)LINKFLAGS
+=$(LINKCFLAGS
)
54 .ELSE
# "$(SHL$(TNR)CODETYPE)"=="C"
55 SHL
$(TNR
)LINKER
=$(LINK
)
56 SHL
$(TNR
)STDSHL
=$(subst,CPPRUNTIME
,$(STDLIBCPP
) $(STDSHL
))
57 SHL
$(TNR
)LINKFLAGS
+=$(LINKFLAGS
)
58 .ENDIF
# "$(SHL$(TNR)CODETYPE)"=="C"
61 LINKFLAGSRUNPATH_
$(SHL
$(TNR
)RPATH
)*=/ERROR
:/Bad_SHL
$(TNR
)RPATH_value
62 SHL
$(TNR
)LINKFLAGS
+=$(LINKFLAGSRUNPATH_
$(SHL
$(TNR
)RPATH
))
64 .IF
"$(SHL$(TNR)USE_EXPORTS)"==""
65 SHL
$(TNR
)DEF
*=$(MISC
)/$(SHL
$(TNR
)TARGET
).def
66 .ENDIF
# "$(SHL$(TNR)USE_EXPORTS)"==""
68 EXTRALIBPATHS
$(TNR
)=$(EXTRALIBPATHS
)
69 .IF
"$(UPDATER)"=="YES"
70 .IF
"$(SHL$(TNR)NOCHECK)"==""
71 .IF
"$(SOLAR_STLLIBPATH)"!=""
72 EXTRALIBPATHS
$(TNR
)+=-L
$(SOLAR_STLLIBPATH
)
74 .ENDIF
# "$(SHL$(TNR)NOCHECK)"!=""
76 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
77 #+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
78 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
80 .IF
"$(VERSIONOBJ)"!=""
81 SHL
$(TNR
)VERSIONOBJ
:=$(VERSIONOBJ
:d
){$(subst,$(DLLPOSTFIX
),_dflt
$(SHL
$(TNR
)TARGET
))}$(VERSIONOBJ
:f
)
82 USE_VERSIONH
:=$(INCCOM
)/$(SHL
$(TNR
)VERSIONOBJ
:b
).h
84 SHL
$(TNR
)VERSIONOBJDEP
:=$(VERSIONOBJ
:d
){$(subst,$(DLLPOSTFIX
),_dflt
$(SHL
$(TNR
)TARGET
))}$(VERSIONOBJ
:f
:s
/.o
/.obj
/)
85 .ELSE
# "$(GUI)" == "UNX"
86 SHL
$(TNR
)VERSIONOBJDEP
:=$(VERSIONOBJ
:d
){$(subst,$(DLLPOSTFIX
),_dflt
$(SHL
$(TNR
)TARGET
))}$(VERSIONOBJ
:f
)
87 .ENDIF
# "$(GUI)" == "UNX"
88 $(MISC
)/$(SHL
$(TNR
)VERSIONOBJ
:b
).c
: $(SOLARENV
)/src
/version.c
$(INCCOM
)/$(SHL
$(TNR
)VERSIONOBJ
:b
).h
89 # $(COPY) $(SOLARENV)/src/version.c $@
90 $(TYPE
) $(SOLARENV
)/src
/version.c |
$(SED
) s
/_version.h
/$(SHL
$(TNR
)VERSIONOBJ
:b
).h
/ > $@
92 .INIT
: $(SHL
$(TNR
)VERSIONOBJDEP
)
93 .ENDIF
# "$(VERSIONOBJ)"!=""
96 .IF
"$(GUI)" == "WNT" ||
"$(GUI)" == "OS2"
97 .IF
"$(SHL$(TNR)IMPLIB)" == ""
98 SHL
$(TNR
)IMPLIB
=i
$(TARGET
)_t
$(TNR
)
99 .ENDIF
# "$(SHL$(TNR)IMPLIB)" == ""
100 .IF
"$(COM)" != "GCC"
101 USE_
$(TNR
)IMPLIB
=-implib
:$(LB
)/$(SHL
$(TNR
)IMPLIB
).lib
102 .ENDIF
# "$(COM)" != "GCC"
103 SHL
$(TNR
)IMPLIBN
=$(LB
)/$(SHL
$(TNR
)IMPLIB
).lib
104 ALLTAR
: $(SHL
$(TNR
)IMPLIBN
)
106 .IF
"$(USE_DEFFILE)"==""
107 USE_
$(TNR
)IMPLIB_DEPS
=$(LB
)/$(SHL
$(TNR
)IMPLIB
).lib
108 .ENDIF
# "$(USE_DEFFILE)"==""
109 .ENDIF
# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
110 USE_SHL
$(TNR
)DEF
=$(SHL
$(TNR
)DEF
)
111 .ELSE
# "$(GUI)" != "UNX"
113 SHL
$(TNR
)DEPN
+:=$(SHL
$(TNR
)DEPNU
)
115 .IF
"$(SHL$(TNR)VERSIONMAP)"==""
116 # to activate vmaps remove "#"
117 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)TARGET
).vmap
118 .ENDIF
# "$(SHL$(TNR)VERSIONMAP)"==""
120 .IF
"$(USE_SHL$(TNR)VERSIONMAP)"!=""
122 .IF
"$(SHL$(TNR)FILTERFILE)"!=""
123 .IF
"$(SHL$(TNR)VERSIONMAP)"!=""
124 #eine von beiden ist zuviel
125 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)TARGET
).vmap
126 $(USE_SHL
$(TNR
)VERSIONMAP
) .PHONY
:
127 @echo
-----------------------------
128 @echo you should only use versionmap OR exportfile
129 @echo
-----------------------------
130 # force_dmake_to_error
132 .ENDIF
# "$(SHL$(TNR)VERSIONMAP)"!=""
135 SHL
$(TNR
)VERSIONMAPPARA
=$(LINKVERSIONMAPFLAG
) $(USE_SHL
$(TNR
)VERSIONMAP
)
138 $(USE_SHL
$(TNR
)VERSIONMAP
): \
141 $(SHL
$(TNR
)FILTERFILE
)
143 .IF
"$(SHL$(TNR)OBJS)"!=""
144 # dump remaining objects on the fly
145 .IF
"$(OS)"=="MACOSX"
146 @
-nm
$(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) > $@.dump
148 @nm
$(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) > $@.dump
150 .ENDIF
# "$(SHL$(TNR)OBJS)!"=""
151 @
$(TYPE
) /dev
/null
$(SHL
$(TNR
)LIBS
:s
/.lib
/.dump
/) >> $@.dump
152 $(PERL
) $(SOLARENV
)/bin
/mapgen.pl
-d
$@.dump
-s
$(SHL
$(TNR
)INTERFACE
) -f
$(SHL
$(TNR
)FILTERFILE
) -m
$@
154 .ELSE
# "$(SHL$(TNR)FILTERFILE)"!=""
155 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)TARGET
).vmap
156 $(USE_SHL
$(TNR
)VERSIONMAP
) :
157 @echo
-----------------------------
158 @echo SHL
$(TNR
)FILTERFILE not set
!
159 @echo
-----------------------------
161 @echo dummy file to keep the dependencies for later use.
162 # force_dmake_to_error
163 .ENDIF
# "$(SHL$(TNR)FILTERFILE)"!=""
164 .ELSE
# "$(USE_SHL$(TNR)VERSIONMAP)"!=""
166 #and now for the plain non-generic way...
167 .IF
"$(SHL$(TNR)VERSIONMAP)"!=""
168 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)VERSIONMAP
:b
)_
$(SHL
$(TNR
)TARGET
)$(SHL
$(TNR
)VERSIONMAP
:e
)
170 SHL
$(TNR
)VERSIONMAPPARA
=$(LINKVERSIONMAPFLAG
) $(USE_SHL
$(TNR
)VERSIONMAP
)
173 .IF
"$(OS)"=="MACOSX"
174 $(USE_SHL
$(TNR
)VERSIONMAP
): $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)LIBS
)
177 $(USE_SHL
$(TNR
)VERSIONMAP
): $(SHL
$(TNR
)VERSIONMAP
)
179 # The following files will only be generated and needed on Mac OS X as temporary files
180 # in order to generate exported symbols list out of Linux/Solaris map files
181 .IF
"$(OS)"=="MACOSX"
182 @
-$(RM
) -f
$@.symregexp
>& $(NULLDEV
)
183 @
-$(RM
) -f
$@.expsymlist
>& $(NULLDEV
)
185 # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
186 # happens if somebody will change it in the future
187 .IF
"$(COMID)"=="gcc3"
188 tr
-d
"\015" < $(SHL
$(TNR
)VERSIONMAP
) |
$(AWK
) -f
$(SOLARENV
)/bin
/addsym.awk
> $@
189 .ELIF
"$(COMNAME)"=="sunpro5"
190 tr
-d
"\015" < $(SHL
$(TNR
)VERSIONMAP
) |
$(GREP
) -v
$(IGNORE_SYMBOLS
) > $@
191 .ELSE
# "$(COMID)"=="gcc3"
192 tr
-d
"\015" < $(SHL
$(TNR
)VERSIONMAP
) > $@
193 .ENDIF
# "$(COMID)"=="gcc3"
195 # Mac OS X post-processing generate an exported symbols list from the generated map file
196 # for details on exported symbols list see man ld on Mac OS X
197 .IF
"$(OS)"=="MACOSX"
198 -cat
$@ |
$(AWK
) -f
$(SOLARENV
)/bin
/unxmap-to-macosx-explist.awk | grep
-v
"\*\|?" > $@.exported-symbols
199 -cat
$@ |
$(AWK
) -f
$(SOLARENV
)/bin
/unxmap-to-macosx-explist.awk | grep
"\*\|?" > $@.symbols-regexp
200 # Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
201 # Extract RTTI symbols from all the objects that will be used to build a shared library
202 .IF
"$(SHL$(TNR)OBJS)"!=""
203 -echo
$(foreach,i
,$(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) $i) | xargs
-n1 nm
-gx |
$(SOLARENV
)/bin
/addsym-macosx.sh
$@.symbols-regexp
$@.symbols-regexp.tmp
>> $@.exported-symbols
205 .IF
"$(SHL$(TNR)LIBS)"!=""
206 -$(TYPE
) $(foreach,j
,$(SHL
$(TNR
)LIBS
) $j) |
$(SED
) s\
#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
208 # overwrite the map file generate into the local output tree with the generated
209 # exported symbols list
210 cp
$@.exported-symbols
$@
211 .ENDIF
# .IF "$(OS)"=="MACOSX"
212 .ENDIF
# "$(SHL$(TNR)VERSIONMAP)"!=""
213 .ENDIF
# "$(USE_SHL$(TNR)VERSIONMAP)"!=""
214 .ENDIF
# "$(GUI)" != "UNX"
216 .IF
"$(UNIXVERSIONNAMES)"!=""
217 .IF
"$(OS)"!="MACOSX"
220 SHL
$(TNR
)SONAME
=$(SONAME_SWITCH
)$(SHL
$(TNR
)TARGETN
:f
)
222 SHL
$(TNR
)SONAME
=\"$(SONAME_SWITCH
)$(SHL
$(TNR
)TARGETN
:f
)\"
224 .ENDIF
# "$(GUI)"!="UNX"
225 .ENDIF
# "$(OS)"!="MACOSX"
226 .ENDIF
# "$(UNIXVERSIONNAMES)"!=""
228 .IF
"$(SHL$(TNR)RES)"!=""
229 SHL
$(TNR
)ALLRES
+=$(SHL
$(TNR
)RES
)
230 SHL
$(TNR
)LINKRES
*=$(MISC
)/$(SHL
$(TNR
)TARGET
).res
231 SHL
$(TNR
)LINKRESO
*=$(MISC
)/$(SHL
$(TNR
)TARGET
)_res.o
232 .ENDIF
# "$(SHL$(TNR)RES)"!=""
234 .IF
"$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
235 SHL
$(TNR
)DEFAULTRES
*=$(MISC
)/$(SHL
$(TNR
)TARGET
)_def.res
236 SHL
$(TNR
)ALLRES
+=$(SHL
$(TNR
)DEFAULTRES
)
237 SHL
$(TNR
)LINKRES
*=$(MISC
)/$(SHL
$(TNR
)TARGET
).res
238 SHL
$(TNR
)LINKRESO
*=$(MISC
)/$(SHL
$(TNR
)TARGET
)_res.o
239 .ENDIF
# "$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
241 #.IF "$(SHL$(TNR)TARGETN)"!=""
244 .IF
"$(GUI)"=="WNT" ||
"$(GUI)" == "OS2"
245 .IF
"$(SHL$(TNR)LIBS)"!=""
246 $(MISC
)/$(SHL
$(TNR
)TARGET
)_linkinc.ls .PHONY
:
248 $(SED
) -f
$(SOLARENV
)/bin
/chrel.sed
$(foreach,i
,$(SHL
$(TNR
)LIBS
) $(i
:s
/.lib
/.lin
/)) >> $@
249 .ENDIF
# "$(SHL$(TNR)LIBS)"!=""
252 LINKINCTARGETS
+=$(MISC
)/$(SHL
$(TNR
)TARGETN
:b
)_linkinc.ls
253 $(SHL
$(TNR
)TARGETN
) : $(LINKINCTARGETS
)
256 .IF
"$(SHL$(TNR)USE_EXPORTS)"=="name"
257 .IF
"$(GUI)"=="WNT" ||
"$(GUI)" == "OS2"
259 .IF
"$(SHL$(TNR)LIBS)"!=""
260 SHL
$(TNR
)LINKLIST
=$(MISC
)/$(SHL
$(TNR
)TARGET
)_link.lst
261 SHL
$(TNR
)LINKLISTPARAM
=@
$(SHL
$(TNR
)LINKLIST
)
262 $(SHL
$(TNR
)LINKLIST
) : $(SHL
$(TNR
)LIBS
)
264 $(SED
) -f
$(SOLARENV
)/bin
/chrel.sed
$(foreach,i
,$(SHL
$(TNR
)LIBS
) $(i
:s
/.lib
/.lin
/)) >> $@
265 .ENDIF
# "$(SHL$(TNR)LIBS)"!=""
266 .ENDIF
# "$(COM)"!="GCC"
268 .ENDIF
# "$(SHL$(TNR)USE_EXPORTS)"=="name"
272 .ENDIF
# "$(linkinc)"!=""
274 .IF
"$(GUI)" == "OS2"
275 #21/02/2006 YD dll names must be 8.3, invoke fix script
276 #check osl/os2/module.c/osl_loadModule()
277 SHL
$(TNR
)TARGET8
=$(shell @fix_shl
$(SHL
$(TNR
)TARGET
))
280 .IF
"$(GUI)" == "OS2"
281 _SHL
$(TNR
)IMP_ORD
= $(SHL
$(TNR
)STDLIBS
:^
"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL
$(TNR
)STDLIBS
:^
"$(LB)/")
282 SHL
$(TNR
)IMP_ORD
= $(foreach,i
,$(_SHL
$(TNR
)IMP_ORD
) $(shell @
-ls
$i))
288 $(SHL
$(TNR
)TARGETN
) : \
291 $(USE_
$(TNR
)IMPLIB_DEPS
)\
293 $(USE_SHL
$(TNR
)VERSIONMAP
)\
296 $(SHL
$(TNR
)IMP_ORD
) \
298 @echo
------------------------------
299 @echo Making
: $(SHL
$(TNR
)TARGETN
)
300 .IF
"$(GUI)" == "WNT"
301 .IF
"$(SHL$(TNR)DEFAULTRES)"!=""
302 @@
-$(RM
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
303 .IF
"$(SHL$(TNR)ICON)" != ""
304 @echo
1 ICON
$(SHL
$(TNR
)ICON
) >> $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
306 .IF
"$(use_shl_versions)" != ""
307 .IF
"$(SHL$(TNR)ADD_VERINFO)"!=""
308 @echo
$(EMQ
)#include $(EMQ)"$(SHL$(TNR)ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
309 .ELSE
# "$(SHL$(TNR)ADD_VERINFO)"!=""
310 @echo
$(EMQ
)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
311 @echo
$(EMQ
)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
312 @echo
$(EMQ
)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
313 .ENDIF
# "$(SHL$(TNR)ADD_VERINFO)"!=""
314 @echo
$(EMQ
)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
315 @echo
$(EMQ
)#define ORG_NAME $(SHL$(TNR)TARGET)$(DLLPOST) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
316 @echo
$(EMQ
)#define INTERNAL_NAME $(SHL$(TNR)TARGET:b) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
317 @echo
$(EMQ
)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
318 .ENDIF
# "$(use_shl_versions)" != ""
319 $(RC
) -DWIN32
$(INCLUDE
) $(RCLINKFLAGS
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
320 .ENDIF
# "$(SHL$(TNR)DEFAULTRES)"!=""
321 .IF
"$(SHL$(TNR)ALLRES)"!=""
322 $(TYPE
) $(SHL
$(TNR
)ALLRES
) > $(SHL
$(TNR
)LINKRES
)
324 windres
$(SHL
$(TNR
)LINKRES
) $(SHL
$(TNR
)LINKRESO
)
325 .ENDIF
# "$(COM)"=="GCC"
326 .ENDIF
# "$(SHL$(TNR)ALLRES)"!=""
327 .IF
"$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
328 @echo dlltool
--input-def
$(SHL
$(TNR
)DEF
) \
329 --dllname
$(SHL
$(TNR
)TARGET
)$(DLLPOST
) \
330 --kill-at
\\ > $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
331 .IF
"$(DEFLIB$(TNR)NAME)"!="" # do not have to include objs
332 @echo
--output-exp
$(MISC
)/$(@
:b
)_exp.o
>> $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
333 .ELSE
# "$(DEFLIB$(TNR)NAME)"!="" # do not have to include objs
334 @echo
--output-exp
$(MISC
)/$(@
:b
)_exp.o \
335 $(STDOBJ
) $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)LINKRESO
) \
336 `$(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` >> $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
337 .ENDIF
# "$(DEFLIB$(TNR)NAME)"!=""
338 @echo
$(LINK
) $(LINKFLAGS
) $(LINKFLAGSSHL
) $(MINGWSSTDOBJ
) -o
$@ \
339 $(STDOBJ
) $(SHL
$(TNR
)VERSIONOBJ
) $(SHL
$(TNR
)DESCRIPTIONOBJ
) $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)LINKRESO
) \
340 `$(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
341 -Wl
,--exclude-libs
,ALL
,--start-group
$(SHL
$(TNR
)STDLIBS
) -Wl
,--end-group \
342 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) $(MISC
)/$(@
:b
)_exp.o
$(MINGWSSTDENDOBJ
) \
343 -Wl
,-Map
,$(MISC
)/$(@
:b
).map
>> $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
344 @
$(TYPE
) $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
345 @
+source
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
348 .IF
"$(SHL$(TNR)USE_EXPORTS)"!="name"
349 .IF
"$(USE_DEFFILE)"!=""
350 $(SHL
$(TNR
)LINKER
) @
$(mktmp \
351 $(SHL
$(TNR
)LINKFLAGS
) \
353 $(SHL
$(TNR
)STACK
) $(SHL
$(TNR
)BASEX
) \
355 -map
:$(MISC
)/$(@
:b
).map \
356 -def
:$(SHL
$(TNR
)DEF
) \
357 $(USE_
$(TNR
)IMPLIB
) \
359 $(SHL
$(TNR
)VERSIONOBJ
) $(SHL
$(TNR
)OBJS
) \
361 $(SHL
$(TNR
)STDLIBS
) \
362 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
363 $(SHL
$(TNR
)LINKRES
) \
364 ) $(LINKOUTPUTFILTER
)
365 # double check if target was really written... still making sense?
367 @echo linking
$@.manifest ...
368 .IF
"$(VISTA_MANIFEST)"!=""
369 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
370 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
372 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
373 .ENDIF
# "$(VISTA_MANIFEST)"!=""
374 $(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
375 $(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
376 .ELSE
# "$(USE_DEFFILE)"!=""
377 $(SHL
$(TNR
)LINKER
) @
$(mktmp
$(SHL
$(TNR
)LINKFLAGS
) \
378 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
379 $(SHL
$(TNR
)STACK
) -out
:$(SHL
$(TNR
)TARGETN
) \
380 -map
:$(MISC
)/$(@
:B
).map \
381 $(LB
)/$(SHL
$(TNR
)IMPLIB
).exp \
383 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
) \
385 $(SHL
$(TNR
)STDLIBS
) \
386 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
387 $(SHL
$(TNR
)LINKRES
) \
388 ) $(LINKOUTPUTFILTER
)
389 # double check if target was really written... still making sense?
391 @echo linking
$@.manifest ...
392 .IF
"$(VISTA_MANIFEST)"!=""
393 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
394 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
396 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
397 .ENDIF
# "$(VISTA_MANIFEST)"!=""
398 $(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
399 $(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
400 .ENDIF
# "$(USE_DEFFILE)"!=""
401 .ELSE
# "$(SHL$(TNR)USE_EXPORTS)"!="name"
402 $(SHL
$(TNR
)LINKER
) @
$(mktmp
$(SHL
$(TNR
)LINKFLAGS
) \
403 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
404 $(SHL
$(TNR
)STACK
) -out
:$(SHL
$(TNR
)TARGETN
) \
405 -map
:$(MISC
)/$(@
:B
).map \
406 $(USE_
$(TNR
)IMPLIB
) \
408 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
)) \
409 $(SHL
$(TNR
)LINKLISTPARAM
) \
410 @
$(mktmp
$(SHL
$(TNR
)STDLIBS
) \
411 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
412 $(SHL
$(TNR
)LINKRES
) \
414 @echo linking
$@.manifest ...
415 .IF
"$(VISTA_MANIFEST)"!=""
416 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
417 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
419 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
420 .ENDIF
# "$(VISTA_MANIFEST)"!=""
421 $(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
422 $(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
423 .ENDIF
# "$(SHL$(TNR)USE_EXPORTS)"!="name"
424 .ELSE
# "$(linkinc)"==""
425 -$(RM
) del
$(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
426 -$(RM
) $(MISC
)/$(SHL
$(TNR
)TARGET
).lst
428 $(SHL
$(TNR
)LINKFLAGS
) \
429 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
430 $(SHL
$(TNR
)STACK
) $(MAPFILE
) \
432 $(LB
)/$(SHL
$(TNR
)IMPLIB
).exp \
435 $(SHL
$(TNR
)STDLIBS
) \
436 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
437 $(SHL
$(TNR
)LINKRES
) \
438 ) >> $(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
439 $(TYPE
) $(MISC
)/$(SHL
$(TNR
)TARGETN
:b
)_linkinc.ls
>> $(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
440 $(SHL
$(TNR
)LINKER
) @
$(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
441 @echo linking
$@.manifest ...
442 .IF
"$(VISTA_MANIFEST)"!=""
443 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
444 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
446 $(IFEXIST
) $@.manifest
$(THEN
) mt.exe
-manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
447 .ENDIF
# "$(VISTA_MANIFEST)"!=""
448 $(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
449 $(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
450 .ENDIF
# "$(linkinc)"==""
451 .ENDIF
# "$(COM)"=="GCC"
452 .ENDIF
# "$(GUI)" == "WNT"
454 .IF
"$(OS)"=="MACOSX"
455 @
-$(RM
) $(MISC
)/$(@
:b
).list
456 @
-$(RM
) $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
457 @echo
$(STDSLO
) $(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) \
458 $(SHL
$(TNR
)VERSIONOBJ
) \
459 `cat /dev/null $(SHL$(TNR)LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr
-s
" " "\n" > $(MISC
)/$(@
:b
).list
460 @echo
-n
$(SHL
$(TNR
)LINKER
) $(SHL
$(TNR
)LINKFLAGS
) $(SHL
$(TNR
)VERSIONMAPPARA
) $(LINKFLAGSSHL
) -L
$(PRJ
)/$(ROUT
)/lib
$(SOLARLIB
) -o
$@ \
461 $(SHL
$(TNR
)STDLIBS
) $(SHL
$(TNR
)ARCHIVES
) $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) -filelist
$(MISC
)/$(@
:b
).list
$(LINKOUTPUT_FILTER
) > $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
462 @
$(PERL
) $(SOLARENV
)/bin
/macosx-dylib-link-list.pl \
463 `cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd` \
464 >> $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
465 @cat
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
466 @
+source
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
467 @
$(PERL
) $(SOLARENV
)/bin
/macosx-change-install-names.pl \
468 shl
$(SHL
$(TNR
)RPATH
) $@
469 @echo
"Making: $@.jnilib"
470 @macosx-create-bundle
$@
471 .IF
"$(UPDATER)"=="YES"
472 .IF
"$(SHL$(TNR)NOCHECK)"==""
473 $(SOLARENV
)/bin
/checkdll.sh
-L
$(LB
) -L
$(SOLARLIBDIR
) $(EXTRALIBPATHS
$(TNR
)) $(SHL
$(TNR
)TARGETN
)
474 .ENDIF
# "$(SHL$(TNR)NOCHECK)"!=""
476 .ELSE
# "$(OS)"=="MACOSX"
477 @
-$(RM
) $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
478 @echo
$(SHL
$(TNR
)LINKER
) $(SHL
$(TNR
)LINKFLAGS
) $(SHL
$(TNR
)SONAME
) $(LINKFLAGSSHL
) $(SHL
$(TNR
)VERSIONMAPPARA
) -L
$(PRJ
)/$(ROUT
)/lib
$(SOLARLIB
) $(STDSLO
) $(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) \
479 $(SHL
$(TNR
)VERSIONOBJ
) -o
$@ \
480 `cat /dev/null $(SHL$(TNR)LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
481 $(SHL
$(TNR
)STDLIBS
) $(SHL
$(TNR
)ARCHIVES
) $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) $(LINKOUTPUT_FILTER
) > $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
482 @cat
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
483 @
+source
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
484 .IF
"$(UPDATER)"=="YES"
485 .IF
"$(SHL$(TNR)NOCHECK)"==""
486 -$(RM
) $(SHL
$(TNR
)TARGETN
:d
)check_
$(SHL
$(TNR
)TARGETN
:f
)
487 $(RENAME
) $(SHL
$(TNR
)TARGETN
) $(SHL
$(TNR
)TARGETN
:d
)check_
$(SHL
$(TNR
)TARGETN
:f
)
488 $(SOLARENV
)/bin
/checkdll.sh
-L
$(LB
) -L
$(SOLARLIBDIR
) $(EXTRALIBPATHS
$(TNR
)) $(SHL
$(TNR
)TARGETN
:d
)check_
$(SHL
$(TNR
)TARGETN
:f
)
489 .ENDIF
# "$(SHL$(TNR)NOCHECK)"!=""
490 .ENDIF
# "$(UPDATER)"=="YES"
491 .ENDIF
# "$(OS)"=="MACOSX"
492 .IF
"$(UNIXVERSIONNAMES)"!=""
493 $(RM
) $(LB
)/$(SHL
$(TNR
)TARGETN
:b
)
494 cd
$(LB
) && ln
-s
$(SHL
$(TNR
)TARGETN
:f
) $(SHL
$(TNR
)TARGETN
:b
)
495 .ENDIF
# "$(UNIXVERSIONNAMES)"!=""
497 .ENDIF
# "$(GUI)" == "UNX"
499 .IF
"$(GUI)" == "OS2"
501 .IF
"$(SHL$(TNR)DEFAULTRES)"!=""
502 @
+-$(RM
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
>& $(NULLDEV
)
503 .IF
"$(SHL$(TNR)ICON)" != ""
504 @
-+echo
1 ICON
$(SHL
$(TNR
)ICON
) >> $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
506 .IF
"$(use_shl_versions)" != ""
507 .IF
"$(SHL$(TNR)ADD_VERINFO)"!=""
508 @
-+echo
$(EMQ
)#include $(EMQ)"$(SHL$(TNR)ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
509 .ENDIF
# "$(SHL$(TNR)ADD_VERINFO)"!=""
510 @
-+echo MENU
1 BEGIN END
>> $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
511 # @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
512 .ENDIF
# "$(use_shl_versions)" != ""
513 # YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
514 $(RC
) -r
-DOS2
$(INCLUDE
) $(RCLINKFLAGS
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
515 .ENDIF
# "$(SHL$(TNR)DEFAULTRES)"!=""
517 .IF
"$(SHL$(TNR)ALLRES)"!=""
518 +$(TYPE
) $(SHL
$(TNR
)ALLRES
) > $(SHL
$(TNR
)LINKRES
)
519 .ENDIF
# "$(SHL$(TNR)ALLRES)"!=""
521 .IF
"$(USE_DEFFILE)"!=""
523 $(SHL
$(TNR
)LINKER
) $(SHL
$(TNR
)LINKFLAGS
) $(LINKFLAGSSHL
) -o
$@ \
527 -L
$(SOLARVERSION
)/$(INPATH
)/lib \
528 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
) \
530 $(SHL
$(TNR
)STDLIBS
:^
"-l") \
531 $(SHL
$(TNR
)LINKRES
) \
532 $(SHL
$(TNR
)STDSHL
:^
"-l") $(STDSHL
$(TNR
):^
"-l")
534 .ELSE
# "$(USE_DEFFILE)"!=""
536 $(SHL
$(TNR
)LINKER
) -v
$(SHL
$(TNR
)LINKFLAGS
) \
537 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
538 $(SHL
$(TNR
)STACK
) -o
$(SHL
$(TNR
)TARGETN
) \
542 -L
$(SOLARVERSION
)/$(INPATH
)/lib \
543 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
) \
545 $(SHL
$(TNR
)STDLIBS
:^
"-l") \
546 $(SHL
$(TNR
)LINKRES
) \
547 $(SHL
$(TNR
)STDSHL
:^
"-l") $(STDSHL
$(TNR
):^
"-l") \
549 @
$(LS
) $@
>& $(NULLDEV
)
551 .ENDIF
# "$(USE_DEFFILE)"!=""
553 .IF
"$(SHL$(TNR)TARGET8)" != "$(SHL$(TNR)TARGET)"
554 +$(COPY
) $@
$(@
:d
)$(SHL
$(TNR
)TARGET8
).dll
557 .ENDIF
# "$(GUI)" == "OS2"
561 .IF
"$(NO_TESTS)"==""
563 ALLTAR
: runtest_
$(SHL
$(TNR
)TARGET
)
565 runtest_
$(SHL
$(TNR
)TARGET
) : $(SHL
$(TNR
)TARGETN
)
566 testshl
$(SHL
$(TNR
)TARGETN
) sce
/$(SHL
$(TNR
)TARGET
).sce
-msg
-skip
567 .ENDIF
# "$(NO_TESTS)"==""
568 .ENDIF
# "$(TESTDIR)"!=""
569 .ENDIF
# "$(SHL$(TNR)TARGETN)"!=""
572 #######################################################
574 #-------------------------------------------------------------------------
576 #######################################################
577 # Anweisungen fuer das Linken
580 .IF
"$(SHL$(TNR)IMPLIBN)" != ""
582 .IF
"$(UPDATER)"=="YES"
583 USELIB
$(TNR
)DEPN
+=$(SHL
$(TNR
)LIBS
)
587 .IF
"$(USE_DEFFILE)"!=""
588 USE_SHL
$(TNR
)TARGET
=$(SHL
$(TNR
)TARGETN
)
591 .IF
"$(GUI)" != "UNX"
592 $(SHL
$(TNR
)IMPLIBN
): \
594 $(USE_SHL
$(TNR
)TARGET
) \
595 $(USELIB
$(TNR
)DEPN
) \
598 $(SHL
$(TNR
)IMPLIBN
): \
601 @echo
------------------------------1
602 @echo Making
: $(SHL
$(TNR
)IMPLIBN
)
603 .IF
"$(GUI)" == "WNT"
605 @echo no ImportLibs on mingw
608 .ELSE
# "$(COM)=="GCC"
609 # bei use_deffile implib von linker erstellt
610 .IF
"$(USE_DEFFILE)"==""
611 $(IMPLIB
) $(IMPLIBFLAGS
) @
$(mktmp
-out
:$(SHL
$(TNR
)IMPLIBN
) \
612 -def
:$(SHL
$(TNR
)DEF
) )
613 .ELSE
# "$(USE_DEFFILE)==""
614 @echo build of
$(SHL
$(TNR
)TARGETN
) creates
$@
616 .ENDIF
# "$(USE_DEFFILE)==""
617 .ENDIF
# "$(COM)"=="GCC"
619 .ELIF
"$(GUI)" == "OS2"
621 # touch creates an empty file, but this is not good for emxomfar, so
622 # create a dummy lib here
623 -$(LIBMGR
) $(LIBFLAGS
) $@
$(SHL
$(TNR
)VERSIONOBJ
)
624 +@echo build of
$(SHL
$(TNR
)TARGETN
) creates
$@
627 @echo no ImportLibs on Mac and
*ix
634 #######################################################