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 $(COMMAND_ECHO
)$(TYPE
) $< |
$(AWK
) -f
$(SOLARENV
)/bin
/getcsym.awk
> $@
58 $(COMMAND_ECHO
)-$(GREP
) -v
"\*\|?" $@ |
$(SED
) -e
's@#.*@@' > $@.exported-symbols
59 $(COMMAND_ECHO
)-$(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 $(COMMAND_ECHO
)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 $(COMMAND_ECHO
)$(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 .IF
"$(VERBOSE)" == "TRUE"
100 @echo
------------------------------
102 @echo
"Making: module definition file" $(@
:f
)
103 @echo LIBRARY
$(EMQ
)"$(SHL$(TNR)TARGETN:f)$(EMQ)" >$@.tmpfile
105 @echo HEAPSIZE
0 >>$@.tmpfile
107 @echo EXPORTS
>>$@.tmpfile
108 .IF
"$(VERSIONOBJ)"!=""
109 # getversioninfo fuer alle!!
110 @echo GetVersionInfo
>>$@.tmpfile
112 .IF
"$(DEFLIB$(TNR)NAME)"!=""
114 @
-$(RM
) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
115 $(COMMAND_ECHO
)dlltool
--output-def
$(MISC
)/$(SHL
$(TNR
)TARGET
).exp
--export-all-symbols \
116 `$(TYPE) $(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
117 $(COMMAND_ECHO
)tail
--lines
+3 $(MISC
)/$(SHL
$(TNR
)TARGET
).exp | sed
'/^;/d' >>$@.tmpfile
118 @
-$(RM
) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
120 .IF
"$(SHL$(TNR)USE_EXPORTS)"==""
121 @
-$(RMHACK
$(TNR
)) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
122 @
$(LIBMGR
) -EXTRACT
:/ /OUT
:$(MISC
)/$(SHL
$(TNR
)TARGET
).exp
$(SLB
)/$(DEFLIB
$(TNR
)NAME
).lib
123 @
$(LDUMP2
) -N
$(EXPORT_ALL_SWITCH
) -F
$(MISC
)/$(SHL
$(TNR
)TARGET
).flt
$(MISC
)/$(SHL
$(TNR
)TARGET
).exp
>>$@.tmpfile
124 $(COMMAND_ECHO
)$(RMHACK
$(TNR
)) $(MISC
)/$(SHL
$(TNR
)TARGET
).exp
125 .ELSE
# "$(SHL$(TNR)USE_EXPORTS)"==""
126 @
$(DUMPBIN
) -DIRECTIVES
$(foreach,i
,$(DEFLIB
$(TNR
)NAME
) $(SLB
)/$(i
).lib
) |
$(GREP
) EXPORT
: > $(MISC
)/$(SHL
$(TNR
)TARGET
).direct
127 @
$(LDUMP2
) -N
-D
$(EXPORT_ALL_SWITCH
) -F
$(DEF
$(TNR
)FILTER
) $(MISC
)/$(SHL
$(TNR
)TARGET
).direct
>>$@.tmpfile
128 .ENDIF
# "$(SHL$(TNR)USE_EXPORTS)"==""
130 .ENDIF
# "$(DEFLIB$(TNR)NAME)"!=""
131 .IF
"$(DEF$(TNR)EXPORT1)"!=""
132 @echo
$(DEF
$(TNR
)EXPORT1
) >>$@.tmpfile
134 .IF
"$(DEF$(TNR)EXPORT2)"!=""
135 @echo
$(DEF
$(TNR
)EXPORT2
) >>$@.tmpfile
137 .IF
"$(DEF$(TNR)EXPORT3)"!=""
138 @echo
$(DEF
$(TNR
)EXPORT3
) >>$@.tmpfile
140 .IF
"$(DEF$(TNR)EXPORT4)"!=""
141 @echo
$(DEF
$(TNR
)EXPORT4
) >>$@.tmpfile
143 .IF
"$(DEF$(TNR)EXPORT5)"!=""
144 @echo
$(DEF
$(TNR
)EXPORT5
) >>$@.tmpfile
146 .IF
"$(DEF$(TNR)EXPORT6)"!=""
147 @echo
$(DEF
$(TNR
)EXPORT6
) >>$@.tmpfile
149 .IF
"$(DEF$(TNR)EXPORT7)"!=""
150 @echo
$(DEF
$(TNR
)EXPORT7
) >>$@.tmpfile
152 .IF
"$(DEF$(TNR)EXPORT8)"!=""
153 @echo
$(DEF
$(TNR
)EXPORT8
) >>$@.tmpfile
155 .IF
"$(DEF$(TNR)EXPORT9)"!=""
156 @echo
$(DEF
$(TNR
)EXPORT9
) >>$@.tmpfile
158 .IF
"$(DEF$(TNR)EXPORT10)"!=""
159 @echo
$(DEF
$(TNR
)EXPORT10
) >>$@.tmpfile
161 .IF
"$(DEF$(TNR)EXPORT11)"!=""
162 @echo
$(DEF
$(TNR
)EXPORT11
) >>$@.tmpfile
164 .IF
"$(DEF$(TNR)EXPORT12)"!=""
165 @echo
$(DEF
$(TNR
)EXPORT12
) >>$@.tmpfile
167 .IF
"$(DEF$(TNR)EXPORT13)"!=""
168 @echo
$(DEF
$(TNR
)EXPORT13
) >>$@.tmpfile
170 .IF
"$(DEF$(TNR)EXPORT14)"!=""
171 @echo
$(DEF
$(TNR
)EXPORT14
) >>$@.tmpfile
173 .IF
"$(DEF$(TNR)EXPORT15)"!=""
174 @echo
$(DEF
$(TNR
)EXPORT15
) >>$@.tmpfile
176 .IF
"$(DEF$(TNR)EXPORT16)"!=""
177 @echo
$(DEF
$(TNR
)EXPORT16
) >>$@.tmpfile
179 .IF
"$(DEF$(TNR)EXPORT17)"!=""
180 @echo
$(DEF
$(TNR
)EXPORT17
) >>$@.tmpfile
182 .IF
"$(DEF$(TNR)EXPORT18)"!=""
183 @echo
$(DEF
$(TNR
)EXPORT18
) >>$@.tmpfile
185 .IF
"$(DEF$(TNR)EXPORT19)"!=""
186 @echo
$(DEF
$(TNR
)EXPORT19
) >>$@.tmpfile
188 .IF
"$(DEF$(TNR)EXPORT20)"!=""
189 @echo
$(DEF
$(TNR
)EXPORT20
) >>$@.tmpfile
191 .IF
"$(DEF$(TNR)EXPORTFILE)"!=""
193 $(COMMAND_ECHO
)$(TYPE
) $(DEF
$(TNR
)EXPORTFILE
) | sed
-e s
:PRIVATE
:: >> $@.tmpfile
195 $(COMMAND_ECHO
)$(TYPE
) $(DEF
$(TNR
)EXPORTFILE
) >> $@.tmpfile
199 @
$(RENAME
) $@.tmpfile
$@
200 .ENDIF
# "$(GUI)"=="WNT"
204 #21/02/2006 YD dll names must be 8.3, invoke fix script
205 #check osl/os2/module.c/osl_loadModule()
206 SHL
$(TNR
)TARGET8
=$(shell @fix_shl
$(SHL
$(TNR
)TARGETN
:f
))
208 DEF
$(TNR
)FILTER
=$(SOLARENV
)/inc
/dummy.flt
209 DEF
$(TNR
)NAMELIST
=$(foreach,i
,$(DEFLIB
$(TNR
)NAME
) $(SLB
)/$(i
).lib
)
211 .IF
"$(link_always)"==""
212 $(DEF
$(TNR
)TARGETN
) : \
214 $(DEF
$(TNR
)EXPORTFILE
)
215 .ELSE
# "$(link_always)"==""
216 $(DEF
$(TNR
)TARGETN
) .PHONY
:
217 .ENDIF
# "$(link_always)"==""
219 .IF
"$(VERBOSE)" == "TRUE"
220 @echo
------------------------------
222 @echo
"Making: module definition file" $(@
:f
)
223 @echo LIBRARY
$(SHL
$(TNR
)TARGET8
) INITINSTANCE TERMINSTANCE
>$@.tmpfile
224 @echo DATA MULTIPLE
>>$@.tmpfile
225 @echo DESCRIPTION
'StarView 3.00 $(DEF$(TNR)DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
226 @echo EXPORTS
>>$@.tmpfile
227 .IF
"$(VERSIONOBJ)"!=""
228 # getversioninfo fuer alle!!
229 @echo _GetVersionInfo
>$@.tmp_ord
232 .IF
"$(DEFLIB$(TNR)NAME)"!=""
233 @
+echo
$(SLB
)/$(DEFLIB
$(TNR
)NAME
).lib
234 @
+emxexpr
$(DEF
$(TNR
)NAMELIST
) | fix_exp_file
>> $@.tmp_ord
235 .ENDIF
# "$(DEFLIB$(TNR)NAME)"!=""
237 .IF
"$(DEF$(TNR)EXPORT1)"!=""
238 @echo
$(DEF
$(TNR
)EXPORT1
) >>$@.tmpfile
240 .IF
"$(DEF$(TNR)EXPORT2)"!=""
241 @echo
$(DEF
$(TNR
)EXPORT2
) >>$@.tmpfile
243 .IF
"$(DEF$(TNR)EXPORT3)"!=""
244 @echo
$(DEF
$(TNR
)EXPORT3
) >>$@.tmpfile
246 .IF
"$(DEF$(TNR)EXPORT4)"!=""
247 @echo
$(DEF
$(TNR
)EXPORT4
) >>$@.tmpfile
249 .IF
"$(DEF$(TNR)EXPORT5)"!=""
250 @echo
$(DEF
$(TNR
)EXPORT5
) >>$@.tmpfile
252 .IF
"$(DEF$(TNR)EXPORT6)"!=""
253 @echo
$(DEF
$(TNR
)EXPORT6
) >>$@.tmpfile
255 .IF
"$(DEF$(TNR)EXPORT7)"!=""
256 @echo
$(DEF
$(TNR
)EXPORT7
) >>$@.tmpfile
258 .IF
"$(DEF$(TNR)EXPORT8)"!=""
259 @echo
$(DEF
$(TNR
)EXPORT8
) >>$@.tmpfile
261 .IF
"$(DEF$(TNR)EXPORT9)"!=""
262 @echo
$(DEF
$(TNR
)EXPORT9
) >>$@.tmpfile
264 .IF
"$(DEF$(TNR)EXPORT10)"!=""
265 @echo
$(DEF
$(TNR
)EXPORT10
) >>$@.tmpfile
267 .IF
"$(DEF$(TNR)EXPORT11)"!=""
268 @echo
$(DEF
$(TNR
)EXPORT11
) >>$@.tmpfile
270 .IF
"$(DEF$(TNR)EXPORT12)"!=""
271 @echo
$(DEF
$(TNR
)EXPORT12
) >>$@.tmpfile
273 .IF
"$(DEF$(TNR)EXPORT13)"!=""
274 @echo
$(DEF
$(TNR
)EXPORT13
) >>$@.tmpfile
276 .IF
"$(DEF$(TNR)EXPORT14)"!=""
277 @echo
$(DEF
$(TNR
)EXPORT14
) >>$@.tmpfile
279 .IF
"$(DEF$(TNR)EXPORT15)"!=""
280 @echo
$(DEF
$(TNR
)EXPORT15
) >>$@.tmpfile
282 .IF
"$(DEF$(TNR)EXPORT16)"!=""
283 @echo
$(DEF
$(TNR
)EXPORT16
) >>$@.tmpfile
285 .IF
"$(DEF$(TNR)EXPORT17)"!=""
286 @echo
$(DEF
$(TNR
)EXPORT17
) >>$@.tmpfile
288 .IF
"$(DEF$(TNR)EXPORT18)"!=""
289 @echo
$(DEF
$(TNR
)EXPORT18
) >>$@.tmpfile
291 .IF
"$(DEF$(TNR)EXPORT19)"!=""
292 @echo
$(DEF
$(TNR
)EXPORT19
) >>$@.tmpfile
294 .IF
"$(DEF$(TNR)EXPORT20)"!=""
295 @echo
$(DEF
$(TNR
)EXPORT20
) >>$@.tmpfile
297 .IF
"$(DEF$(TNR)EXPORTFILE)"!=""
298 @fix_def_file
< $(DEF
$(TNR
)EXPORTFILE
) >> $@.tmp_ord
300 @
sort < $@.tmp_ord | uniq
> $@.exptmpfile
301 @fix_def_ord
< $@.exptmpfile
>> $@.tmpfile
303 $(COMMAND_ECHO
)+$(RENAME
) $@.tmpfile
$@
305 @
+-$(RM
) $@.exptmpfile
306 $(COMMAND_ECHO
)+$(IMPLIB
) $(IMPLIBFLAGS
) $(SHL
$(TNR
)IMPLIBN
:s
/.lib
/.a
/) $@
307 $(COMMAND_ECHO
)+emxomf
-o
$(SHL
$(TNR
)IMPLIBN
) $(SHL
$(TNR
)IMPLIBN
:s
/.lib
/.a
/)
309 .ENDIF
# "$(GUI)"=="OS2"
312 $(DEF
$(TNR
)TARGETN
): \
314 $(DEF
$(TNR
)EXPORTFILE
)
315 @echo just a dummy for UNIX
> $@
317 .ENDIF
# "$(DEF$(TNR)TARGETN)"!=""
320 # Anweisungen fuer das Linken
322 #######################################################