update dev300-m58
[ooovba.git] / solenv / inc / tg_shl.mk
blobdf1265adc3808e59052b4c8c49dd9963d2385004
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: tg_shl.mk,v $
11 # $Revision: 1.127 $
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 #######################################################
33 # targets for linking
34 # unroll begin
36 .IF "$(SHL$(TNR)TARGETN)"!=""
38 .IF "$(OS)"=="AIX"
39 SHL$(TNR)STDLIBS=
40 .ENDIF
42 .IF "$(SHLLINKARCONLY)" != ""
43 SHL$(TNR)STDLIBS=
44 STDSHL=
45 .ELSE
46 SHL$(TNR)ARCHIVES=
47 .ENDIF
49 # decide how to link
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"
60 SHL$(TNR)RPATH*=OOO
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)
73 .ENDIF
74 .ENDIF # "$(SHL$(TNR)NOCHECK)"!=""
75 .ENDIF
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
83 .IF "$(GUI)" == "UNX"
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)"!=""
95 .IF "$(GUI)" != "UNX"
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"
112 USE_SHL$(TNR)DEF=
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)"!=""
134 .IF "$(OS)"!="IRIX"
135 SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP)
136 .ENDIF
138 $(USE_SHL$(TNR)VERSIONMAP): \
139 $(SHL$(TNR)OBJS)\
140 $(SHL$(TNR)LIBS)\
141 $(SHL$(TNR)FILTERFILE)
142 @$(RM) $@.dump
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
147 .ELSE
148 @nm $(SHL$(TNR)OBJS:s/.obj/.o/) > $@.dump
149 .ENDIF
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 -----------------------------
160 @$(TOUCH) $@
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)
169 .IF "$(OS)"!="IRIX"
170 SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP)
171 .ENDIF
173 .IF "$(OS)"=="MACOSX"
174 $(USE_SHL$(TNR)VERSIONMAP): $(SHL$(TNR)OBJS) $(SHL$(TNR)LIBS)
175 .ENDIF
177 $(USE_SHL$(TNR)VERSIONMAP): $(SHL$(TNR)VERSIONMAP)
178 @@-$(RM) -f $@
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)
184 .ENDIF
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"
194 @chmod a+w $@
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
204 .ENDIF
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
207 .ENDIF
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"
218 .IF "$(GUI)"=="UNX"
219 .IF "$(OS)"=="IRIX"
220 SHL$(TNR)SONAME=$(SONAME_SWITCH)$(SHL$(TNR)TARGETN:f)
221 .ELSE
222 SHL$(TNR)SONAME=\"$(SONAME_SWITCH)$(SHL$(TNR)TARGETN:f)\"
223 .ENDIF
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)"!=""
243 .IF "$(linkinc)"!=""
244 .IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
245 .IF "$(SHL$(TNR)LIBS)"!=""
246 $(MISC)/$(SHL$(TNR)TARGET)_linkinc.ls .PHONY:
247 @@-$(RM) $@
248 $(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL$(TNR)LIBS) $(i:s/.lib/.lin/)) >> $@
249 .ENDIF # "$(SHL$(TNR)LIBS)"!=""
250 .ENDIF
252 LINKINCTARGETS+=$(MISC)/$(SHL$(TNR)TARGETN:b)_linkinc.ls
253 $(SHL$(TNR)TARGETN) : $(LINKINCTARGETS)
255 .ELSE
256 .IF "$(SHL$(TNR)USE_EXPORTS)"=="name"
257 .IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
258 .IF "$(COM)"!="GCC"
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)
263 @@-$(RM) $@
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"
267 .ENDIF
268 .ENDIF # "$(SHL$(TNR)USE_EXPORTS)"=="name"
270 $(MISC)/%linkinc.ls:
271 echo . > $@
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))
278 .ENDIF
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))
283 .ELSE
284 SHL$(TNR)IMP_ORD =
285 .ENDIF
288 $(SHL$(TNR)TARGETN) : \
289 $(SHL$(TNR)OBJS)\
290 $(SHL$(TNR)LIBS)\
291 $(USE_$(TNR)IMPLIB_DEPS)\
292 $(USE_SHL$(TNR)DEF)\
293 $(USE_SHL$(TNR)VERSIONMAP)\
294 $(SHL$(TNR)RES)\
295 $(SHL$(TNR)DEPN) \
296 $(SHL$(TNR)IMP_ORD) \
297 $(SHL$(TNR)LINKLIST)
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
305 .ENDIF
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)
323 .IF "$(COM)"=="GCC"
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
346 .ELSE
347 .IF "$(linkinc)"==""
348 .IF "$(SHL$(TNR)USE_EXPORTS)"!="name"
349 .IF "$(USE_DEFFILE)"!=""
350 $(SHL$(TNR)LINKER) @$(mktmp \
351 $(SHL$(TNR)LINKFLAGS) \
352 $(LINKFLAGSSHL) \
353 $(SHL$(TNR)STACK) $(SHL$(TNR)BASEX) \
354 -out:$@ \
355 -map:$(MISC)/$(@:b).map \
356 -def:$(SHL$(TNR)DEF) \
357 $(USE_$(TNR)IMPLIB) \
358 $(STDOBJ) \
359 $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)OBJS) \
360 $(SHL$(TNR)LIBS) \
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?
366 @@$(LS) $@
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)
371 .ELSE
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 \
382 $(STDOBJ) \
383 $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ) \
384 $(SHL$(TNR)LIBS) \
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?
390 @@$(LS) $@
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)
395 .ELSE
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) \
407 $(STDOBJ) \
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)
418 .ELSE
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
427 $(TYPE) $(mktmp \
428 $(SHL$(TNR)LINKFLAGS) \
429 $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
430 $(SHL$(TNR)STACK) $(MAPFILE) \
431 -out:$@ \
432 $(LB)/$(SHL$(TNR)IMPLIB).exp \
433 $(STDOBJ) \
434 $(SHL$(TNR)OBJS) \
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)
445 .ELSE
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"
453 .IF "$(GUI)"=="UNX"
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)"!=""
475 .ENDIF
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)"!=""
496 @ls -l $@
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
505 .ENDIF
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 $@ \
524 $(SHL$(TNR)DEF) \
525 $(STDOBJ) \
526 -L$(LB) \
527 -L$(SOLARVERSION)/$(INPATH)/lib \
528 $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ) \
529 $(SHL$(TNR)LIBS) \
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) \
539 $(SHL$(TNR)DEF) \
540 $(STDOBJ) \
541 -L$(LB) \
542 -L$(SOLARVERSION)/$(INPATH)/lib \
543 $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ) \
544 $(SHL$(TNR)LIBS) \
545 $(SHL$(TNR)STDLIBS:^"-l") \
546 $(SHL$(TNR)LINKRES) \
547 $(SHL$(TNR)STDSHL:^"-l") $(STDSHL$(TNR):^"-l") \
548 $(LINKOUTPUTFILTER)
549 @$(LS) $@ >& $(NULLDEV)
551 .ENDIF # "$(USE_DEFFILE)"!=""
553 .IF "$(SHL$(TNR)TARGET8)" != "$(SHL$(TNR)TARGET)"
554 +$(COPY) $@ $(@:d)$(SHL$(TNR)TARGET8).dll
555 .ENDIF
557 .ENDIF # "$(GUI)" == "OS2"
560 .IF "$(TESTDIR)"!=""
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)"!=""
571 # unroll end
572 #######################################################
574 #-------------------------------------------------------------------------
576 #######################################################
577 # Anweisungen fuer das Linken
578 # unroll begin
580 .IF "$(SHL$(TNR)IMPLIBN)" != ""
582 .IF "$(UPDATER)"=="YES"
583 USELIB$(TNR)DEPN+=$(SHL$(TNR)LIBS)
584 .ELSE
585 .ENDIF
587 .IF "$(USE_DEFFILE)"!=""
588 USE_SHL$(TNR)TARGET=$(SHL$(TNR)TARGETN)
589 .ENDIF
591 .IF "$(GUI)" != "UNX"
592 $(SHL$(TNR)IMPLIBN): \
593 $(SHL$(TNR)DEF) \
594 $(USE_SHL$(TNR)TARGET) \
595 $(USELIB$(TNR)DEPN) \
596 $(USELIBDEPN)
597 .ELSE
598 $(SHL$(TNR)IMPLIBN): \
599 $(SHL$(TNR)LIBS)
600 .ENDIF
601 @echo ------------------------------1
602 @echo Making: $(SHL$(TNR)IMPLIBN)
603 .IF "$(GUI)" == "WNT"
604 .IF "$(COM)"=="GCC"
605 @echo no ImportLibs on mingw
606 @-$(RM) $@
607 @$(TOUCH) $@
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 $@
615 @$(TOUCH) $@
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 $@
626 .ELSE
627 @echo no ImportLibs on Mac and *ix
628 @-$(RM) $@
629 @$(TOUCH) $@
630 .ENDIF
631 .ENDIF
633 # unroll end
634 #######################################################