update dev300-m58
[ooovba.git] / solenv / inc / tg_def.mk
blob88feb367c08bbbe6723489c5ea732096f8478508
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_def.mk,v $
11 # $Revision: 1.49 $
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
34 # unroll begin
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)
45 .ENDIF
47 .IF "$(SHL$(TNR)VERSIONMAP)"!=""
48 .IF "$(DEF$(TNR)EXPORTFILE)"==""
49 .IF "$(GUI)"=="WNT"
50 DEF$(TNR)EXPORTFILE=$(MISC)/$(SHL$(TNR)VERSIONMAP:b)_$(SHL$(TNR)TARGET).dxp
51 .IF "$(COM)"=="GCC"
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 > $@
57 .IF "$(COM)"=="GCC"
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"
72 .IF "$(GUI)"=="OS2"
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)"!=""
81 .IF "$(GUI)"=="WNT"
83 DEF$(TNR)FILTER=$(SOLARENV)/inc/dummy.flt
85 RMHACK$(TNR):=$(RM)
87 .IF "$(DEF$(TNR)CEXP)"!=""
88 EXPORT_ALL_SWITCH=-A $(DEF$(TNR)CEXP)
89 .ENDIF
91 .IF "$(link_always)"==""
92 $(DEF$(TNR)TARGETN) : \
93 $(DEF$(TNR)DEPN) \
94 $(DEF$(TNR)EXPORTFILE)
95 .ELSE # "$(link_always)"==""
96 $(DEF$(TNR)TARGETN) .PHONY :
97 .ENDIF # "$(link_always)"==""
98 @-$(RM) $@.tmpfile
99 @echo ------------------------------
100 @echo Making Module-Definitionfile : $@
101 @echo LIBRARY $(EMQ)"$(SHL$(TNR)TARGETN:f)$(EMQ)" >$@.tmpfile
102 .IF "$(COM)"!="GCC"
103 @echo HEAPSIZE 0 >>$@.tmpfile
104 .ENDIF
105 @echo EXPORTS >>$@.tmpfile
106 .IF "$(VERSIONOBJ)"!=""
107 # getversioninfo fuer alle!!
108 @echo GetVersionInfo >>$@.tmpfile
109 .ENDIF
110 .IF "$(DEFLIB$(TNR)NAME)"!=""
111 .IF "$(COM)"=="GCC"
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
117 .ELSE
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)"==""
127 .ENDIF
128 .ENDIF # "$(DEFLIB$(TNR)NAME)"!=""
129 .IF "$(DEF$(TNR)EXPORT1)"!=""
130 @echo $(DEF$(TNR)EXPORT1) >>$@.tmpfile
131 .ENDIF
132 .IF "$(DEF$(TNR)EXPORT2)"!=""
133 @echo $(DEF$(TNR)EXPORT2) >>$@.tmpfile
134 .ENDIF
135 .IF "$(DEF$(TNR)EXPORT3)"!=""
136 @echo $(DEF$(TNR)EXPORT3) >>$@.tmpfile
137 .ENDIF
138 .IF "$(DEF$(TNR)EXPORT4)"!=""
139 @echo $(DEF$(TNR)EXPORT4) >>$@.tmpfile
140 .ENDIF
141 .IF "$(DEF$(TNR)EXPORT5)"!=""
142 @echo $(DEF$(TNR)EXPORT5) >>$@.tmpfile
143 .ENDIF
144 .IF "$(DEF$(TNR)EXPORT6)"!=""
145 @echo $(DEF$(TNR)EXPORT6) >>$@.tmpfile
146 .ENDIF
147 .IF "$(DEF$(TNR)EXPORT7)"!=""
148 @echo $(DEF$(TNR)EXPORT7) >>$@.tmpfile
149 .ENDIF
150 .IF "$(DEF$(TNR)EXPORT8)"!=""
151 @echo $(DEF$(TNR)EXPORT8) >>$@.tmpfile
152 .ENDIF
153 .IF "$(DEF$(TNR)EXPORT9)"!=""
154 @echo $(DEF$(TNR)EXPORT9) >>$@.tmpfile
155 .ENDIF
156 .IF "$(DEF$(TNR)EXPORT10)"!=""
157 @echo $(DEF$(TNR)EXPORT10) >>$@.tmpfile
158 .ENDIF
159 .IF "$(DEF$(TNR)EXPORT11)"!=""
160 @echo $(DEF$(TNR)EXPORT11) >>$@.tmpfile
161 .ENDIF
162 .IF "$(DEF$(TNR)EXPORT12)"!=""
163 @echo $(DEF$(TNR)EXPORT12) >>$@.tmpfile
164 .ENDIF
165 .IF "$(DEF$(TNR)EXPORT13)"!=""
166 @echo $(DEF$(TNR)EXPORT13) >>$@.tmpfile
167 .ENDIF
168 .IF "$(DEF$(TNR)EXPORT14)"!=""
169 @echo $(DEF$(TNR)EXPORT14) >>$@.tmpfile
170 .ENDIF
171 .IF "$(DEF$(TNR)EXPORT15)"!=""
172 @echo $(DEF$(TNR)EXPORT15) >>$@.tmpfile
173 .ENDIF
174 .IF "$(DEF$(TNR)EXPORT16)"!=""
175 @echo $(DEF$(TNR)EXPORT16) >>$@.tmpfile
176 .ENDIF
177 .IF "$(DEF$(TNR)EXPORT17)"!=""
178 @echo $(DEF$(TNR)EXPORT17) >>$@.tmpfile
179 .ENDIF
180 .IF "$(DEF$(TNR)EXPORT18)"!=""
181 @echo $(DEF$(TNR)EXPORT18) >>$@.tmpfile
182 .ENDIF
183 .IF "$(DEF$(TNR)EXPORT19)"!=""
184 @echo $(DEF$(TNR)EXPORT19) >>$@.tmpfile
185 .ENDIF
186 .IF "$(DEF$(TNR)EXPORT20)"!=""
187 @echo $(DEF$(TNR)EXPORT20) >>$@.tmpfile
188 .ENDIF
189 .IF "$(DEF$(TNR)EXPORTFILE)"!=""
190 .IF "$(COM)"=="GCC"
191 $(TYPE) $(DEF$(TNR)EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
192 .ELSE
193 $(TYPE) $(DEF$(TNR)EXPORTFILE) >> $@.tmpfile
194 .ENDIF
195 .ENDIF
196 @-$(RM) $@
197 @$(RENAME) $@.tmpfile $@
198 .ENDIF # "$(GUI)"=="WNT"
200 .IF "$(GUI)"=="OS2"
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) : \
211 $(DEF$(TNR)DEPN) \
212 $(DEF$(TNR)EXPORTFILE)
213 .ELSE # "$(link_always)"==""
214 $(DEF$(TNR)TARGETN) .PHONY :
215 .ENDIF # "$(link_always)"==""
216 @+-$(RM) $@.tmpfile
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
226 .ENDIF
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
235 .ENDIF
236 .IF "$(DEF$(TNR)EXPORT2)"!=""
237 @echo $(DEF$(TNR)EXPORT2) >>$@.tmpfile
238 .ENDIF
239 .IF "$(DEF$(TNR)EXPORT3)"!=""
240 @echo $(DEF$(TNR)EXPORT3) >>$@.tmpfile
241 .ENDIF
242 .IF "$(DEF$(TNR)EXPORT4)"!=""
243 @echo $(DEF$(TNR)EXPORT4) >>$@.tmpfile
244 .ENDIF
245 .IF "$(DEF$(TNR)EXPORT5)"!=""
246 @echo $(DEF$(TNR)EXPORT5) >>$@.tmpfile
247 .ENDIF
248 .IF "$(DEF$(TNR)EXPORT6)"!=""
249 @echo $(DEF$(TNR)EXPORT6) >>$@.tmpfile
250 .ENDIF
251 .IF "$(DEF$(TNR)EXPORT7)"!=""
252 @echo $(DEF$(TNR)EXPORT7) >>$@.tmpfile
253 .ENDIF
254 .IF "$(DEF$(TNR)EXPORT8)"!=""
255 @echo $(DEF$(TNR)EXPORT8) >>$@.tmpfile
256 .ENDIF
257 .IF "$(DEF$(TNR)EXPORT9)"!=""
258 @echo $(DEF$(TNR)EXPORT9) >>$@.tmpfile
259 .ENDIF
260 .IF "$(DEF$(TNR)EXPORT10)"!=""
261 @echo $(DEF$(TNR)EXPORT10) >>$@.tmpfile
262 .ENDIF
263 .IF "$(DEF$(TNR)EXPORT11)"!=""
264 @echo $(DEF$(TNR)EXPORT11) >>$@.tmpfile
265 .ENDIF
266 .IF "$(DEF$(TNR)EXPORT12)"!=""
267 @echo $(DEF$(TNR)EXPORT12) >>$@.tmpfile
268 .ENDIF
269 .IF "$(DEF$(TNR)EXPORT13)"!=""
270 @echo $(DEF$(TNR)EXPORT13) >>$@.tmpfile
271 .ENDIF
272 .IF "$(DEF$(TNR)EXPORT14)"!=""
273 @echo $(DEF$(TNR)EXPORT14) >>$@.tmpfile
274 .ENDIF
275 .IF "$(DEF$(TNR)EXPORT15)"!=""
276 @echo $(DEF$(TNR)EXPORT15) >>$@.tmpfile
277 .ENDIF
278 .IF "$(DEF$(TNR)EXPORT16)"!=""
279 @echo $(DEF$(TNR)EXPORT16) >>$@.tmpfile
280 .ENDIF
281 .IF "$(DEF$(TNR)EXPORT17)"!=""
282 @echo $(DEF$(TNR)EXPORT17) >>$@.tmpfile
283 .ENDIF
284 .IF "$(DEF$(TNR)EXPORT18)"!=""
285 @echo $(DEF$(TNR)EXPORT18) >>$@.tmpfile
286 .ENDIF
287 .IF "$(DEF$(TNR)EXPORT19)"!=""
288 @echo $(DEF$(TNR)EXPORT19) >>$@.tmpfile
289 .ENDIF
290 .IF "$(DEF$(TNR)EXPORT20)"!=""
291 @echo $(DEF$(TNR)EXPORT20) >>$@.tmpfile
292 .ENDIF
293 .IF "$(DEF$(TNR)EXPORTFILE)"!=""
294 @fix_def_file < $(DEF$(TNR)EXPORTFILE) >> $@.tmp_ord
295 .ENDIF
296 @sort < $@.tmp_ord | uniq > $@.exptmpfile
297 @fix_def_ord < $@.exptmpfile >> $@.tmpfile
298 @+-$(RM) $@
299 +$(RENAME) $@.tmpfile $@
300 @+-$(RM) $@.tmp_ord
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"
307 .IF "$(GUI)"=="UNX"
308 $(DEF$(TNR)TARGETN): \
309 $(DEF$(TNR)DEPN) \
310 $(DEF$(TNR)EXPORTFILE)
311 @echo just a dummy for UNIX > $@
312 .ENDIF
313 .ENDIF # "$(DEF$(TNR)TARGETN)"!=""
316 # Anweisungen fuer das Linken
317 # unroll end
318 #######################################################