Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / solenv / inc / tg_shl.mk
blobb7f24f23f319a0424a2eab36c93b6dc97a3be9e2
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 #######################################################
29 # targets for linking
30 # unroll begin
32 .IF "$(SHL$(TNR)TARGETN)"!=""
34 .IF "$(SHLLINKARCONLY)" != ""
35 SHL$(TNR)STDLIBS=
36 STDSHL=
37 .ELSE
38 SHL$(TNR)ARCHIVES=
39 .ENDIF
41 # decide how to link
42 .IF "$(SHL$(TNR)CODETYPE)"=="C"
43 SHL$(TNR)LINKER=$(LINKC)
44 SHL$(TNR)STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
45 SHL$(TNR)LINKFLAGS+=$(LINKCFLAGS)
46 .ELSE # "$(SHL$(TNR)CODETYPE)"=="C"
47 SHL$(TNR)LINKER=$(LINK)
48 SHL$(TNR)STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
49 SHL$(TNR)LINKFLAGS+=$(LINKFLAGS)
50 .ENDIF # "$(SHL$(TNR)CODETYPE)"=="C"
52 SHL$(TNR)RPATH*=OOO
53 LINKFLAGSRUNPATH_$(SHL$(TNR)RPATH)*=/ERROR:/Bad_SHL$(TNR)RPATH_value
54 SHL$(TNR)LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL$(TNR)RPATH))
56 .IF "$(SHL$(TNR)USE_EXPORTS)"==""
57 SHL$(TNR)DEF*=$(MISC)/$(SHL$(TNR)TARGET).def
58 .ENDIF # "$(SHL$(TNR)USE_EXPORTS)"==""
60 EXTRALIBPATHS$(TNR)=$(EXTRALIBPATHS)
61 .IF "$(SHL$(TNR)NOCHECK)"==""
62 .IF "$(SOLAR_STLLIBPATH)"!=""
63 EXTRALIBPATHS$(TNR)+=-L$(SOLAR_STLLIBPATH)
64 .ENDIF
65 .ENDIF # "$(SHL$(TNR)NOCHECK)"!=""
66 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
67 #+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
68 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
70 .IF "$(L10N_framework)"==""
71 .IF "$(VERSIONOBJ)"!=""
72 SHL$(TNR)VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL$(TNR)TARGET))}$(VERSIONOBJ:f)
73 USE_VERSIONH:=$(INCCOM)/$(SHL$(TNR)VERSIONOBJ:b).h
74 .IF "$(GUI)" == "UNX"
75 SHL$(TNR)VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL$(TNR)TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
76 .ELSE # "$(GUI)" == "UNX"
77 SHL$(TNR)VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL$(TNR)TARGET))}$(VERSIONOBJ:f)
78 .ENDIF # "$(GUI)" == "UNX"
79 $(MISC)/$(SHL$(TNR)VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL$(TNR)VERSIONOBJ:b).h
80 # $(COPY) $(SOLARENV)/src/version.c $@
81 $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL$(TNR)VERSIONOBJ:b).h/ > $@
83 .INIT : $(SHL$(TNR)VERSIONOBJDEP)
84 .ENDIF # "$(VERSIONOBJ)"!=""
85 .ENDIF
87 .IF "$(GUI)" != "UNX"
88 .IF "$(GUI)" == "WNT"
89 .IF "$(SHL$(TNR)IMPLIB)" == ""
90 SHL$(TNR)IMPLIB=i$(TARGET)_t$(TNR)
91 .ENDIF # "$(SHL$(TNR)IMPLIB)" == ""
92 .IF "$(COM)" != "GCC"
93 USE_$(TNR)IMPLIB=-implib:$(LB)/$(SHL$(TNR)IMPLIB).lib
94 SHL$(TNR)IMPLIBN=$(LB)/$(SHL$(TNR)IMPLIB).lib
95 .ELSE
96 USE_$(TNR)IMPLIB=-Wl,--out-implib=$(SHL$(TNR)IMPLIBN)
97 SHL$(TNR)IMPLIBN=$(LB)/lib$(SHL$(TNR)IMPLIB).dll.a
98 .ENDIF # "$(COM)" != "GCC"
99 ALLTAR : $(SHL$(TNR)IMPLIBN)
101 .IF "$(USE_DEFFILE)"==""
102 .IF "$(COM)" != "GCC"
103 USE_$(TNR)IMPLIB_DEPS=$(LB)/$(SHL$(TNR)IMPLIB).lib
104 .ENDIF
105 .ENDIF # "$(USE_DEFFILE)"==""
106 .ENDIF # "$(GUI)" == "WNT"
107 USE_SHL$(TNR)DEF=$(SHL$(TNR)DEF)
108 .ELSE # "$(GUI)" != "UNX"
109 USE_SHL$(TNR)DEF=
110 SHL$(TNR)DEPN+:=$(SHL$(TNR)DEPNU)
112 .IF "$(SHL$(TNR)VERSIONMAP)"==""
113 # to activate vmaps remove "#"
114 USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)TARGET).vmap
115 .ENDIF # "$(SHL$(TNR)VERSIONMAP)"==""
117 .IF "$(USE_SHL$(TNR)VERSIONMAP)"!=""
119 .IF "$(SHL$(TNR)FILTERFILE)"!=""
120 .IF "$(SHL$(TNR)VERSIONMAP)"!=""
121 #eine von beiden ist zuviel
122 USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)TARGET).vmap
123 $(USE_SHL$(TNR)VERSIONMAP) .PHONY:
124 @echo -----------------------------
125 @echo you should only use versionmap OR exportfile
126 @echo -----------------------------
127 # force_dmake_to_error
129 .ENDIF # "$(SHL$(TNR)VERSIONMAP)"!=""
131 .IF "$(OS)" != "AIX" && "$(OS)" != "ANDROID"
132 SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP)
133 .ENDIF
135 $(USE_SHL$(TNR)VERSIONMAP): \
136 $(SHL$(TNR)OBJS)\
137 $(SHL$(TNR)LIBS)\
138 $(SHL$(TNR)FILTERFILE)
139 @$(RM) $@.dump
140 .IF "$(SHL$(TNR)OBJS)"!=""
141 # dump remaining objects on the fly
142 .IF "$(OS)"=="MACOSX"
143 @-nm $(SHL$(TNR)OBJS:s/.obj/.o/) > $@.dump
144 .ELSE
145 @nm $(SHL$(TNR)OBJS:s/.obj/.o/) > $@.dump
146 .ENDIF
147 .ENDIF # "$(SHL$(TNR)OBJS)!"=""
148 @$(TYPE) /dev/null $(SHL$(TNR)LIBS:s/.lib/.dump/) >> $@.dump
149 $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL$(TNR)INTERFACE) -f $(SHL$(TNR)FILTERFILE) -m $@
151 .ELSE # "$(SHL$(TNR)FILTERFILE)"!=""
152 USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)TARGET).vmap
153 $(USE_SHL$(TNR)VERSIONMAP) :
154 .IF "$(VERBOSE)" == "TRUE"
155 @echo -----------------------------
156 @echo SHL$(TNR)FILTERFILE not set!
157 @echo -----------------------------
158 @$(TOUCH) $@
159 @echo dummy file to keep the dependencies for later use.
160 .ELSE
161 @$(TOUCH) $@
162 .ENDIF
163 # force_dmake_to_error
164 .ENDIF # "$(SHL$(TNR)FILTERFILE)"!=""
165 .ELSE # "$(USE_SHL$(TNR)VERSIONMAP)"!=""
167 #and now for the plain non-generic way...
168 .IF "$(SHL$(TNR)VERSIONMAP)"!=""
169 USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)VERSIONMAP:b)_$(SHL$(TNR)TARGET)$(SHL$(TNR)VERSIONMAP:e)
170 .IF "$(OS)" != "AIX" && "$(OS)" != "ANDROID"
171 SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP)
172 .ENDIF
174 .IF "$(OS)"=="MACOSX"
175 $(USE_SHL$(TNR)VERSIONMAP): $(SHL$(TNR)OBJS) $(SHL$(TNR)LIBS)
176 .ENDIF
178 # .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
179 # even if the $(AWK) part fails:
180 $(USE_SHL$(TNR)VERSIONMAP) .ERRREMOVE: $(SHL$(TNR)VERSIONMAP)
181 @@-$(RM) -f $@
182 # The following files will only be generated and needed on Mac OS X as temporary files
183 # in order to generate exported symbols list out of Linux/Solaris map files
184 .IF "$(OS)"=="MACOSX"
185 @-$(RM) -f $@.symregexp >& $(NULLDEV)
186 @-$(RM) -f $@.expsymlist >& $(NULLDEV)
187 .ENDIF
188 # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
189 # happens if somebody will change it in the future
190 .IF "$(COMID)"=="gcc3"
191 $(COMMAND_ECHO) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
192 .ELIF "$(COMNAME)"=="sunpro5"
193 $(COMMAND_ECHO) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
194 .ELSE # "$(COMID)"=="gcc3"
195 $(COMMAND_ECHO) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) > $@
196 .ENDIF # "$(COMID)"=="gcc3"
197 @chmod a+w $@
198 # Mac OS X post-processing generate an exported symbols list from the generated map file
199 # for details on exported symbols list see man ld on Mac OS X
200 .IF "$(OS)"=="MACOSX"
201 @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
202 @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
203 # Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
204 # Extract RTTI symbols from all the objects that will be used to build a shared library
205 .IF "$(SHL$(TNR)OBJS)"!=""
206 -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
207 .ENDIF
208 .IF "$(SHL$(TNR)LIBS)"!=""
209 $(COMMAND_ECHO)-$(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
210 .ENDIF
211 # overwrite the map file generate into the local output tree with the generated
212 # exported symbols list
213 cp $@.exported-symbols $@
214 .ENDIF # .IF "$(OS)"=="MACOSX"
215 .ENDIF # "$(SHL$(TNR)VERSIONMAP)"!=""
216 .ENDIF # "$(USE_SHL$(TNR)VERSIONMAP)"!=""
217 .ENDIF # "$(GUI)" != "UNX"
219 .IF "$(UNIXVERSIONNAMES)"!=""
220 .IF "$(OS)"!="MACOSX" && "$(OS)"!="IOS" && "$(OS)"!="ANDROID" && "$(OS)"!="AIX"
221 .IF "$(GUI)"=="UNX"
222 SHL$(TNR)SONAME=\"$(SONAME_SWITCH)$(SHL$(TNR)TARGETN:f)\"
223 .ENDIF # "$(GUI)"!="UNX"
224 .ENDIF # "$(OS)"!="MACOSX"
225 .ENDIF # "$(UNIXVERSIONNAMES)"!=""
227 .IF "$(SHL$(TNR)RES)"!=""
228 SHL$(TNR)ALLRES+=$(SHL$(TNR)RES)
229 SHL$(TNR)LINKRES*=$(MISC)/$(SHL$(TNR)TARGET).res
230 SHL$(TNR)LINKRESO*=$(MISC)/$(SHL$(TNR)TARGET)_res.o
231 .ENDIF # "$(SHL$(TNR)RES)"!=""
233 .IF "$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
234 SHL$(TNR)DEFAULTRES*=$(MISC)/$(SHL$(TNR)TARGET)_def.res
235 SHL$(TNR)ALLRES+=$(SHL$(TNR)DEFAULTRES)
236 SHL$(TNR)LINKRES*=$(MISC)/$(SHL$(TNR)TARGET).res
237 SHL$(TNR)LINKRESO*=$(MISC)/$(SHL$(TNR)TARGET)_res.o
238 .ENDIF # "$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
240 #.IF "$(SHL$(TNR)TARGETN)"!=""
242 .IF "$(linkinc)"!=""
243 .IF "$(GUI)"=="WNT"
244 .IF "$(SHL$(TNR)LIBS)"!=""
245 $(MISC)/$(SHL$(TNR)TARGET)_linkinc.ls .PHONY:
246 @@-$(RM) $@
247 $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL$(TNR)LIBS) $(i:s/.lib/.lin/)) >> $@
248 .ENDIF # "$(SHL$(TNR)LIBS)"!=""
249 .ENDIF
251 LINKINCTARGETS+=$(MISC)/$(SHL$(TNR)TARGETN:b)_linkinc.ls
252 $(SHL$(TNR)TARGETN) : $(LINKINCTARGETS)
254 .ELSE
256 $(MISC)/%linkinc.ls:
257 @echo . > $@
258 .ENDIF # "$(linkinc)"!=""
260 .IF "$(COM)" == "GCC" && "$(SHL$(TNR)IMPLIBN)" != ""
261 $(SHL$(TNR)IMPLIBN) : $(SHL$(TNR)TARGETN)
262 .ENDIF
264 $(SHL$(TNR)TARGETN) : \
265 $(SHL$(TNR)OBJS)\
266 $(SHL$(TNR)LIBS)\
267 $(USE_$(TNR)IMPLIB_DEPS)\
268 $(USE_SHL$(TNR)DEF)\
269 $(USE_SHL$(TNR)VERSIONMAP)\
270 $(SHL$(TNR)RES)\
271 $(SHL$(TNR)DEPN)
272 @echo "Making: " $(@:f)
273 .IF "$(GUI)" == "WNT"
274 .IF "$(SHL$(TNR)DEFAULTRES)"!=""
275 @@-$(RM) $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
276 .IF "$(SHL$(TNR)ICON)" != ""
277 @echo 1 ICON $(SHL$(TNR)ICON) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
278 .ENDIF
279 .IF "$(use_shl_versions)" != ""
280 .IF "$(SHL$(TNR)ADD_VERINFO)"!=""
281 @echo $(EMQ)#include $(EMQ)"$(SHL$(TNR)ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
282 .ELSE # "$(SHL$(TNR)ADD_VERINFO)"!=""
283 @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
284 @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
285 @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
286 .ENDIF # "$(SHL$(TNR)ADD_VERINFO)"!=""
287 @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
288 @echo $(EMQ)#define ORG_NAME $(SHL$(TNR)TARGET)$(DLLPOST) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
289 @echo $(EMQ)#define RES_APP_VENDOR $(OOO_VENDOR) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
290 @echo $(EMQ)#define INTERNAL_NAME $(SHL$(TNR)TARGET:b) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
291 @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
292 .ENDIF # "$(use_shl_versions)" != ""
293 .IF "$(RCFLAGSOUTRES)"!=""
294 # rc, takes separate flag naming output file, source .rc file last
295 $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(RCFLAGSOUTRES)$(SHL$(TNR)DEFAULTRES) $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
296 .ELSE
297 # windres, just takes output file last
298 $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc $(SHL$(TNR)DEFAULTRES)
299 .ENDIF
300 .ENDIF # "$(SHL$(TNR)DEFAULTRES)"!=""
301 .IF "$(SHL$(TNR)ALLRES)"!=""
302 $(COMMAND_ECHO)$(TYPE) $(SHL$(TNR)ALLRES) > $(SHL$(TNR)LINKRES)
303 .IF "$(COM)"=="GCC"
304 $(WINDRES) $(SHL$(TNR)LINKRES) $(SHL$(TNR)LINKRESO)
305 .ENDIF # "$(COM)"=="GCC"
306 .ENDIF # "$(SHL$(TNR)ALLRES)"!=""
307 .IF "$(COM)"=="GCC"
308 # GNU ld since 2.17 supports @cmdfile syntax
309 .IF "$(USE_DEFFILE)"!=""
310 $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \
311 $(SHL$(TNR)LINKFLAGS) \
312 $(LINKFLAGSSHL) \
313 $(SOLARLIB) \
314 $(MINGWSSTDOBJ) \
315 -o $@ \
316 -Wl,-Map,$(MISC)/$(@:b).map \
317 $(SHL$(TNR)DEF) \
318 $(USE_$(TNR)IMPLIB) \
319 $(STDOBJ) \
320 $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)OBJS) \
321 $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL$(TNR)LIBS))) \
322 -Wl,--exclude-libs,ALL,--start-group $(SHL$(TNR)STDLIBS) -Wl,--end-group \
323 $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
324 $(SHL$(TNR)LINKRESO) \
326 .ELSE
327 @noop $(assign ALL$(TNR)OBJLIST:=$(STDOBJ) $(SHL$(TNR)OBJS) $(SHL$(TNR)LINKRESO) $(shell $(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
328 .IF "$(DEFLIB$(TNR)NAME)"!="" # do not have to include objs
329 @noop $(assign DEF$(TNR)OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
330 @noop $(foreach,i,$(DEF$(TNR)OBJLIST) $(assign ALL$(TNR)OBJLIST:=$(ALL$(TNR)OBJLIST:s?$i??)))
331 .ENDIF # "$(DEFLIB$(TNR)NAME)"!=""
332 $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \
333 $(SHL$(TNR)LINKFLAGS) \
334 $(LINKFLAGSSHL) \
335 $(SOLARLIB) \
336 $(MINGWSSTDOBJ) \
337 -o $@ \
338 -Wl,-Map,$(MISC)/$(@:b).map \
339 $(SHL$(TNR)DEF) \
340 $(USE_$(TNR)IMPLIB) \
341 $(STDOBJ) \
342 $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)OBJS) \
343 $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL$(TNR)LIBS))) \
344 -Wl,--exclude-libs,ALL,--start-group $(SHL$(TNR)STDLIBS) -Wl,--end-group \
345 $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
346 $(SHL$(TNR)LINKRESO) \
348 .ENDIF
349 .ELSE
350 .IF "$(linkinc)"==""
351 .IF "$(SHL$(TNR)USE_EXPORTS)"!="name"
352 .IF "$(USE_DEFFILE)"!=""
353 $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(mktmp \
354 $(SHL$(TNR)LINKFLAGS) \
355 $(LINKFLAGSSHL) \
356 $(SHL$(TNR)STACK) $(SHL$(TNR)BASEX) \
357 -out:$@ \
358 -map:$(MISC)/$(@:b).map \
359 -def:$(SHL$(TNR)DEF) \
360 $(USE_$(TNR)IMPLIB) \
361 $(STDOBJ) \
362 $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)OBJS) \
363 $(SHL$(TNR)LIBS) \
364 $(SHL$(TNR)STDLIBS) \
365 $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
366 $(SHL$(TNR)LINKRES) \
368 # double check if target was really written... still making sense?
369 @@$(LS) $@
370 @echo linking $@.manifest ...
371 .IF "$(VISTA_MANIFEST)"!=""
372 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
373 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
374 .ELSE
375 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
376 .ENDIF # "$(VISTA_MANIFEST)"!=""
377 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
378 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
379 .ELSE # "$(USE_DEFFILE)"!=""
380 $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(mktmp $(SHL$(TNR)LINKFLAGS) \
381 $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
382 $(SHL$(TNR)STACK) -out:$(SHL$(TNR)TARGETN) \
383 -map:$(MISC)/$(@:B).map \
384 $(LB)/$(SHL$(TNR)IMPLIB).exp \
385 $(STDOBJ) \
386 $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ) \
387 $(SHL$(TNR)LIBS) \
388 $(SHL$(TNR)STDLIBS) \
389 $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
390 $(SHL$(TNR)LINKRES) \
392 # double check if target was really written... still making sense?
393 @@$(LS) $@
394 @echo linking $@.manifest ...
395 .IF "$(VISTA_MANIFEST)"!=""
396 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
397 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
398 .ELSE
399 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
400 .ENDIF # "$(VISTA_MANIFEST)"!=""
401 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
402 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
403 .ENDIF # "$(USE_DEFFILE)"!=""
404 .ELSE # "$(SHL$(TNR)USE_EXPORTS)"!="name"
405 $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(mktmp $(SHL$(TNR)LINKFLAGS) \
406 $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
407 $(SHL$(TNR)STACK) -out:$(SHL$(TNR)TARGETN) \
408 -map:$(MISC)/$(@:B).map \
409 $(USE_$(TNR)IMPLIB) \
410 $(STDOBJ) \
411 $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ)) \
412 $(SHL$(TNR)LIBS) \
413 @$(mktmp $(SHL$(TNR)STDLIBS) \
414 $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
415 $(SHL$(TNR)LINKRES) \
417 @echo linking $@.manifest ...
418 .IF "$(VISTA_MANIFEST)"!=""
419 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
420 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
421 .ELSE
422 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
423 .ENDIF # "$(VISTA_MANIFEST)"!=""
424 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
425 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
426 .ENDIF # "$(SHL$(TNR)USE_EXPORTS)"!="name"
427 .ELSE # "$(linkinc)"==""
428 $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL$(TNR)TARGET).lnk
429 $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL$(TNR)TARGET).lst
430 $(COMMAND_ECHO)$(TYPE) $(mktmp \
431 $(SHL$(TNR)LINKFLAGS) \
432 $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
433 $(SHL$(TNR)STACK) $(MAPFILE) \
434 -out:$@ \
435 $(LB)/$(SHL$(TNR)IMPLIB).exp \
436 $(STDOBJ) \
437 $(SHL$(TNR)OBJS) \
438 $(SHL$(TNR)STDLIBS) \
439 $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
440 $(SHL$(TNR)LINKRES) \
441 ) >> $(MISC)/$(SHL$(TNR)TARGET).lnk
442 $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL$(TNR)TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL$(TNR)TARGET).lnk
443 $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(MISC)/$(SHL$(TNR)TARGET).lnk
444 @echo linking $@.manifest ...
445 .IF "$(VISTA_MANIFEST)"!=""
446 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
447 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
448 .ELSE
449 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
450 .ENDIF # "$(VISTA_MANIFEST)"!=""
451 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
452 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
453 .ENDIF # "$(linkinc)"==""
454 .ENDIF # "$(COM)"=="GCC"
455 .ENDIF # "$(GUI)" == "WNT"
456 .IF "$(GUI)"=="UNX"
457 .IF "$(OS)"=="MACOSX"
458 @-$(RM) $(MISC)/$(@:b).list
459 @-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
460 @echo $(STDSLO) $(SHL$(TNR)OBJS:s/.obj/.o/) \
461 $(SHL$(TNR)VERSIONOBJ) \
462 `cat /dev/null $(SHL$(TNR)LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
463 @/bin/echo -n $(SHL$(TNR)LINKER) $(SHL$(TNR)LINKFLAGS) $(SHL$(TNR)VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
464 $(SHL$(TNR)STDLIBS) $(SHL$(TNR)ARCHIVES) $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
465 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
466 `cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd` \
467 >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
468 .IF "$(VERBOSE)" == "TRUE"
469 @cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
470 .ENDIF
471 @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
472 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
473 shl $(SHL$(TNR)RPATH) $@
474 .IF "$(SHL$(TNR)CREATEJNILIB)"!=""
475 @echo "Making: " $(@:f).jnilib
476 @macosx-create-bundle $@
477 .ENDIF # "$(SHL$(TNR)CREATEJNILIB)"!=""
478 .IF "$(SHL$(TNR)NOCHECK)"==""
479 $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN)
480 .ENDIF # "$(SHL$(TNR)NOCHECK)"!=""
481 .ELIF "$(DISABLE_DYNLOADING)"=="TRUE"
482 $(COMMAND_ECHO)$(AR) $(LIB$(TNR)FLAGS) $(LIBFLAGS) $@ $(subst,.obj,.o $(SHL$(TNR)OBJS)) $(shell cat /dev/null $(LIB$(TNR)TARGET) $(SHL$(TNR)LIBS) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g)
483 $(COMMAND_ECHO)$(RANLIB) $@
484 .ELSE # "$(OS)"=="MACOSX"
485 @-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
486 @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/) \
487 $(SHL$(TNR)VERSIONOBJ) -o $@ \
488 `cat /dev/null $(SHL$(TNR)LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
489 $(SHL$(TNR)STDLIBS) $(SHL$(TNR)ARCHIVES) $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
490 .IF "$(VERBOSE)" == "TRUE"
491 @cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
492 .ENDIF
493 @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
494 .IF "$(SHL$(TNR)NOCHECK)"==""
495 $(COMMAND_ECHO)-$(RM) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
496 $(COMMAND_ECHO)$(RENAME) $(SHL$(TNR)TARGETN) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
497 .IF "$(VERBOSE)"=="TRUE"
498 $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
499 .ELSE
500 $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) -- -s $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
501 .ENDIF
502 .ENDIF # "$(SHL$(TNR)NOCHECK)"!=""
503 .ENDIF # "$(OS)"=="MACOSX"
504 .IF "$(UNIXVERSIONNAMES)"!="" && "$(OS)"!="IOS" && "$(OS)"!="ANDROID"
505 $(COMMAND_ECHO)$(RM) $(LB)/$(SHL$(TNR)TARGETN:b)
506 $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL$(TNR)TARGETN:f) $(SHL$(TNR)TARGETN:b)
507 .ENDIF # "$(UNIXVERSIONNAMES)"!=""
508 .IF "$(VERBOSE)" == "TRUE"
509 @ls -l $@
510 .ENDIF
511 .ENDIF # "$(GUI)" == "UNX"
513 .ENDIF # "$(SHL$(TNR)TARGETN)"!=""
515 # unroll end
516 #######################################################
518 #-------------------------------------------------------------------------
520 #######################################################
521 # Anweisungen fuer das Linken
522 # unroll begin
524 .IF "$(SHL$(TNR)IMPLIBN)" != ""
526 USELIB$(TNR)DEPN+=$(SHL$(TNR)LIBS)
528 .IF "$(USE_DEFFILE)"!=""
529 USE_SHL$(TNR)TARGET=$(SHL$(TNR)TARGETN)
530 .ENDIF
532 .IF "$(GUI)$(COM)" != "WNTGCC"
533 .IF "$(GUI)" != "UNX"
534 $(SHL$(TNR)IMPLIBN): \
535 $(SHL$(TNR)DEF) \
536 $(USE_SHL$(TNR)TARGET) \
537 $(USELIB$(TNR)DEPN) \
538 $(USELIBDEPN)
539 .ELSE
540 $(SHL$(TNR)IMPLIBN): \
541 $(SHL$(TNR)LIBS)
542 .ENDIF
543 @echo "Making: " $(@:f)
544 .IF "$(GUI)" == "WNT"
545 # bei use_deffile implib von linker erstellt
546 .IF "$(USE_DEFFILE)"==""
547 $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL$(TNR)IMPLIBN) \
548 -def:$(SHL$(TNR)DEF) )
549 .ELSE # "$(USE_DEFFILE)==""
550 @echo build of $(SHL$(TNR)TARGETN) creates $@
551 @$(TOUCH) $@
552 .ENDIF # "$(USE_DEFFILE)==""
554 .ELSE
555 @echo no ImportLibs on Mac and *ix
556 @-$(RM) $@
557 @$(TOUCH) $@
558 .ENDIF
559 .ENDIF
560 .ENDIF
562 # unroll end
563 #######################################################