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
"$(L10N_framework)"==""
81 .IF
"$(VERSIONOBJ)"!=""
82 SHL
$(TNR
)VERSIONOBJ
:=$(VERSIONOBJ
:d
){$(subst,$(DLLPOSTFIX
),_dflt
$(SHL
$(TNR
)TARGET
))}$(VERSIONOBJ
:f
)
83 USE_VERSIONH
:=$(INCCOM
)/$(SHL
$(TNR
)VERSIONOBJ
:b
).h
85 SHL
$(TNR
)VERSIONOBJDEP
:=$(VERSIONOBJ
:d
){$(subst,$(DLLPOSTFIX
),_dflt
$(SHL
$(TNR
)TARGET
))}$(VERSIONOBJ
:f
:s
/.o
/.obj
/)
86 .ELSE
# "$(GUI)" == "UNX"
87 SHL
$(TNR
)VERSIONOBJDEP
:=$(VERSIONOBJ
:d
){$(subst,$(DLLPOSTFIX
),_dflt
$(SHL
$(TNR
)TARGET
))}$(VERSIONOBJ
:f
)
88 .ENDIF
# "$(GUI)" == "UNX"
89 $(MISC
)/$(SHL
$(TNR
)VERSIONOBJ
:b
).c
: $(SOLARENV
)/src
/version.c
$(INCCOM
)/$(SHL
$(TNR
)VERSIONOBJ
:b
).h
90 # $(COPY) $(SOLARENV)/src/version.c $@
91 $(COMMAND_ECHO
)$(TYPE
) $(SOLARENV
)/src
/version.c |
$(SED
) s
/_version.h
/$(SHL
$(TNR
)VERSIONOBJ
:b
).h
/ > $@
93 .INIT
: $(SHL
$(TNR
)VERSIONOBJDEP
)
94 .ENDIF
# "$(VERSIONOBJ)"!=""
98 .IF
"$(GUI)" == "WNT" ||
"$(GUI)" == "OS2"
99 .IF
"$(SHL$(TNR)IMPLIB)" == ""
100 SHL
$(TNR
)IMPLIB
=i
$(TARGET
)_t
$(TNR
)
101 .ENDIF
# "$(SHL$(TNR)IMPLIB)" == ""
102 .IF
"$(COM)" != "GCC"
103 USE_
$(TNR
)IMPLIB
=-implib
:$(LB
)/$(SHL
$(TNR
)IMPLIB
).lib
104 .ENDIF
# "$(COM)" != "GCC"
105 SHL
$(TNR
)IMPLIBN
=$(LB
)/$(SHL
$(TNR
)IMPLIB
).lib
106 ALLTAR
: $(SHL
$(TNR
)IMPLIBN
)
108 .IF
"$(USE_DEFFILE)"==""
109 USE_
$(TNR
)IMPLIB_DEPS
=$(LB
)/$(SHL
$(TNR
)IMPLIB
).lib
110 .ENDIF
# "$(USE_DEFFILE)"==""
111 .ENDIF
# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
112 USE_SHL
$(TNR
)DEF
=$(SHL
$(TNR
)DEF
)
113 .ELSE
# "$(GUI)" != "UNX"
115 SHL
$(TNR
)DEPN
+:=$(SHL
$(TNR
)DEPNU
)
117 .IF
"$(SHL$(TNR)VERSIONMAP)"==""
118 # to activate vmaps remove "#"
119 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)TARGET
).vmap
120 .ENDIF
# "$(SHL$(TNR)VERSIONMAP)"==""
122 .IF
"$(USE_SHL$(TNR)VERSIONMAP)"!=""
124 .IF
"$(SHL$(TNR)FILTERFILE)"!=""
125 .IF
"$(SHL$(TNR)VERSIONMAP)"!=""
126 #eine von beiden ist zuviel
127 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)TARGET
).vmap
128 $(USE_SHL
$(TNR
)VERSIONMAP
) .PHONY
:
129 @echo
-----------------------------
130 @echo you should only use versionmap OR exportfile
131 @echo
-----------------------------
132 # force_dmake_to_error
134 .ENDIF
# "$(SHL$(TNR)VERSIONMAP)"!=""
137 SHL
$(TNR
)VERSIONMAPPARA
=$(LINKVERSIONMAPFLAG
) $(USE_SHL
$(TNR
)VERSIONMAP
)
140 $(USE_SHL
$(TNR
)VERSIONMAP
): \
143 $(SHL
$(TNR
)FILTERFILE
)
145 .IF
"$(SHL$(TNR)OBJS)"!=""
146 # dump remaining objects on the fly
147 .IF
"$(OS)"=="MACOSX"
148 @
-nm
$(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) > $@.dump
150 @nm
$(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) > $@.dump
152 .ENDIF
# "$(SHL$(TNR)OBJS)!"=""
153 @
$(TYPE
) /dev
/null
$(SHL
$(TNR
)LIBS
:s
/.lib
/.dump
/) >> $@.dump
154 $(COMMAND_ECHO
) $(PERL
) $(SOLARENV
)/bin
/mapgen.pl
-d
$@.dump
-s
$(SHL
$(TNR
)INTERFACE
) -f
$(SHL
$(TNR
)FILTERFILE
) -m
$@
156 .ELSE
# "$(SHL$(TNR)FILTERFILE)"!=""
157 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)TARGET
).vmap
158 $(USE_SHL
$(TNR
)VERSIONMAP
) :
159 .IF
"$(VERBOSE)" == "TRUE"
160 @echo
-----------------------------
161 @echo SHL
$(TNR
)FILTERFILE not set
!
162 @echo
-----------------------------
164 @echo dummy file to keep the dependencies for later use.
168 # force_dmake_to_error
169 .ENDIF
# "$(SHL$(TNR)FILTERFILE)"!=""
170 .ELSE
# "$(USE_SHL$(TNR)VERSIONMAP)"!=""
172 #and now for the plain non-generic way...
173 .IF
"$(SHL$(TNR)VERSIONMAP)"!=""
174 USE_SHL
$(TNR
)VERSIONMAP
=$(MISC
)/$(SHL
$(TNR
)VERSIONMAP
:b
)_
$(SHL
$(TNR
)TARGET
)$(SHL
$(TNR
)VERSIONMAP
:e
)
176 SHL
$(TNR
)VERSIONMAPPARA
=$(LINKVERSIONMAPFLAG
) $(USE_SHL
$(TNR
)VERSIONMAP
)
179 .IF
"$(OS)"=="MACOSX"
180 $(USE_SHL
$(TNR
)VERSIONMAP
): $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)LIBS
)
183 $(USE_SHL
$(TNR
)VERSIONMAP
): $(SHL
$(TNR
)VERSIONMAP
)
185 # The following files will only be generated and needed on Mac OS X as temporary files
186 # in order to generate exported symbols list out of Linux/Solaris map files
187 .IF
"$(OS)"=="MACOSX"
188 @
-$(RM
) -f
$@.symregexp
>& $(NULLDEV
)
189 @
-$(RM
) -f
$@.expsymlist
>& $(NULLDEV
)
191 # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
192 # happens if somebody will change it in the future
193 .IF
"$(COMID)"=="gcc3"
194 $(COMMAND_ECHO
) tr
-d
"\015" < $(SHL
$(TNR
)VERSIONMAP
) |
$(AWK
) -f
$(SOLARENV
)/bin
/addsym.awk
> $@
195 .ELIF
"$(COMNAME)"=="sunpro5"
196 $(COMMAND_ECHO
) tr
-d
"\015" < $(SHL
$(TNR
)VERSIONMAP
) |
$(GREP
) -v
$(IGNORE_SYMBOLS
) > $@
197 .ELSE
# "$(COMID)"=="gcc3"
198 $(COMMAND_ECHO
) tr
-d
"\015" < $(SHL
$(TNR
)VERSIONMAP
) > $@
199 .ENDIF
# "$(COMID)"=="gcc3"
201 # Mac OS X post-processing generate an exported symbols list from the generated map file
202 # for details on exported symbols list see man ld on Mac OS X
203 .IF
"$(OS)"=="MACOSX"
204 @
-cat
$@ |
$(AWK
) -f
$(SOLARENV
)/bin
/unxmap-to-macosx-explist.awk | grep
-v
"\*\|?" > $@.exported-symbols
205 @
-cat
$@ |
$(AWK
) -f
$(SOLARENV
)/bin
/unxmap-to-macosx-explist.awk | grep
"\*\|?" > $@.symbols-regexp
206 # Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
207 # Extract RTTI symbols from all the objects that will be used to build a shared library
208 .IF
"$(SHL$(TNR)OBJS)"!=""
209 -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
211 .IF
"$(SHL$(TNR)LIBS)"!=""
212 $(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
214 # overwrite the map file generate into the local output tree with the generated
215 # exported symbols list
216 cp
$@.exported-symbols
$@
217 .ENDIF
# .IF "$(OS)"=="MACOSX"
218 .ENDIF
# "$(SHL$(TNR)VERSIONMAP)"!=""
219 .ENDIF
# "$(USE_SHL$(TNR)VERSIONMAP)"!=""
220 .ENDIF
# "$(GUI)" != "UNX"
222 .IF
"$(UNIXVERSIONNAMES)"!=""
223 .IF
"$(OS)"!="MACOSX"
226 SHL
$(TNR
)SONAME
=$(SONAME_SWITCH
)$(SHL
$(TNR
)TARGETN
:f
)
228 SHL
$(TNR
)SONAME
=\"$(SONAME_SWITCH
)$(SHL
$(TNR
)TARGETN
:f
)\"
230 .ENDIF
# "$(GUI)"!="UNX"
231 .ENDIF
# "$(OS)"!="MACOSX"
232 .ENDIF
# "$(UNIXVERSIONNAMES)"!=""
234 .IF
"$(SHL$(TNR)RES)"!=""
235 SHL
$(TNR
)ALLRES
+=$(SHL
$(TNR
)RES
)
236 SHL
$(TNR
)LINKRES
*=$(MISC
)/$(SHL
$(TNR
)TARGET
).res
237 SHL
$(TNR
)LINKRESO
*=$(MISC
)/$(SHL
$(TNR
)TARGET
)_res.o
238 .ENDIF
# "$(SHL$(TNR)RES)"!=""
240 .IF
"$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
241 SHL
$(TNR
)DEFAULTRES
*=$(MISC
)/$(SHL
$(TNR
)TARGET
)_def.res
242 SHL
$(TNR
)ALLRES
+=$(SHL
$(TNR
)DEFAULTRES
)
243 SHL
$(TNR
)LINKRES
*=$(MISC
)/$(SHL
$(TNR
)TARGET
).res
244 SHL
$(TNR
)LINKRESO
*=$(MISC
)/$(SHL
$(TNR
)TARGET
)_res.o
245 .ENDIF
# "$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
247 #.IF "$(SHL$(TNR)TARGETN)"!=""
250 .IF
"$(GUI)"=="WNT" ||
"$(GUI)" == "OS2"
251 .IF
"$(SHL$(TNR)LIBS)"!=""
252 $(MISC
)/$(SHL
$(TNR
)TARGET
)_linkinc.ls .PHONY
:
254 $(COMMAND_ECHO
)$(SED
) -f
$(SOLARENV
)/bin
/chrel.sed
$(foreach,i
,$(SHL
$(TNR
)LIBS
) $(i
:s
/.lib
/.lin
/)) >> $@
255 .ENDIF
# "$(SHL$(TNR)LIBS)"!=""
258 LINKINCTARGETS
+=$(MISC
)/$(SHL
$(TNR
)TARGETN
:b
)_linkinc.ls
259 $(SHL
$(TNR
)TARGETN
) : $(LINKINCTARGETS
)
262 .IF
"$(SHL$(TNR)USE_EXPORTS)"=="name"
263 .IF
"$(GUI)"=="WNT" ||
"$(GUI)" == "OS2"
265 .IF
"$(SHL$(TNR)LIBS)"!=""
266 SHL
$(TNR
)LINKLIST
=$(MISC
)/$(SHL
$(TNR
)TARGET
)_link.lst
267 SHL
$(TNR
)LINKLISTPARAM
=@
$(SHL
$(TNR
)LINKLIST
)
268 $(SHL
$(TNR
)LINKLIST
) : $(SHL
$(TNR
)LIBS
)
270 $(COMMAND_ECHO
)$(SED
) -f
$(SOLARENV
)/bin
/chrel.sed
$(foreach,i
,$(SHL
$(TNR
)LIBS
) $(i
:s
/.lib
/.lin
/)) >> $@
271 .ENDIF
# "$(SHL$(TNR)LIBS)"!=""
272 .ENDIF
# "$(COM)"!="GCC"
274 .ENDIF
# "$(SHL$(TNR)USE_EXPORTS)"=="name"
278 .ENDIF
# "$(linkinc)"!=""
280 .IF
"$(GUI)" == "OS2"
281 #21/02/2006 YD dll names must be 8.3, invoke fix script
282 #check osl/os2/module.c/osl_loadModule()
283 SHL
$(TNR
)TARGET8
=$(shell @fix_shl
$(SHL
$(TNR
)TARGET
))
286 .IF
"$(GUI)" == "OS2"
287 _SHL
$(TNR
)IMP_ORD
= $(SHL
$(TNR
)STDLIBS
:^
"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL
$(TNR
)STDLIBS
:^
"$(LB)/")
288 SHL
$(TNR
)IMP_ORD
= $(foreach,i
,$(_SHL
$(TNR
)IMP_ORD
) $(shell @
-ls
$i))
294 $(SHL
$(TNR
)TARGETN
) : \
297 $(USE_
$(TNR
)IMPLIB_DEPS
)\
299 $(USE_SHL
$(TNR
)VERSIONMAP
)\
302 $(SHL
$(TNR
)IMP_ORD
) \
304 .IF
"$(VERBOSE)" == "TRUE"
305 @echo
------------------------------
307 @echo
"Making: " $(@
:f
)
308 .IF
"$(GUI)" == "WNT"
309 .IF
"$(SHL$(TNR)DEFAULTRES)"!=""
310 @@
-$(RM
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
311 .IF
"$(SHL$(TNR)ICON)" != ""
312 @echo
1 ICON
$(SHL
$(TNR
)ICON
) >> $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
314 .IF
"$(use_shl_versions)" != ""
315 .IF
"$(SHL$(TNR)ADD_VERINFO)"!=""
316 @echo
$(EMQ
)#include $(EMQ)"$(SHL$(TNR)ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
317 .ELSE
# "$(SHL$(TNR)ADD_VERINFO)"!=""
318 @echo
$(EMQ
)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
319 @echo
$(EMQ
)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
320 @echo
$(EMQ
)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
321 .ENDIF
# "$(SHL$(TNR)ADD_VERINFO)"!=""
322 @echo
$(EMQ
)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
323 @echo
$(EMQ
)#define ORG_NAME $(SHL$(TNR)TARGET)$(DLLPOST) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
324 @echo
$(EMQ
)#define INTERNAL_NAME $(SHL$(TNR)TARGET:b) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
325 @echo
$(EMQ
)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
326 .ENDIF
# "$(use_shl_versions)" != ""
327 $(COMMAND_ECHO
)$(RC
) -DWIN32
$(INCLUDE
) $(RCLINKFLAGS
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
328 .ENDIF
# "$(SHL$(TNR)DEFAULTRES)"!=""
329 .IF
"$(SHL$(TNR)ALLRES)"!=""
330 $(COMMAND_ECHO
)$(TYPE
) $(SHL
$(TNR
)ALLRES
) > $(SHL
$(TNR
)LINKRES
)
332 windres
$(SHL
$(TNR
)LINKRES
) $(SHL
$(TNR
)LINKRESO
)
333 .ENDIF
# "$(COM)"=="GCC"
334 .ENDIF
# "$(SHL$(TNR)ALLRES)"!=""
335 .IF
"$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
336 @echo dlltool
--input-def
$(SHL
$(TNR
)DEF
) \
337 --dllname
$(SHL
$(TNR
)TARGET
)$(DLLPOST
) \
338 --kill-at
\\ > $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
339 @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
))
340 .IF
"$(DEFLIB$(TNR)NAME)"!="" # do not have to include objs
341 @noop
$(assign DEF
$(TNR
)OBJLIST
:=$(shell $(TYPE
) $(foreach,i
,$(DEFLIB
$(TNR
)NAME
) $(SLB
)/$(i
).lib
) | sed s?
$(ROUT
)?
$(PRJ
)/$(ROUT
)?g
))
342 @noop
$(foreach,i
,$(DEF
$(TNR
)OBJLIST
) $(assign ALL
$(TNR
)OBJLIST
:=$(ALL
$(TNR
)OBJLIST
:s?
$i??
)))
343 .ENDIF
# "$(DEFLIB$(TNR)NAME)"!=""
344 @echo
--output-exp
$(MISC
)/$(@
:b
)_exp.o \
345 $(ALL
$(TNR
)OBJLIST
) >> $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
346 @echo
$(LINK
) $(LINKFLAGS
) $(LINKFLAGSSHL
) $(MINGWSSTDOBJ
) -o
$@ \
347 $(STDOBJ
) $(SHL
$(TNR
)VERSIONOBJ
) $(SHL
$(TNR
)DESCRIPTIONOBJ
) $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)LINKRESO
) \
348 `$(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
349 -Wl
,--exclude-libs
,ALL
,--start-group
$(SHL
$(TNR
)STDLIBS
) -Wl
,--end-group \
350 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) $(MISC
)/$(@
:b
)_exp.o
$(MINGWSSTDENDOBJ
) \
351 -Wl
,-Map
,$(MISC
)/$(@
:b
).map
>> $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
352 @
$(TYPE
) $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
353 @
+source
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
356 .IF
"$(SHL$(TNR)USE_EXPORTS)"!="name"
357 .IF
"$(USE_DEFFILE)"!=""
358 $(SHL
$(TNR
)LINKER
) @
$(mktmp \
359 $(SHL
$(TNR
)LINKFLAGS
) \
361 $(SHL
$(TNR
)STACK
) $(SHL
$(TNR
)BASEX
) \
363 -map
:$(MISC
)/$(@
:b
).map \
364 -def
:$(SHL
$(TNR
)DEF
) \
365 $(USE_
$(TNR
)IMPLIB
) \
367 $(SHL
$(TNR
)VERSIONOBJ
) $(SHL
$(TNR
)OBJS
) \
369 $(SHL
$(TNR
)STDLIBS
) \
370 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
371 $(SHL
$(TNR
)LINKRES
) \
372 ) $(LINKOUTPUTFILTER
)
373 # double check if target was really written... still making sense?
375 @echo linking
$@.manifest ...
376 .IF
"$(VISTA_MANIFEST)"!=""
377 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
378 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
380 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
381 .ENDIF
# "$(VISTA_MANIFEST)"!=""
382 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
383 $(COMMAND_ECHO
)$(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
384 .ELSE
# "$(USE_DEFFILE)"!=""
385 $(COMMAND_ECHO
)$(SHL
$(TNR
)LINKER
) @
$(mktmp
$(SHL
$(TNR
)LINKFLAGS
) \
386 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
387 $(SHL
$(TNR
)STACK
) -out
:$(SHL
$(TNR
)TARGETN
) \
388 -map
:$(MISC
)/$(@
:B
).map \
389 $(LB
)/$(SHL
$(TNR
)IMPLIB
).exp \
391 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
) \
393 $(SHL
$(TNR
)STDLIBS
) \
394 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
395 $(SHL
$(TNR
)LINKRES
) \
396 ) $(LINKOUTPUTFILTER
)
397 # double check if target was really written... still making sense?
399 @echo linking
$@.manifest ...
400 .IF
"$(VISTA_MANIFEST)"!=""
401 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
402 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
404 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
405 .ENDIF
# "$(VISTA_MANIFEST)"!=""
406 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
407 $(COMMAND_ECHO
)$(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
408 .ENDIF
# "$(USE_DEFFILE)"!=""
409 .ELSE
# "$(SHL$(TNR)USE_EXPORTS)"!="name"
410 $(COMMAND_ECHO
)$(SHL
$(TNR
)LINKER
) @
$(mktmp
$(SHL
$(TNR
)LINKFLAGS
) \
411 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
412 $(SHL
$(TNR
)STACK
) -out
:$(SHL
$(TNR
)TARGETN
) \
413 -map
:$(MISC
)/$(@
:B
).map \
414 $(USE_
$(TNR
)IMPLIB
) \
416 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
)) \
417 $(SHL
$(TNR
)LINKLISTPARAM
) \
418 @
$(mktmp
$(SHL
$(TNR
)STDLIBS
) \
419 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
420 $(SHL
$(TNR
)LINKRES
) \
422 @echo linking
$@.manifest ...
423 .IF
"$(VISTA_MANIFEST)"!=""
424 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
425 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
427 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
428 .ENDIF
# "$(VISTA_MANIFEST)"!=""
429 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
430 $(COMMAND_ECHO
)$(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
431 .ENDIF
# "$(SHL$(TNR)USE_EXPORTS)"!="name"
432 .ELSE
# "$(linkinc)"==""
433 $(COMMAND_ECHO
)-$(RM
) del
$(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
434 $(COMMAND_ECHO
)-$(RM
) $(MISC
)/$(SHL
$(TNR
)TARGET
).lst
435 $(COMMAND_ECHO
)$(TYPE
) $(mktmp \
436 $(SHL
$(TNR
)LINKFLAGS
) \
437 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
438 $(SHL
$(TNR
)STACK
) $(MAPFILE
) \
440 $(LB
)/$(SHL
$(TNR
)IMPLIB
).exp \
443 $(SHL
$(TNR
)STDLIBS
) \
444 $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) \
445 $(SHL
$(TNR
)LINKRES
) \
446 ) >> $(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
447 $(COMMAND_ECHO
)$(TYPE
) $(MISC
)/$(SHL
$(TNR
)TARGETN
:b
)_linkinc.ls
>> $(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
448 $(COMMAND_ECHO
)$(SHL
$(TNR
)LINKER
) @
$(MISC
)/$(SHL
$(TNR
)TARGET
).lnk
449 @echo linking
$@.manifest ...
450 .IF
"$(VISTA_MANIFEST)"!=""
451 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-manifest
$(TRUSTED_MANIFEST_LOCATION
)/trustedinfo.manifest
-out
:$@.tmanifest
$(EMQ
) $(FI
)
452 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.tmanifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
454 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(MT
) $(MTFLAGS
) -manifest
$@.manifest
-outputresource
:$@
$(EMQ
);2 $(FI
)
455 .ENDIF
# "$(VISTA_MANIFEST)"!=""
456 $(COMMAND_ECHO
)$(IFEXIST
) $@.manifest
$(THEN
) $(RM
:s
/+//) $@.manifest
$(FI
)
457 $(COMMAND_ECHO
)$(IFEXIST
) $@.tmanifest
$(THEN
) $(RM
:s
/+//) $@.tmanifest
$(FI
)
458 .ENDIF
# "$(linkinc)"==""
459 .ENDIF
# "$(COM)"=="GCC"
460 .ENDIF
# "$(GUI)" == "WNT"
462 .IF
"$(OS)"=="MACOSX"
463 @
-$(RM
) $(MISC
)/$(@
:b
).list
464 @
-$(RM
) $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
465 @echo
$(STDSLO
) $(SHL
$(TNR
)OBJS
:s
/.obj
/.o
/) \
466 $(SHL
$(TNR
)VERSIONOBJ
) \
467 `cat /dev/null $(SHL$(TNR)LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr
-s
" " "\n" > $(MISC
)/$(@
:b
).list
468 @echo
-n
$(SHL
$(TNR
)LINKER
) $(SHL
$(TNR
)LINKFLAGS
) $(SHL
$(TNR
)VERSIONMAPPARA
) $(LINKFLAGSSHL
) -L
$(PRJ
)/$(ROUT
)/lib
$(SOLARLIB
) -o
$@ \
469 $(SHL
$(TNR
)STDLIBS
) $(SHL
$(TNR
)ARCHIVES
) $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) -filelist
$(MISC
)/$(@
:b
).list
$(LINKOUTPUT_FILTER
) > $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
470 @
$(PERL
) $(SOLARENV
)/bin
/macosx-dylib-link-list.pl \
471 `cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd` \
472 >> $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
473 .IF
"$(VERBOSE)" == "TRUE"
474 @cat
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
476 @
+source
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
477 @
$(PERL
) $(SOLARENV
)/bin
/macosx-change-install-names.pl \
478 shl
$(SHL
$(TNR
)RPATH
) $@
479 @echo
"Making: " $(@
:f
).jnilib
480 @macosx-create-bundle
$@
481 .IF
"$(UPDATER)"=="YES"
482 .IF
"$(SHL$(TNR)NOCHECK)"==""
483 $(SOLARENV
)/bin
/checkdll.sh
-L
$(LB
) -L
$(SOLARLIBDIR
) $(EXTRALIBPATHS
$(TNR
)) $(SHL
$(TNR
)TARGETN
)
484 .ENDIF
# "$(SHL$(TNR)NOCHECK)"!=""
486 .ELSE
# "$(OS)"=="MACOSX"
487 @
-$(RM
) $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
488 @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
/) \
489 $(SHL
$(TNR
)VERSIONOBJ
) -o
$@ \
490 `cat /dev/null $(SHL$(TNR)LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
491 $(SHL
$(TNR
)STDLIBS
) $(SHL
$(TNR
)ARCHIVES
) $(SHL
$(TNR
)STDSHL
) $(STDSHL
$(TNR
)) $(LINKOUTPUT_FILTER
) > $(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
492 .IF
"$(VERBOSE)" == "TRUE"
493 @cat
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
495 @
+source
$(MISC
)/$(TARGET
).
$(@
:b
)_
$(TNR
).cmd
496 .IF
"$(UPDATER)"=="YES"
497 .IF
"$(SHL$(TNR)NOCHECK)"==""
498 $(COMMAND_ECHO
)-$(RM
) $(SHL
$(TNR
)TARGETN
:d
)check_
$(SHL
$(TNR
)TARGETN
:f
)
499 $(COMMAND_ECHO
)$(RENAME
) $(SHL
$(TNR
)TARGETN
) $(SHL
$(TNR
)TARGETN
:d
)check_
$(SHL
$(TNR
)TARGETN
:f
)
500 .IF
"$(VERBOSE)"=="TRUE"
501 $(COMMAND_ECHO
)$(SOLARENV
)/bin
/checkdll.sh
-L
$(LB
) -L
$(SOLARLIBDIR
) $(EXTRALIBPATHS
$(TNR
)) $(SHL
$(TNR
)TARGETN
:d
)check_
$(SHL
$(TNR
)TARGETN
:f
)
503 $(COMMAND_ECHO
)$(SOLARENV
)/bin
/checkdll.sh
-L
$(LB
) -L
$(SOLARLIBDIR
) $(EXTRALIBPATHS
$(TNR
)) -- -s
$(SHL
$(TNR
)TARGETN
:d
)check_
$(SHL
$(TNR
)TARGETN
:f
)
505 .ENDIF
# "$(SHL$(TNR)NOCHECK)"!=""
506 .ENDIF
# "$(UPDATER)"=="YES"
507 .ENDIF
# "$(OS)"=="MACOSX"
508 .IF
"$(UNIXVERSIONNAMES)"!=""
509 $(COMMAND_ECHO
)$(RM
) $(LB
)/$(SHL
$(TNR
)TARGETN
:b
)
510 $(COMMAND_ECHO
)cd
$(LB
) && ln
-s
$(SHL
$(TNR
)TARGETN
:f
) $(SHL
$(TNR
)TARGETN
:b
)
511 .ENDIF
# "$(UNIXVERSIONNAMES)"!=""
512 .IF
"$(VERBOSE)" == "TRUE"
515 .ENDIF
# "$(GUI)" == "UNX"
517 .IF
"$(GUI)" == "OS2"
519 .IF
"$(SHL$(TNR)DEFAULTRES)"!=""
520 @
+-$(RM
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
>& $(NULLDEV
)
521 .IF
"$(SHL$(TNR)ICON)" != ""
522 @
-+echo
1 ICON
$(SHL
$(TNR
)ICON
) >> $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
524 .IF
"$(use_shl_versions)" != ""
525 .IF
"$(SHL$(TNR)ADD_VERINFO)"!=""
526 @
-+echo
$(EMQ
)#include $(EMQ)"$(SHL$(TNR)ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
527 .ENDIF
# "$(SHL$(TNR)ADD_VERINFO)"!=""
528 @
-+echo MENU
1 BEGIN END
>> $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
529 # @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
530 .ENDIF
# "$(use_shl_versions)" != ""
531 # YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
532 $(COMMAND_ECHO
)$(RC
) -r
-DOS2
$(INCLUDE
) $(RCLINKFLAGS
) $(MISC
)/$(SHL
$(TNR
)DEFAULTRES
:b
).rc
533 .ENDIF
# "$(SHL$(TNR)DEFAULTRES)"!=""
535 .IF
"$(SHL$(TNR)ALLRES)"!=""
536 $(COMMAND_ECHO
)+$(TYPE
) $(SHL
$(TNR
)ALLRES
) > $(SHL
$(TNR
)LINKRES
)
537 .ENDIF
# "$(SHL$(TNR)ALLRES)"!=""
539 .IF
"$(USE_DEFFILE)"!=""
541 $(COMMAND_ECHO
)$(SHL
$(TNR
)LINKER
) $(SHL
$(TNR
)LINKFLAGS
) $(LINKFLAGSSHL
) -o
$@ \
545 -L
$(SOLARVERSION
)/$(INPATH
)/lib \
546 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
) \
548 $(SHL
$(TNR
)STDLIBS
:^
"-l") \
549 $(SHL
$(TNR
)LINKRES
) \
550 $(SHL
$(TNR
)STDSHL
:^
"-l") $(STDSHL
$(TNR
):^
"-l")
552 .ELSE
# "$(USE_DEFFILE)"!=""
554 $(COMMAND_ECHO
)$(SHL
$(TNR
)LINKER
) -v
$(SHL
$(TNR
)LINKFLAGS
) \
555 $(LINKFLAGSSHL
) $(SHL
$(TNR
)BASEX
) \
556 $(SHL
$(TNR
)STACK
) -o
$(SHL
$(TNR
)TARGETN
) \
560 -L
$(SOLARVERSION
)/$(INPATH
)/lib \
561 $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)VERSIONOBJ
) \
563 $(SHL
$(TNR
)STDLIBS
:^
"-l") \
564 $(SHL
$(TNR
)LINKRES
) \
565 $(SHL
$(TNR
)STDSHL
:^
"-l") $(STDSHL
$(TNR
):^
"-l") \
567 @
$(LS
) $@
>& $(NULLDEV
)
569 .ENDIF
# "$(USE_DEFFILE)"!=""
571 .IF
"$(SHL$(TNR)TARGET8)" != "$(SHL$(TNR)TARGET)"
572 $(COMMAND_ECHO
)+$(COPY
) $@
$(@
:d
)$(SHL
$(TNR
)TARGET8
).dll
575 .ENDIF
# "$(GUI)" == "OS2"
579 .IF
"$(NO_TESTS)"==""
581 ALLTAR
: runtest_
$(SHL
$(TNR
)TARGET
)
583 runtest_
$(SHL
$(TNR
)TARGET
) : $(SHL
$(TNR
)TARGETN
)
584 testshl
$(SHL
$(TNR
)TARGETN
) sce
/$(SHL
$(TNR
)TARGET
).sce
-msg
-skip
585 .ENDIF
# "$(NO_TESTS)"==""
586 .ENDIF
# "$(TESTDIR)"!=""
587 .ENDIF
# "$(SHL$(TNR)TARGETN)"!=""
590 #######################################################
592 #-------------------------------------------------------------------------
594 #######################################################
595 # Anweisungen fuer das Linken
598 .IF
"$(SHL$(TNR)IMPLIBN)" != ""
600 .IF
"$(UPDATER)"=="YES"
601 USELIB
$(TNR
)DEPN
+=$(SHL
$(TNR
)LIBS
)
605 .IF
"$(USE_DEFFILE)"!=""
606 USE_SHL
$(TNR
)TARGET
=$(SHL
$(TNR
)TARGETN
)
609 .IF
"$(GUI)" != "UNX"
610 $(SHL
$(TNR
)IMPLIBN
): \
612 $(USE_SHL
$(TNR
)TARGET
) \
613 $(USELIB
$(TNR
)DEPN
) \
616 $(SHL
$(TNR
)IMPLIBN
): \
619 .IF
"$(VERBOSE)" == "TRUE"
620 @echo
-------------------------------
622 @echo
"Making: " $(@
:f
)
623 .IF
"$(GUI)" == "WNT"
625 @echo no ImportLibs on mingw
628 .ELSE
# "$(COM)=="GCC"
629 # bei use_deffile implib von linker erstellt
630 .IF
"$(USE_DEFFILE)"==""
631 $(IMPLIB
) $(IMPLIBFLAGS
) @
$(mktmp
-out
:$(SHL
$(TNR
)IMPLIBN
) \
632 -def
:$(SHL
$(TNR
)DEF
) )
633 .ELSE
# "$(USE_DEFFILE)==""
634 @echo build of
$(SHL
$(TNR
)TARGETN
) creates
$@
636 .ENDIF
# "$(USE_DEFFILE)==""
637 .ENDIF
# "$(COM)"=="GCC"
639 .ELIF
"$(GUI)" == "OS2"
641 # touch creates an empty file, but this is not good for emxomfar, so
642 # create a dummy lib here
643 $(COMMAND_ECHO
)-$(LIBMGR
) $(LIBFLAGS
) $@
$(SHL
$(TNR
)VERSIONOBJ
)
644 +@echo build of
$(SHL
$(TNR
)TARGETN
) creates
$@
647 @echo no ImportLibs on Mac and
*ix
654 #######################################################