Update ooo320-m1
[ooovba.git] / solenv / inc / tg_def.mk
blobec539d0acf593c6c2cac1810b45ef5d7ad69cae9
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 $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
57 .IF "$(COM)"=="GCC"
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"
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 .IF "$(VERBOSE)" == "TRUE"
100 @echo ------------------------------
101 .ENDIF
102 @echo "Making: module definition file" $(@:f)
103 @echo LIBRARY $(EMQ)"$(SHL$(TNR)TARGETN:f)$(EMQ)" >$@.tmpfile
104 .IF "$(COM)"!="GCC"
105 @echo HEAPSIZE 0 >>$@.tmpfile
106 .ENDIF
107 @echo EXPORTS >>$@.tmpfile
108 .IF "$(VERSIONOBJ)"!=""
109 # getversioninfo fuer alle!!
110 @echo GetVersionInfo >>$@.tmpfile
111 .ENDIF
112 .IF "$(DEFLIB$(TNR)NAME)"!=""
113 .IF "$(COM)"=="GCC"
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
119 .ELSE
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)"==""
129 .ENDIF
130 .ENDIF # "$(DEFLIB$(TNR)NAME)"!=""
131 .IF "$(DEF$(TNR)EXPORT1)"!=""
132 @echo $(DEF$(TNR)EXPORT1) >>$@.tmpfile
133 .ENDIF
134 .IF "$(DEF$(TNR)EXPORT2)"!=""
135 @echo $(DEF$(TNR)EXPORT2) >>$@.tmpfile
136 .ENDIF
137 .IF "$(DEF$(TNR)EXPORT3)"!=""
138 @echo $(DEF$(TNR)EXPORT3) >>$@.tmpfile
139 .ENDIF
140 .IF "$(DEF$(TNR)EXPORT4)"!=""
141 @echo $(DEF$(TNR)EXPORT4) >>$@.tmpfile
142 .ENDIF
143 .IF "$(DEF$(TNR)EXPORT5)"!=""
144 @echo $(DEF$(TNR)EXPORT5) >>$@.tmpfile
145 .ENDIF
146 .IF "$(DEF$(TNR)EXPORT6)"!=""
147 @echo $(DEF$(TNR)EXPORT6) >>$@.tmpfile
148 .ENDIF
149 .IF "$(DEF$(TNR)EXPORT7)"!=""
150 @echo $(DEF$(TNR)EXPORT7) >>$@.tmpfile
151 .ENDIF
152 .IF "$(DEF$(TNR)EXPORT8)"!=""
153 @echo $(DEF$(TNR)EXPORT8) >>$@.tmpfile
154 .ENDIF
155 .IF "$(DEF$(TNR)EXPORT9)"!=""
156 @echo $(DEF$(TNR)EXPORT9) >>$@.tmpfile
157 .ENDIF
158 .IF "$(DEF$(TNR)EXPORT10)"!=""
159 @echo $(DEF$(TNR)EXPORT10) >>$@.tmpfile
160 .ENDIF
161 .IF "$(DEF$(TNR)EXPORT11)"!=""
162 @echo $(DEF$(TNR)EXPORT11) >>$@.tmpfile
163 .ENDIF
164 .IF "$(DEF$(TNR)EXPORT12)"!=""
165 @echo $(DEF$(TNR)EXPORT12) >>$@.tmpfile
166 .ENDIF
167 .IF "$(DEF$(TNR)EXPORT13)"!=""
168 @echo $(DEF$(TNR)EXPORT13) >>$@.tmpfile
169 .ENDIF
170 .IF "$(DEF$(TNR)EXPORT14)"!=""
171 @echo $(DEF$(TNR)EXPORT14) >>$@.tmpfile
172 .ENDIF
173 .IF "$(DEF$(TNR)EXPORT15)"!=""
174 @echo $(DEF$(TNR)EXPORT15) >>$@.tmpfile
175 .ENDIF
176 .IF "$(DEF$(TNR)EXPORT16)"!=""
177 @echo $(DEF$(TNR)EXPORT16) >>$@.tmpfile
178 .ENDIF
179 .IF "$(DEF$(TNR)EXPORT17)"!=""
180 @echo $(DEF$(TNR)EXPORT17) >>$@.tmpfile
181 .ENDIF
182 .IF "$(DEF$(TNR)EXPORT18)"!=""
183 @echo $(DEF$(TNR)EXPORT18) >>$@.tmpfile
184 .ENDIF
185 .IF "$(DEF$(TNR)EXPORT19)"!=""
186 @echo $(DEF$(TNR)EXPORT19) >>$@.tmpfile
187 .ENDIF
188 .IF "$(DEF$(TNR)EXPORT20)"!=""
189 @echo $(DEF$(TNR)EXPORT20) >>$@.tmpfile
190 .ENDIF
191 .IF "$(DEF$(TNR)EXPORTFILE)"!=""
192 .IF "$(COM)"=="GCC"
193 $(COMMAND_ECHO)$(TYPE) $(DEF$(TNR)EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
194 .ELSE
195 $(COMMAND_ECHO)$(TYPE) $(DEF$(TNR)EXPORTFILE) >> $@.tmpfile
196 .ENDIF
197 .ENDIF
198 @-$(RM) $@
199 @$(RENAME) $@.tmpfile $@
200 .ENDIF # "$(GUI)"=="WNT"
202 .IF "$(GUI)"=="OS2"
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) : \
213 $(DEF$(TNR)DEPN) \
214 $(DEF$(TNR)EXPORTFILE)
215 .ELSE # "$(link_always)"==""
216 $(DEF$(TNR)TARGETN) .PHONY :
217 .ENDIF # "$(link_always)"==""
218 @+-$(RM) $@.tmpfile
219 .IF "$(VERBOSE)" == "TRUE"
220 @echo ------------------------------
221 .ENDIF
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
230 .ENDIF
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
239 .ENDIF
240 .IF "$(DEF$(TNR)EXPORT2)"!=""
241 @echo $(DEF$(TNR)EXPORT2) >>$@.tmpfile
242 .ENDIF
243 .IF "$(DEF$(TNR)EXPORT3)"!=""
244 @echo $(DEF$(TNR)EXPORT3) >>$@.tmpfile
245 .ENDIF
246 .IF "$(DEF$(TNR)EXPORT4)"!=""
247 @echo $(DEF$(TNR)EXPORT4) >>$@.tmpfile
248 .ENDIF
249 .IF "$(DEF$(TNR)EXPORT5)"!=""
250 @echo $(DEF$(TNR)EXPORT5) >>$@.tmpfile
251 .ENDIF
252 .IF "$(DEF$(TNR)EXPORT6)"!=""
253 @echo $(DEF$(TNR)EXPORT6) >>$@.tmpfile
254 .ENDIF
255 .IF "$(DEF$(TNR)EXPORT7)"!=""
256 @echo $(DEF$(TNR)EXPORT7) >>$@.tmpfile
257 .ENDIF
258 .IF "$(DEF$(TNR)EXPORT8)"!=""
259 @echo $(DEF$(TNR)EXPORT8) >>$@.tmpfile
260 .ENDIF
261 .IF "$(DEF$(TNR)EXPORT9)"!=""
262 @echo $(DEF$(TNR)EXPORT9) >>$@.tmpfile
263 .ENDIF
264 .IF "$(DEF$(TNR)EXPORT10)"!=""
265 @echo $(DEF$(TNR)EXPORT10) >>$@.tmpfile
266 .ENDIF
267 .IF "$(DEF$(TNR)EXPORT11)"!=""
268 @echo $(DEF$(TNR)EXPORT11) >>$@.tmpfile
269 .ENDIF
270 .IF "$(DEF$(TNR)EXPORT12)"!=""
271 @echo $(DEF$(TNR)EXPORT12) >>$@.tmpfile
272 .ENDIF
273 .IF "$(DEF$(TNR)EXPORT13)"!=""
274 @echo $(DEF$(TNR)EXPORT13) >>$@.tmpfile
275 .ENDIF
276 .IF "$(DEF$(TNR)EXPORT14)"!=""
277 @echo $(DEF$(TNR)EXPORT14) >>$@.tmpfile
278 .ENDIF
279 .IF "$(DEF$(TNR)EXPORT15)"!=""
280 @echo $(DEF$(TNR)EXPORT15) >>$@.tmpfile
281 .ENDIF
282 .IF "$(DEF$(TNR)EXPORT16)"!=""
283 @echo $(DEF$(TNR)EXPORT16) >>$@.tmpfile
284 .ENDIF
285 .IF "$(DEF$(TNR)EXPORT17)"!=""
286 @echo $(DEF$(TNR)EXPORT17) >>$@.tmpfile
287 .ENDIF
288 .IF "$(DEF$(TNR)EXPORT18)"!=""
289 @echo $(DEF$(TNR)EXPORT18) >>$@.tmpfile
290 .ENDIF
291 .IF "$(DEF$(TNR)EXPORT19)"!=""
292 @echo $(DEF$(TNR)EXPORT19) >>$@.tmpfile
293 .ENDIF
294 .IF "$(DEF$(TNR)EXPORT20)"!=""
295 @echo $(DEF$(TNR)EXPORT20) >>$@.tmpfile
296 .ENDIF
297 .IF "$(DEF$(TNR)EXPORTFILE)"!=""
298 @fix_def_file < $(DEF$(TNR)EXPORTFILE) >> $@.tmp_ord
299 .ENDIF
300 @sort < $@.tmp_ord | uniq > $@.exptmpfile
301 @fix_def_ord < $@.exptmpfile >> $@.tmpfile
302 @+-$(RM) $@
303 $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
304 @+-$(RM) $@.tmp_ord
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"
311 .IF "$(GUI)"=="UNX"
312 $(DEF$(TNR)TARGETN): \
313 $(DEF$(TNR)DEPN) \
314 $(DEF$(TNR)EXPORTFILE)
315 @echo just a dummy for UNIX > $@
316 .ENDIF
317 .ENDIF # "$(DEF$(TNR)TARGETN)"!=""
320 # Anweisungen fuer das Linken
321 # unroll end
322 #######################################################