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_def.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 #######################################################
33 # Anweisungen fuer das Linken
36 .IF
"$(DEF$(TNR)TARGETN)"!=""
38 #to make intuitiv naming work
39 .IF
"$(DEF$(TNR)LIBNAME)"!=""
40 DEFLIB
$(TNR
)NAME
*=$(DEF
$(TNR
)LIBNAME
)
41 .ENDIF
# "$(DEF$(TNR)LIBNAME)"!=""
43 .IF
"$(DEFLIB$(TNR)NAME)"!=""
44 DEF
$(TNR
)DEPN
+=$(foreach,i
,$(DEFLIB
$(TNR
)NAME
) $(SLB
)/$(i
).lib
)
47 .IF
"$(SHL$(TNR)VERSIONMAP)"!=""
48 .IF
"$(DEF$(TNR)EXPORTFILE)"==""
50 DEF
$(TNR
)EXPORTFILE
=$(MISC
)/$(SHL
$(TNR
)VERSIONMAP
:b
)_
$(SHL
$(TNR
)TARGET
).dxp
52 $(DEF
$(TNR
)EXPORTFILE
) : $(SHL
$(TNR
)OBJS
) $(SHL
$(TNR
)LIBS
)
53 .ENDIF
# .IF "$(COM)"=="GCC"
55 $(DEF
$(TNR
)EXPORTFILE
) : $(SHL
$(TNR
)VERSIONMAP
)
56 $(TYPE
) $< |
$(AWK
) -f
$(SOLARENV
)/bin
/getcsym.awk
> $@
58 -$(GREP
) -v
"\*\|?" $@ |
$(SED
) -e
's@#.*@@' > $@.exported-symbols
59 -$(GREP
) "\*\|?" $@
> $@.symbols-regexp
60 # Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
61 # Extract RTTI symbols from all the objects that will be used to build a shared library
62 nm
-gP
$(SHL
$(TNR
)OBJS
) \
63 `$(TYPE) /dev/null $(foreach,j,$(SHL$(TNR)LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
64 |
$(SOLARENV
)/bin
/addsym-mingw.sh
$@.symbols-regexp
$@.symbols-regexp.tmp
>> $@.exported-symbols
65 # overwrite the map file generate into the local output tree with the generated
66 # exported symbols list
67 $(RENAME
) $@.exported-symbols
$@
68 .ENDIF
# .IF "$(COM)"=="GCC"
70 .ENDIF
# "$(GUI)"=="WNT"
73 DEF
$(TNR
)EXPORTFILE
=$(MISC
)/$(SHL
$(TNR
)VERSIONMAP
:b
)_
$(SHL
$(TNR
)TARGET
).dxp
74 $(DEF
$(TNR
)EXPORTFILE
) : $(SHL
$(TNR
)VERSIONMAP
)
75 $(TYPE
) $< |
$(AWK
) -f
$(SOLARENV
)/bin
/getcsym.awk
> $@
76 .ENDIF
# "$(GUI)"=="OS2"
78 .ENDIF
# "$(DEF$(TNR)EXPORTFILE)"==""
79 .ENDIF
# "$(SHL$(TNR)VERSIONMAP)"!=""
83 DEF
$(TNR
)FILTER
=$(SOLARENV
)/inc
/dummy.flt
87 .IF
"$(DEF$(TNR)CEXP)"!=""
88 EXPORT_ALL_SWITCH
=-A
$(DEF
$(TNR
)CEXP
)
91 .IF
"$(link_always)"==""
92 $(DEF
$(TNR
)TARGETN
) : \
94 $(DEF
$(TNR
)EXPORTFILE
)
95 .ELSE
# "$(link_always)"==""
96 $(DEF
$(TNR
)TARGETN
) .PHONY
:
97 .ENDIF
# "$(link_always)"==""
99 @echo
------------------------------
100 @echo Making Module-Definitionfile
: $@
101 @echo LIBRARY
$(EMQ
)"$(SHL$(TNR)TARGETN:f)$(EMQ)" >$@.tmpfile
103 @echo HEAPSIZE
0 >>$@.tmpfile
105 @echo EXPORTS
>>$@.tmpfile
106 .IF
"$(VERSIONOBJ)"!=""
107 # getversioninfo fuer alle!!
108 @echo GetVersionInfo
>>$@.tmpfile
110 .IF
"$(DEFLIB$(TNR)NAME)"!=""
112 @
-$(RM
) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
113 dlltool
--output-def
$(MISC
)/$(SHL
$(TNR
)TARGET
).exp
--export-all-symbols \
114 `$(TYPE) $(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
115 tail
--lines
+3 $(MISC
)/$(SHL
$(TNR
)TARGET
).exp | sed
'/^;/d' >>$@.tmpfile
116 @
-$(RM
) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
118 .IF
"$(SHL$(TNR)USE_EXPORTS)"==""
119 @
-$(RMHACK
$(TNR
)) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
120 @
$(LIBMGR
) -EXTRACT
:/ /OUT
:$(MISC
)/$(SHL
$(TNR
)TARGET
).exp
$(SLB
)/$(DEFLIB
$(TNR
)NAME
).lib
121 @
$(LDUMP2
) -N
$(EXPORT_ALL_SWITCH
) -F
$(MISC
)/$(SHL
$(TNR
)TARGET
).flt
$(MISC
)/$(SHL
$(TNR
)TARGET
).exp
>>$@.tmpfile
122 $(RMHACK
$(TNR
)) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
123 .ELSE
# "$(SHL$(TNR)USE_EXPORTS)"==""
124 @
$(DUMPBIN
) -DIRECTIVES
$(foreach,i
,$(DEFLIB
$(TNR
)NAME
) $(SLB
)/$(i
).lib
) |
$(GREP
) EXPORT
: > $(MISC
)/$(SHL
$(TNR
)TARGET
).direct
125 @
$(LDUMP2
) -N
-D
$(EXPORT_ALL_SWITCH
) -F
$(DEF
$(TNR
)FILTER
) $(MISC
)/$(SHL
$(TNR
)TARGET
).direct
>>$@.tmpfile
126 .ENDIF
# "$(SHL$(TNR)USE_EXPORTS)"==""
128 .ENDIF
# "$(DEFLIB$(TNR)NAME)"!=""
129 .IF
"$(DEF$(TNR)EXPORT1)"!=""
130 @echo
$(DEF
$(TNR
)EXPORT1
) >>$@.tmpfile
132 .IF
"$(DEF$(TNR)EXPORT2)"!=""
133 @echo
$(DEF
$(TNR
)EXPORT2
) >>$@.tmpfile
135 .IF
"$(DEF$(TNR)EXPORT3)"!=""
136 @echo
$(DEF
$(TNR
)EXPORT3
) >>$@.tmpfile
138 .IF
"$(DEF$(TNR)EXPORT4)"!=""
139 @echo
$(DEF
$(TNR
)EXPORT4
) >>$@.tmpfile
141 .IF
"$(DEF$(TNR)EXPORT5)"!=""
142 @echo
$(DEF
$(TNR
)EXPORT5
) >>$@.tmpfile
144 .IF
"$(DEF$(TNR)EXPORT6)"!=""
145 @echo
$(DEF
$(TNR
)EXPORT6
) >>$@.tmpfile
147 .IF
"$(DEF$(TNR)EXPORT7)"!=""
148 @echo
$(DEF
$(TNR
)EXPORT7
) >>$@.tmpfile
150 .IF
"$(DEF$(TNR)EXPORT8)"!=""
151 @echo
$(DEF
$(TNR
)EXPORT8
) >>$@.tmpfile
153 .IF
"$(DEF$(TNR)EXPORT9)"!=""
154 @echo
$(DEF
$(TNR
)EXPORT9
) >>$@.tmpfile
156 .IF
"$(DEF$(TNR)EXPORT10)"!=""
157 @echo
$(DEF
$(TNR
)EXPORT10
) >>$@.tmpfile
159 .IF
"$(DEF$(TNR)EXPORT11)"!=""
160 @echo
$(DEF
$(TNR
)EXPORT11
) >>$@.tmpfile
162 .IF
"$(DEF$(TNR)EXPORT12)"!=""
163 @echo
$(DEF
$(TNR
)EXPORT12
) >>$@.tmpfile
165 .IF
"$(DEF$(TNR)EXPORT13)"!=""
166 @echo
$(DEF
$(TNR
)EXPORT13
) >>$@.tmpfile
168 .IF
"$(DEF$(TNR)EXPORT14)"!=""
169 @echo
$(DEF
$(TNR
)EXPORT14
) >>$@.tmpfile
171 .IF
"$(DEF$(TNR)EXPORT15)"!=""
172 @echo
$(DEF
$(TNR
)EXPORT15
) >>$@.tmpfile
174 .IF
"$(DEF$(TNR)EXPORT16)"!=""
175 @echo
$(DEF
$(TNR
)EXPORT16
) >>$@.tmpfile
177 .IF
"$(DEF$(TNR)EXPORT17)"!=""
178 @echo
$(DEF
$(TNR
)EXPORT17
) >>$@.tmpfile
180 .IF
"$(DEF$(TNR)EXPORT18)"!=""
181 @echo
$(DEF
$(TNR
)EXPORT18
) >>$@.tmpfile
183 .IF
"$(DEF$(TNR)EXPORT19)"!=""
184 @echo
$(DEF
$(TNR
)EXPORT19
) >>$@.tmpfile
186 .IF
"$(DEF$(TNR)EXPORT20)"!=""
187 @echo
$(DEF
$(TNR
)EXPORT20
) >>$@.tmpfile
189 .IF
"$(DEF$(TNR)EXPORTFILE)"!=""
191 $(TYPE
) $(DEF
$(TNR
)EXPORTFILE
) | sed
-e s
:PRIVATE
:: >> $@.tmpfile
193 $(TYPE
) $(DEF
$(TNR
)EXPORTFILE
) >> $@.tmpfile
197 @
$(RENAME
) $@.tmpfile
$@
198 .ENDIF
# "$(GUI)"=="WNT"
202 #21/02/2006 YD dll names must be 8.3, invoke fix script
203 #check osl/os2/module.c/osl_loadModule()
204 SHL
$(TNR
)TARGET8
=$(shell @fix_shl
$(SHL
$(TNR
)TARGETN
:f
))
206 DEF
$(TNR
)FILTER
=$(SOLARENV
)/inc
/dummy.flt
207 DEF
$(TNR
)NAMELIST
=$(foreach,i
,$(DEFLIB
$(TNR
)NAME
) $(SLB
)/$(i
).lib
)
209 .IF
"$(link_always)"==""
210 $(DEF
$(TNR
)TARGETN
) : \
212 $(DEF
$(TNR
)EXPORTFILE
)
213 .ELSE
# "$(link_always)"==""
214 $(DEF
$(TNR
)TARGETN
) .PHONY
:
215 .ENDIF
# "$(link_always)"==""
217 @echo
------------------------------
218 @echo Making Module-Definitionfile
: $@
219 @echo LIBRARY
$(SHL
$(TNR
)TARGET8
) INITINSTANCE TERMINSTANCE
>$@.tmpfile
220 @echo DATA MULTIPLE
>>$@.tmpfile
221 @echo DESCRIPTION
'StarView 3.00 $(DEF$(TNR)DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
222 @echo EXPORTS
>>$@.tmpfile
223 .IF
"$(VERSIONOBJ)"!=""
224 # getversioninfo fuer alle!!
225 @echo _GetVersionInfo
>$@.tmp_ord
228 .IF
"$(DEFLIB$(TNR)NAME)"!=""
229 @
+echo
$(SLB
)/$(DEFLIB
$(TNR
)NAME
).lib
230 @
+emxexpr
$(DEF
$(TNR
)NAMELIST
) | fix_exp_file
>> $@.tmp_ord
231 .ENDIF
# "$(DEFLIB$(TNR)NAME)"!=""
233 .IF
"$(DEF$(TNR)EXPORT1)"!=""
234 @echo
$(DEF
$(TNR
)EXPORT1
) >>$@.tmpfile
236 .IF
"$(DEF$(TNR)EXPORT2)"!=""
237 @echo
$(DEF
$(TNR
)EXPORT2
) >>$@.tmpfile
239 .IF
"$(DEF$(TNR)EXPORT3)"!=""
240 @echo
$(DEF
$(TNR
)EXPORT3
) >>$@.tmpfile
242 .IF
"$(DEF$(TNR)EXPORT4)"!=""
243 @echo
$(DEF
$(TNR
)EXPORT4
) >>$@.tmpfile
245 .IF
"$(DEF$(TNR)EXPORT5)"!=""
246 @echo
$(DEF
$(TNR
)EXPORT5
) >>$@.tmpfile
248 .IF
"$(DEF$(TNR)EXPORT6)"!=""
249 @echo
$(DEF
$(TNR
)EXPORT6
) >>$@.tmpfile
251 .IF
"$(DEF$(TNR)EXPORT7)"!=""
252 @echo
$(DEF
$(TNR
)EXPORT7
) >>$@.tmpfile
254 .IF
"$(DEF$(TNR)EXPORT8)"!=""
255 @echo
$(DEF
$(TNR
)EXPORT8
) >>$@.tmpfile
257 .IF
"$(DEF$(TNR)EXPORT9)"!=""
258 @echo
$(DEF
$(TNR
)EXPORT9
) >>$@.tmpfile
260 .IF
"$(DEF$(TNR)EXPORT10)"!=""
261 @echo
$(DEF
$(TNR
)EXPORT10
) >>$@.tmpfile
263 .IF
"$(DEF$(TNR)EXPORT11)"!=""
264 @echo
$(DEF
$(TNR
)EXPORT11
) >>$@.tmpfile
266 .IF
"$(DEF$(TNR)EXPORT12)"!=""
267 @echo
$(DEF
$(TNR
)EXPORT12
) >>$@.tmpfile
269 .IF
"$(DEF$(TNR)EXPORT13)"!=""
270 @echo
$(DEF
$(TNR
)EXPORT13
) >>$@.tmpfile
272 .IF
"$(DEF$(TNR)EXPORT14)"!=""
273 @echo
$(DEF
$(TNR
)EXPORT14
) >>$@.tmpfile
275 .IF
"$(DEF$(TNR)EXPORT15)"!=""
276 @echo
$(DEF
$(TNR
)EXPORT15
) >>$@.tmpfile
278 .IF
"$(DEF$(TNR)EXPORT16)"!=""
279 @echo
$(DEF
$(TNR
)EXPORT16
) >>$@.tmpfile
281 .IF
"$(DEF$(TNR)EXPORT17)"!=""
282 @echo
$(DEF
$(TNR
)EXPORT17
) >>$@.tmpfile
284 .IF
"$(DEF$(TNR)EXPORT18)"!=""
285 @echo
$(DEF
$(TNR
)EXPORT18
) >>$@.tmpfile
287 .IF
"$(DEF$(TNR)EXPORT19)"!=""
288 @echo
$(DEF
$(TNR
)EXPORT19
) >>$@.tmpfile
290 .IF
"$(DEF$(TNR)EXPORT20)"!=""
291 @echo
$(DEF
$(TNR
)EXPORT20
) >>$@.tmpfile
293 .IF
"$(DEF$(TNR)EXPORTFILE)"!=""
294 @fix_def_file
< $(DEF
$(TNR
)EXPORTFILE
) >> $@.tmp_ord
296 @
sort < $@.tmp_ord | uniq
> $@.exptmpfile
297 @fix_def_ord
< $@.exptmpfile
>> $@.tmpfile
299 +$(RENAME
) $@.tmpfile
$@
301 @
+-$(RM
) $@.exptmpfile
302 +$(IMPLIB
) $(IMPLIBFLAGS
) $(SHL
$(TNR
)IMPLIBN
:s
/.lib
/.a
/) $@
303 +emxomf
-o
$(SHL
$(TNR
)IMPLIBN
) $(SHL
$(TNR
)IMPLIBN
:s
/.lib
/.a
/)
305 .ENDIF
# "$(GUI)"=="OS2"
308 $(DEF
$(TNR
)TARGETN
): \
310 $(DEF
$(TNR
)EXPORTFILE
)
311 @echo just a dummy for UNIX
> $@
313 .ENDIF
# "$(DEF$(TNR)TARGETN)"!=""
316 # Anweisungen fuer das Linken
318 #######################################################