xref: /trunk/main/solenv/inc/_tg_def.mk (revision 8c8d76e1)
1# *************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20# *************************************************************
21# unroll begin
22
23.IF "$(DEF1TARGETN)"!=""
24
25#to make intuitiv naming work
26.IF "$(DEF1LIBNAME)"!=""
27DEFLIB1NAME*=$(DEF1LIBNAME)
28.ENDIF			# "$(DEF1LIBNAME)"!=""
29
30.IF "$(DEFLIB1NAME)"!=""
31DEF1DEPN+=$(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib)
32.ENDIF
33
34.IF "$(SHL1VERSIONMAP)"!=""
35.IF "$(DEF1EXPORTFILE)"==""
36.IF "$(GUI)"=="WNT"
37DEF1EXPORTFILE=$(MISC)/$(SHL1VERSIONMAP:b)_$(SHL1TARGET).dxp
38.IF "$(COM)"=="GCC"
39$(DEF1EXPORTFILE) : $(SHL1OBJS) $(SHL1LIBS)
40.ENDIF # .IF "$(COM)"=="GCC"
41
42$(DEF1EXPORTFILE) : $(SHL1VERSIONMAP)
43	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
44.IF "$(COM)"=="GCC"
45	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
46	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
47# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
48# Extract RTTI symbols from all the objects that will be used to build a shared library
49	$(COMMAND_ECHO)nm -gP $(SHL1OBJS) \
50		`$(TYPE) /dev/null $(foreach,j,$(SHL1LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
51		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
52# overwrite the map file generate into the local output tree with the generated
53# exported symbols list
54	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
55.ENDIF # .IF "$(COM)"=="GCC"
56
57.ENDIF			# "$(GUI)"=="WNT"
58
59.IF "$(GUI)"=="OS2"
60DEF1EXPORTFILE=$(MISC)/$(SHL1VERSIONMAP:b)_$(SHL1TARGET).dxp
61$(DEF1EXPORTFILE) : $(SHL1VERSIONMAP)
62	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
63.ENDIF			# "$(GUI)"=="OS2"
64
65.ENDIF			# "$(DEF1EXPORTFILE)"==""
66.ENDIF			# "$(SHL1VERSIONMAP)"!=""
67
68.IF "$(GUI)"=="WNT"
69
70DEF1FILTER=$(SOLARENV)/inc/dummy.flt
71
72RMHACK1:=$(RM)
73
74.IF "$(DEF1CEXP)"!=""
75EXPORT_ALL_SWITCH=-A $(DEF1CEXP)
76.ENDIF
77
78.IF "$(link_always)"==""
79$(DEF1TARGETN) : \
80		$(DEF1DEPN) \
81		$(DEF1EXPORTFILE)
82.ELSE			# "$(link_always)"==""
83$(DEF1TARGETN) .PHONY :
84.ENDIF			# "$(link_always)"==""
85	@-$(RM) $@.tmpfile
86	@echo "Making:    module definition file" $(@:f)
87	@echo LIBRARY	  $(EMQ)"$(SHL1TARGETN:f)$(EMQ)" 								 >$@.tmpfile
88.IF "$(COM)"!="GCC"
89	@echo HEAPSIZE	  0 											>>$@.tmpfile
90.ENDIF
91	@echo EXPORTS													>>$@.tmpfile
92.IF "$(VERSIONOBJ)"!=""
93#	getversioninfo fuer alle!!
94	@echo GetVersionInfo		>>$@.tmpfile
95.ENDIF
96.IF "$(DEFLIB1NAME)"!=""
97.IF "$(COM)"=="GCC"
98	@-$(RM) $(MISC)/$(SHL1TARGET).exp
99	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL1TARGET).exp --export-all-symbols \
100		`$(TYPE) $(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
101	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL1TARGET).exp | sed '/^;/d' >>$@.tmpfile
102	@-$(RM) $(MISC)/$(SHL1TARGET).exp
103.ELSE
104.IF "$(SHL1USE_EXPORTS)"==""
105	@-$(RMHACK1) $(MISC)/$(SHL1TARGET).exp
106	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL1TARGET).exp $(SLB)/$(DEFLIB1NAME).lib
107	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL1TARGET).flt $(MISC)/$(SHL1TARGET).exp			   >>$@.tmpfile
108	$(COMMAND_ECHO)$(RMHACK1) $(MISC)/$(SHL1TARGET).exp
109.ELSE			# "$(SHL1USE_EXPORTS)"==""
110	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL1TARGET).direct
111	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF1FILTER) $(MISC)/$(SHL1TARGET).direct >>$@.tmpfile
112.ENDIF			# "$(SHL1USE_EXPORTS)"==""
113.ENDIF
114.ENDIF				# "$(DEFLIB1NAME)"!=""
115.IF "$(DEF1EXPORT1)"!=""
116	@echo $(DEF1EXPORT1)										>>$@.tmpfile
117.ENDIF
118.IF "$(DEF1EXPORT2)"!=""
119	@echo $(DEF1EXPORT2)										>>$@.tmpfile
120.ENDIF
121.IF "$(DEF1EXPORT3)"!=""
122	@echo $(DEF1EXPORT3)										>>$@.tmpfile
123.ENDIF
124.IF "$(DEF1EXPORT4)"!=""
125	@echo $(DEF1EXPORT4)										>>$@.tmpfile
126.ENDIF
127.IF "$(DEF1EXPORT5)"!=""
128	@echo $(DEF1EXPORT5)										>>$@.tmpfile
129.ENDIF
130.IF "$(DEF1EXPORT6)"!=""
131	@echo $(DEF1EXPORT6)										>>$@.tmpfile
132.ENDIF
133.IF "$(DEF1EXPORT7)"!=""
134	@echo $(DEF1EXPORT7)										>>$@.tmpfile
135.ENDIF
136.IF "$(DEF1EXPORT8)"!=""
137	@echo $(DEF1EXPORT8)										>>$@.tmpfile
138.ENDIF
139.IF "$(DEF1EXPORT9)"!=""
140	@echo $(DEF1EXPORT9)										>>$@.tmpfile
141.ENDIF
142.IF "$(DEF1EXPORT10)"!=""
143	@echo $(DEF1EXPORT10)										>>$@.tmpfile
144.ENDIF
145.IF "$(DEF1EXPORT11)"!=""
146	@echo $(DEF1EXPORT11)										>>$@.tmpfile
147.ENDIF
148.IF "$(DEF1EXPORT12)"!=""
149	@echo $(DEF1EXPORT12)										>>$@.tmpfile
150.ENDIF
151.IF "$(DEF1EXPORT13)"!=""
152	@echo $(DEF1EXPORT13)										>>$@.tmpfile
153.ENDIF
154.IF "$(DEF1EXPORT14)"!=""
155	@echo $(DEF1EXPORT14)										>>$@.tmpfile
156.ENDIF
157.IF "$(DEF1EXPORT15)"!=""
158	@echo $(DEF1EXPORT15)										>>$@.tmpfile
159.ENDIF
160.IF "$(DEF1EXPORT16)"!=""
161	@echo $(DEF1EXPORT16)										>>$@.tmpfile
162.ENDIF
163.IF "$(DEF1EXPORT17)"!=""
164	@echo $(DEF1EXPORT17)										>>$@.tmpfile
165.ENDIF
166.IF "$(DEF1EXPORT18)"!=""
167	@echo $(DEF1EXPORT18)										>>$@.tmpfile
168.ENDIF
169.IF "$(DEF1EXPORT19)"!=""
170	@echo $(DEF1EXPORT19)										>>$@.tmpfile
171.ENDIF
172.IF "$(DEF1EXPORT20)"!=""
173	@echo $(DEF1EXPORT20)										>>$@.tmpfile
174.ENDIF
175.IF "$(DEF1EXPORTFILE)"!=""
176.IF "$(COM)"=="GCC"
177	$(COMMAND_ECHO)$(TYPE) $(DEF1EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
178.ELSE
179	$(COMMAND_ECHO)$(TYPE) $(DEF1EXPORTFILE) >> $@.tmpfile
180.ENDIF
181.ENDIF
182	@-$(RM) $@
183	@$(RENAME) $@.tmpfile $@
184.ENDIF			# "$(GUI)"=="WNT"
185
186.IF "$(GUI)"=="OS2"
187
188#21/02/2006 YD dll names must be 8.3, invoke fix script
189#check osl/os2/module.c/osl_loadModule()
190SHL1TARGET8=$(shell @fix_shl.cmd $(SHL1TARGETN:f))
191
192DEF1FILTER=$(SOLARENV)/inc/dummy.flt
193DEF1NAMELIST=$(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib)
194
195.IF "$(link_always)"==""
196$(DEF1TARGETN) : \
197		$(DEF1DEPN) \
198		$(DEF1EXPORTFILE)
199.ELSE			# "$(link_always)"==""
200$(DEF1TARGETN) .PHONY :
201.ENDIF			# "$(link_always)"==""
202	@+-$(RM) $@.tmpfile
203	@echo "Making:    module definition file" $(@:f)
204	@echo LIBRARY	  $(SHL1TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
205	@echo DATA MULTIPLE	 >>$@.tmpfile
206	@echo EXPORTS													>>$@.tmpfile
207.IF "$(VERSIONOBJ)"!=""
208#	getversioninfo fuer alle!!
209	@echo _GetVersionInfo		>$@.tmp_ord
210.ENDIF
211
212.IF "$(DEFLIB1NAME)"!=""
213	@+echo $(SLB)/$(DEFLIB1NAME).lib
214	@+emxexp $(DEF1NAMELIST) | fix_exp_file >> $@.tmp_ord
215.ENDIF				# "$(DEFLIB1NAME)"!=""
216
217.IF "$(DEF1EXPORT1)"!=""
218	@echo $(DEF1EXPORT1)										>>$@.tmpfile
219.ENDIF
220.IF "$(DEF1EXPORT2)"!=""
221	@echo $(DEF1EXPORT2)										>>$@.tmpfile
222.ENDIF
223.IF "$(DEF1EXPORT3)"!=""
224	@echo $(DEF1EXPORT3)										>>$@.tmpfile
225.ENDIF
226.IF "$(DEF1EXPORT4)"!=""
227	@echo $(DEF1EXPORT4)										>>$@.tmpfile
228.ENDIF
229.IF "$(DEF1EXPORT5)"!=""
230	@echo $(DEF1EXPORT5)										>>$@.tmpfile
231.ENDIF
232.IF "$(DEF1EXPORT6)"!=""
233	@echo $(DEF1EXPORT6)										>>$@.tmpfile
234.ENDIF
235.IF "$(DEF1EXPORT7)"!=""
236	@echo $(DEF1EXPORT7)										>>$@.tmpfile
237.ENDIF
238.IF "$(DEF1EXPORT8)"!=""
239	@echo $(DEF1EXPORT8)										>>$@.tmpfile
240.ENDIF
241.IF "$(DEF1EXPORT9)"!=""
242	@echo $(DEF1EXPORT9)										>>$@.tmpfile
243.ENDIF
244.IF "$(DEF1EXPORT10)"!=""
245	@echo $(DEF1EXPORT10)										>>$@.tmpfile
246.ENDIF
247.IF "$(DEF1EXPORT11)"!=""
248	@echo $(DEF1EXPORT11)										>>$@.tmpfile
249.ENDIF
250.IF "$(DEF1EXPORT12)"!=""
251	@echo $(DEF1EXPORT12)										>>$@.tmpfile
252.ENDIF
253.IF "$(DEF1EXPORT13)"!=""
254	@echo $(DEF1EXPORT13)										>>$@.tmpfile
255.ENDIF
256.IF "$(DEF1EXPORT14)"!=""
257	@echo $(DEF1EXPORT14)										>>$@.tmpfile
258.ENDIF
259.IF "$(DEF1EXPORT15)"!=""
260	@echo $(DEF1EXPORT15)										>>$@.tmpfile
261.ENDIF
262.IF "$(DEF1EXPORT16)"!=""
263	@echo $(DEF1EXPORT16)										>>$@.tmpfile
264.ENDIF
265.IF "$(DEF1EXPORT17)"!=""
266	@echo $(DEF1EXPORT17)										>>$@.tmpfile
267.ENDIF
268.IF "$(DEF1EXPORT18)"!=""
269	@echo $(DEF1EXPORT18)										>>$@.tmpfile
270.ENDIF
271.IF "$(DEF1EXPORT19)"!=""
272	@echo $(DEF1EXPORT19)										>>$@.tmpfile
273.ENDIF
274.IF "$(DEF1EXPORT20)"!=""
275	@echo $(DEF1EXPORT20)										>>$@.tmpfile
276.ENDIF
277.IF "$(DEF1EXPORTFILE)"!=""
278	@fix_def_file < $(DEF1EXPORTFILE) >> $@.tmp_ord
279.ENDIF
280	@sort < $@.tmp_ord | uniq > $@.exptmpfile
281	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
282	@+-$(RM) $@
283	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
284	@+-$(RM) $@.tmp_ord
285	@+-$(RM) $@.exptmpfile
286.IF "$(SHL1USE_EXPORTS)"=="" || "$(SHL1USE_EXPORTS)"=="ordinal"
287#03/11/2012  if 'name' is not used, export from def file (with ordinals)
288	@echo Build import library from DEF file.
289	@+-$(RM) $(LB)/$(SHL1TARGETN:b).lib
290	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL1TARGETN:b).lib $@
291.ENDIF			# "$(SHL1USE_EXPORTS)"==""
292
293.ENDIF			# "$(GUI)"=="OS2"
294
295.IF "$(GUI)"=="UNX"
296$(DEF1TARGETN): \
297		$(DEF1DEPN) \
298		$(DEF1EXPORTFILE)
299	@echo just a dummy for UNIX > $@
300.ENDIF
301.ENDIF			# "$(DEF1TARGETN)"!=""
302
303
304# Anweisungen fuer das Linken
305# unroll begin
306
307.IF "$(DEF2TARGETN)"!=""
308
309#to make intuitiv naming work
310.IF "$(DEF2LIBNAME)"!=""
311DEFLIB2NAME*=$(DEF2LIBNAME)
312.ENDIF			# "$(DEF2LIBNAME)"!=""
313
314.IF "$(DEFLIB2NAME)"!=""
315DEF2DEPN+=$(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib)
316.ENDIF
317
318.IF "$(SHL2VERSIONMAP)"!=""
319.IF "$(DEF2EXPORTFILE)"==""
320.IF "$(GUI)"=="WNT"
321DEF2EXPORTFILE=$(MISC)/$(SHL2VERSIONMAP:b)_$(SHL2TARGET).dxp
322.IF "$(COM)"=="GCC"
323$(DEF2EXPORTFILE) : $(SHL2OBJS) $(SHL2LIBS)
324.ENDIF # .IF "$(COM)"=="GCC"
325
326$(DEF2EXPORTFILE) : $(SHL2VERSIONMAP)
327	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
328.IF "$(COM)"=="GCC"
329	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
330	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
331# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
332# Extract RTTI symbols from all the objects that will be used to build a shared library
333	$(COMMAND_ECHO)nm -gP $(SHL2OBJS) \
334		`$(TYPE) /dev/null $(foreach,j,$(SHL2LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
335		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
336# overwrite the map file generate into the local output tree with the generated
337# exported symbols list
338	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
339.ENDIF # .IF "$(COM)"=="GCC"
340
341.ENDIF			# "$(GUI)"=="WNT"
342
343.IF "$(GUI)"=="OS2"
344DEF2EXPORTFILE=$(MISC)/$(SHL2VERSIONMAP:b)_$(SHL2TARGET).dxp
345$(DEF2EXPORTFILE) : $(SHL2VERSIONMAP)
346	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
347.ENDIF			# "$(GUI)"=="OS2"
348
349.ENDIF			# "$(DEF2EXPORTFILE)"==""
350.ENDIF			# "$(SHL2VERSIONMAP)"!=""
351
352.IF "$(GUI)"=="WNT"
353
354DEF2FILTER=$(SOLARENV)/inc/dummy.flt
355
356RMHACK2:=$(RM)
357
358.IF "$(DEF2CEXP)"!=""
359EXPORT_ALL_SWITCH=-A $(DEF2CEXP)
360.ENDIF
361
362.IF "$(link_always)"==""
363$(DEF2TARGETN) : \
364		$(DEF2DEPN) \
365		$(DEF2EXPORTFILE)
366.ELSE			# "$(link_always)"==""
367$(DEF2TARGETN) .PHONY :
368.ENDIF			# "$(link_always)"==""
369	@-$(RM) $@.tmpfile
370	@echo "Making:    module definition file" $(@:f)
371	@echo LIBRARY	  $(EMQ)"$(SHL2TARGETN:f)$(EMQ)" 								 >$@.tmpfile
372.IF "$(COM)"!="GCC"
373	@echo HEAPSIZE	  0 											>>$@.tmpfile
374.ENDIF
375	@echo EXPORTS													>>$@.tmpfile
376.IF "$(VERSIONOBJ)"!=""
377#	getversioninfo fuer alle!!
378	@echo GetVersionInfo		>>$@.tmpfile
379.ENDIF
380.IF "$(DEFLIB2NAME)"!=""
381.IF "$(COM)"=="GCC"
382	@-$(RM) $(MISC)/$(SHL2TARGET).exp
383	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL2TARGET).exp --export-all-symbols \
384		`$(TYPE) $(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
385	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL2TARGET).exp | sed '/^;/d' >>$@.tmpfile
386	@-$(RM) $(MISC)/$(SHL2TARGET).exp
387.ELSE
388.IF "$(SHL2USE_EXPORTS)"==""
389	@-$(RMHACK2) $(MISC)/$(SHL2TARGET).exp
390	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL2TARGET).exp $(SLB)/$(DEFLIB2NAME).lib
391	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL2TARGET).flt $(MISC)/$(SHL2TARGET).exp			   >>$@.tmpfile
392	$(COMMAND_ECHO)$(RMHACK2) $(MISC)/$(SHL2TARGET).exp
393.ELSE			# "$(SHL2USE_EXPORTS)"==""
394	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL2TARGET).direct
395	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF2FILTER) $(MISC)/$(SHL2TARGET).direct >>$@.tmpfile
396.ENDIF			# "$(SHL2USE_EXPORTS)"==""
397.ENDIF
398.ENDIF				# "$(DEFLIB2NAME)"!=""
399.IF "$(DEF2EXPORT1)"!=""
400	@echo $(DEF2EXPORT1)										>>$@.tmpfile
401.ENDIF
402.IF "$(DEF2EXPORT2)"!=""
403	@echo $(DEF2EXPORT2)										>>$@.tmpfile
404.ENDIF
405.IF "$(DEF2EXPORT3)"!=""
406	@echo $(DEF2EXPORT3)										>>$@.tmpfile
407.ENDIF
408.IF "$(DEF2EXPORT4)"!=""
409	@echo $(DEF2EXPORT4)										>>$@.tmpfile
410.ENDIF
411.IF "$(DEF2EXPORT5)"!=""
412	@echo $(DEF2EXPORT5)										>>$@.tmpfile
413.ENDIF
414.IF "$(DEF2EXPORT6)"!=""
415	@echo $(DEF2EXPORT6)										>>$@.tmpfile
416.ENDIF
417.IF "$(DEF2EXPORT7)"!=""
418	@echo $(DEF2EXPORT7)										>>$@.tmpfile
419.ENDIF
420.IF "$(DEF2EXPORT8)"!=""
421	@echo $(DEF2EXPORT8)										>>$@.tmpfile
422.ENDIF
423.IF "$(DEF2EXPORT9)"!=""
424	@echo $(DEF2EXPORT9)										>>$@.tmpfile
425.ENDIF
426.IF "$(DEF2EXPORT10)"!=""
427	@echo $(DEF2EXPORT10)										>>$@.tmpfile
428.ENDIF
429.IF "$(DEF2EXPORT11)"!=""
430	@echo $(DEF2EXPORT11)										>>$@.tmpfile
431.ENDIF
432.IF "$(DEF2EXPORT12)"!=""
433	@echo $(DEF2EXPORT12)										>>$@.tmpfile
434.ENDIF
435.IF "$(DEF2EXPORT13)"!=""
436	@echo $(DEF2EXPORT13)										>>$@.tmpfile
437.ENDIF
438.IF "$(DEF2EXPORT14)"!=""
439	@echo $(DEF2EXPORT14)										>>$@.tmpfile
440.ENDIF
441.IF "$(DEF2EXPORT15)"!=""
442	@echo $(DEF2EXPORT15)										>>$@.tmpfile
443.ENDIF
444.IF "$(DEF2EXPORT16)"!=""
445	@echo $(DEF2EXPORT16)										>>$@.tmpfile
446.ENDIF
447.IF "$(DEF2EXPORT17)"!=""
448	@echo $(DEF2EXPORT17)										>>$@.tmpfile
449.ENDIF
450.IF "$(DEF2EXPORT18)"!=""
451	@echo $(DEF2EXPORT18)										>>$@.tmpfile
452.ENDIF
453.IF "$(DEF2EXPORT19)"!=""
454	@echo $(DEF2EXPORT19)										>>$@.tmpfile
455.ENDIF
456.IF "$(DEF2EXPORT20)"!=""
457	@echo $(DEF2EXPORT20)										>>$@.tmpfile
458.ENDIF
459.IF "$(DEF2EXPORTFILE)"!=""
460.IF "$(COM)"=="GCC"
461	$(COMMAND_ECHO)$(TYPE) $(DEF2EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
462.ELSE
463	$(COMMAND_ECHO)$(TYPE) $(DEF2EXPORTFILE) >> $@.tmpfile
464.ENDIF
465.ENDIF
466	@-$(RM) $@
467	@$(RENAME) $@.tmpfile $@
468.ENDIF			# "$(GUI)"=="WNT"
469
470.IF "$(GUI)"=="OS2"
471
472#21/02/2006 YD dll names must be 8.3, invoke fix script
473#check osl/os2/module.c/osl_loadModule()
474SHL2TARGET8=$(shell @fix_shl.cmd $(SHL2TARGETN:f))
475
476DEF2FILTER=$(SOLARENV)/inc/dummy.flt
477DEF2NAMELIST=$(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib)
478
479.IF "$(link_always)"==""
480$(DEF2TARGETN) : \
481		$(DEF2DEPN) \
482		$(DEF2EXPORTFILE)
483.ELSE			# "$(link_always)"==""
484$(DEF2TARGETN) .PHONY :
485.ENDIF			# "$(link_always)"==""
486	@+-$(RM) $@.tmpfile
487	@echo "Making:    module definition file" $(@:f)
488	@echo LIBRARY	  $(SHL2TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
489	@echo DATA MULTIPLE	 >>$@.tmpfile
490	@echo EXPORTS													>>$@.tmpfile
491.IF "$(VERSIONOBJ)"!=""
492#	getversioninfo fuer alle!!
493	@echo _GetVersionInfo		>$@.tmp_ord
494.ENDIF
495
496.IF "$(DEFLIB2NAME)"!=""
497	@+echo $(SLB)/$(DEFLIB2NAME).lib
498	@+emxexp $(DEF2NAMELIST) | fix_exp_file >> $@.tmp_ord
499.ENDIF				# "$(DEFLIB2NAME)"!=""
500
501.IF "$(DEF2EXPORT1)"!=""
502	@echo $(DEF2EXPORT1)										>>$@.tmpfile
503.ENDIF
504.IF "$(DEF2EXPORT2)"!=""
505	@echo $(DEF2EXPORT2)										>>$@.tmpfile
506.ENDIF
507.IF "$(DEF2EXPORT3)"!=""
508	@echo $(DEF2EXPORT3)										>>$@.tmpfile
509.ENDIF
510.IF "$(DEF2EXPORT4)"!=""
511	@echo $(DEF2EXPORT4)										>>$@.tmpfile
512.ENDIF
513.IF "$(DEF2EXPORT5)"!=""
514	@echo $(DEF2EXPORT5)										>>$@.tmpfile
515.ENDIF
516.IF "$(DEF2EXPORT6)"!=""
517	@echo $(DEF2EXPORT6)										>>$@.tmpfile
518.ENDIF
519.IF "$(DEF2EXPORT7)"!=""
520	@echo $(DEF2EXPORT7)										>>$@.tmpfile
521.ENDIF
522.IF "$(DEF2EXPORT8)"!=""
523	@echo $(DEF2EXPORT8)										>>$@.tmpfile
524.ENDIF
525.IF "$(DEF2EXPORT9)"!=""
526	@echo $(DEF2EXPORT9)										>>$@.tmpfile
527.ENDIF
528.IF "$(DEF2EXPORT10)"!=""
529	@echo $(DEF2EXPORT10)										>>$@.tmpfile
530.ENDIF
531.IF "$(DEF2EXPORT11)"!=""
532	@echo $(DEF2EXPORT11)										>>$@.tmpfile
533.ENDIF
534.IF "$(DEF2EXPORT12)"!=""
535	@echo $(DEF2EXPORT12)										>>$@.tmpfile
536.ENDIF
537.IF "$(DEF2EXPORT13)"!=""
538	@echo $(DEF2EXPORT13)										>>$@.tmpfile
539.ENDIF
540.IF "$(DEF2EXPORT14)"!=""
541	@echo $(DEF2EXPORT14)										>>$@.tmpfile
542.ENDIF
543.IF "$(DEF2EXPORT15)"!=""
544	@echo $(DEF2EXPORT15)										>>$@.tmpfile
545.ENDIF
546.IF "$(DEF2EXPORT16)"!=""
547	@echo $(DEF2EXPORT16)										>>$@.tmpfile
548.ENDIF
549.IF "$(DEF2EXPORT17)"!=""
550	@echo $(DEF2EXPORT17)										>>$@.tmpfile
551.ENDIF
552.IF "$(DEF2EXPORT18)"!=""
553	@echo $(DEF2EXPORT18)										>>$@.tmpfile
554.ENDIF
555.IF "$(DEF2EXPORT19)"!=""
556	@echo $(DEF2EXPORT19)										>>$@.tmpfile
557.ENDIF
558.IF "$(DEF2EXPORT20)"!=""
559	@echo $(DEF2EXPORT20)										>>$@.tmpfile
560.ENDIF
561.IF "$(DEF2EXPORTFILE)"!=""
562	@fix_def_file < $(DEF2EXPORTFILE) >> $@.tmp_ord
563.ENDIF
564	@sort < $@.tmp_ord | uniq > $@.exptmpfile
565	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
566	@+-$(RM) $@
567	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
568	@+-$(RM) $@.tmp_ord
569	@+-$(RM) $@.exptmpfile
570.IF "$(SHL2USE_EXPORTS)"=="" || "$(SHL2USE_EXPORTS)"=="ordinal"
571#03/11/2012  if 'name' is not used, export from def file (with ordinals)
572	@echo Build import library from DEF file.
573	@+-$(RM) $(LB)/$(SHL2TARGETN:b).lib
574	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL2TARGETN:b).lib $@
575.ENDIF			# "$(SHL2USE_EXPORTS)"==""
576
577.ENDIF			# "$(GUI)"=="OS2"
578
579.IF "$(GUI)"=="UNX"
580$(DEF2TARGETN): \
581		$(DEF2DEPN) \
582		$(DEF2EXPORTFILE)
583	@echo just a dummy for UNIX > $@
584.ENDIF
585.ENDIF			# "$(DEF2TARGETN)"!=""
586
587
588# Anweisungen fuer das Linken
589# unroll begin
590
591.IF "$(DEF3TARGETN)"!=""
592
593#to make intuitiv naming work
594.IF "$(DEF3LIBNAME)"!=""
595DEFLIB3NAME*=$(DEF3LIBNAME)
596.ENDIF			# "$(DEF3LIBNAME)"!=""
597
598.IF "$(DEFLIB3NAME)"!=""
599DEF3DEPN+=$(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib)
600.ENDIF
601
602.IF "$(SHL3VERSIONMAP)"!=""
603.IF "$(DEF3EXPORTFILE)"==""
604.IF "$(GUI)"=="WNT"
605DEF3EXPORTFILE=$(MISC)/$(SHL3VERSIONMAP:b)_$(SHL3TARGET).dxp
606.IF "$(COM)"=="GCC"
607$(DEF3EXPORTFILE) : $(SHL3OBJS) $(SHL3LIBS)
608.ENDIF # .IF "$(COM)"=="GCC"
609
610$(DEF3EXPORTFILE) : $(SHL3VERSIONMAP)
611	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
612.IF "$(COM)"=="GCC"
613	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
614	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
615# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
616# Extract RTTI symbols from all the objects that will be used to build a shared library
617	$(COMMAND_ECHO)nm -gP $(SHL3OBJS) \
618		`$(TYPE) /dev/null $(foreach,j,$(SHL3LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
619		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
620# overwrite the map file generate into the local output tree with the generated
621# exported symbols list
622	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
623.ENDIF # .IF "$(COM)"=="GCC"
624
625.ENDIF			# "$(GUI)"=="WNT"
626
627.IF "$(GUI)"=="OS2"
628DEF3EXPORTFILE=$(MISC)/$(SHL3VERSIONMAP:b)_$(SHL3TARGET).dxp
629$(DEF3EXPORTFILE) : $(SHL3VERSIONMAP)
630	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
631.ENDIF			# "$(GUI)"=="OS2"
632
633.ENDIF			# "$(DEF3EXPORTFILE)"==""
634.ENDIF			# "$(SHL3VERSIONMAP)"!=""
635
636.IF "$(GUI)"=="WNT"
637
638DEF3FILTER=$(SOLARENV)/inc/dummy.flt
639
640RMHACK3:=$(RM)
641
642.IF "$(DEF3CEXP)"!=""
643EXPORT_ALL_SWITCH=-A $(DEF3CEXP)
644.ENDIF
645
646.IF "$(link_always)"==""
647$(DEF3TARGETN) : \
648		$(DEF3DEPN) \
649		$(DEF3EXPORTFILE)
650.ELSE			# "$(link_always)"==""
651$(DEF3TARGETN) .PHONY :
652.ENDIF			# "$(link_always)"==""
653	@-$(RM) $@.tmpfile
654	@echo "Making:    module definition file" $(@:f)
655	@echo LIBRARY	  $(EMQ)"$(SHL3TARGETN:f)$(EMQ)" 								 >$@.tmpfile
656.IF "$(COM)"!="GCC"
657	@echo HEAPSIZE	  0 											>>$@.tmpfile
658.ENDIF
659	@echo EXPORTS													>>$@.tmpfile
660.IF "$(VERSIONOBJ)"!=""
661#	getversioninfo fuer alle!!
662	@echo GetVersionInfo		>>$@.tmpfile
663.ENDIF
664.IF "$(DEFLIB3NAME)"!=""
665.IF "$(COM)"=="GCC"
666	@-$(RM) $(MISC)/$(SHL3TARGET).exp
667	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL3TARGET).exp --export-all-symbols \
668		`$(TYPE) $(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
669	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL3TARGET).exp | sed '/^;/d' >>$@.tmpfile
670	@-$(RM) $(MISC)/$(SHL3TARGET).exp
671.ELSE
672.IF "$(SHL3USE_EXPORTS)"==""
673	@-$(RMHACK3) $(MISC)/$(SHL3TARGET).exp
674	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL3TARGET).exp $(SLB)/$(DEFLIB3NAME).lib
675	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL3TARGET).flt $(MISC)/$(SHL3TARGET).exp			   >>$@.tmpfile
676	$(COMMAND_ECHO)$(RMHACK3) $(MISC)/$(SHL3TARGET).exp
677.ELSE			# "$(SHL3USE_EXPORTS)"==""
678	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL3TARGET).direct
679	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF3FILTER) $(MISC)/$(SHL3TARGET).direct >>$@.tmpfile
680.ENDIF			# "$(SHL3USE_EXPORTS)"==""
681.ENDIF
682.ENDIF				# "$(DEFLIB3NAME)"!=""
683.IF "$(DEF3EXPORT1)"!=""
684	@echo $(DEF3EXPORT1)										>>$@.tmpfile
685.ENDIF
686.IF "$(DEF3EXPORT2)"!=""
687	@echo $(DEF3EXPORT2)										>>$@.tmpfile
688.ENDIF
689.IF "$(DEF3EXPORT3)"!=""
690	@echo $(DEF3EXPORT3)										>>$@.tmpfile
691.ENDIF
692.IF "$(DEF3EXPORT4)"!=""
693	@echo $(DEF3EXPORT4)										>>$@.tmpfile
694.ENDIF
695.IF "$(DEF3EXPORT5)"!=""
696	@echo $(DEF3EXPORT5)										>>$@.tmpfile
697.ENDIF
698.IF "$(DEF3EXPORT6)"!=""
699	@echo $(DEF3EXPORT6)										>>$@.tmpfile
700.ENDIF
701.IF "$(DEF3EXPORT7)"!=""
702	@echo $(DEF3EXPORT7)										>>$@.tmpfile
703.ENDIF
704.IF "$(DEF3EXPORT8)"!=""
705	@echo $(DEF3EXPORT8)										>>$@.tmpfile
706.ENDIF
707.IF "$(DEF3EXPORT9)"!=""
708	@echo $(DEF3EXPORT9)										>>$@.tmpfile
709.ENDIF
710.IF "$(DEF3EXPORT10)"!=""
711	@echo $(DEF3EXPORT10)										>>$@.tmpfile
712.ENDIF
713.IF "$(DEF3EXPORT11)"!=""
714	@echo $(DEF3EXPORT11)										>>$@.tmpfile
715.ENDIF
716.IF "$(DEF3EXPORT12)"!=""
717	@echo $(DEF3EXPORT12)										>>$@.tmpfile
718.ENDIF
719.IF "$(DEF3EXPORT13)"!=""
720	@echo $(DEF3EXPORT13)										>>$@.tmpfile
721.ENDIF
722.IF "$(DEF3EXPORT14)"!=""
723	@echo $(DEF3EXPORT14)										>>$@.tmpfile
724.ENDIF
725.IF "$(DEF3EXPORT15)"!=""
726	@echo $(DEF3EXPORT15)										>>$@.tmpfile
727.ENDIF
728.IF "$(DEF3EXPORT16)"!=""
729	@echo $(DEF3EXPORT16)										>>$@.tmpfile
730.ENDIF
731.IF "$(DEF3EXPORT17)"!=""
732	@echo $(DEF3EXPORT17)										>>$@.tmpfile
733.ENDIF
734.IF "$(DEF3EXPORT18)"!=""
735	@echo $(DEF3EXPORT18)										>>$@.tmpfile
736.ENDIF
737.IF "$(DEF3EXPORT19)"!=""
738	@echo $(DEF3EXPORT19)										>>$@.tmpfile
739.ENDIF
740.IF "$(DEF3EXPORT20)"!=""
741	@echo $(DEF3EXPORT20)										>>$@.tmpfile
742.ENDIF
743.IF "$(DEF3EXPORTFILE)"!=""
744.IF "$(COM)"=="GCC"
745	$(COMMAND_ECHO)$(TYPE) $(DEF3EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
746.ELSE
747	$(COMMAND_ECHO)$(TYPE) $(DEF3EXPORTFILE) >> $@.tmpfile
748.ENDIF
749.ENDIF
750	@-$(RM) $@
751	@$(RENAME) $@.tmpfile $@
752.ENDIF			# "$(GUI)"=="WNT"
753
754.IF "$(GUI)"=="OS2"
755
756#21/02/2006 YD dll names must be 8.3, invoke fix script
757#check osl/os2/module.c/osl_loadModule()
758SHL3TARGET8=$(shell @fix_shl.cmd $(SHL3TARGETN:f))
759
760DEF3FILTER=$(SOLARENV)/inc/dummy.flt
761DEF3NAMELIST=$(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib)
762
763.IF "$(link_always)"==""
764$(DEF3TARGETN) : \
765		$(DEF3DEPN) \
766		$(DEF3EXPORTFILE)
767.ELSE			# "$(link_always)"==""
768$(DEF3TARGETN) .PHONY :
769.ENDIF			# "$(link_always)"==""
770	@+-$(RM) $@.tmpfile
771	@echo "Making:    module definition file" $(@:f)
772	@echo LIBRARY	  $(SHL3TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
773	@echo DATA MULTIPLE	 >>$@.tmpfile
774	@echo EXPORTS													>>$@.tmpfile
775.IF "$(VERSIONOBJ)"!=""
776#	getversioninfo fuer alle!!
777	@echo _GetVersionInfo		>$@.tmp_ord
778.ENDIF
779
780.IF "$(DEFLIB3NAME)"!=""
781	@+echo $(SLB)/$(DEFLIB3NAME).lib
782	@+emxexp $(DEF3NAMELIST) | fix_exp_file >> $@.tmp_ord
783.ENDIF				# "$(DEFLIB3NAME)"!=""
784
785.IF "$(DEF3EXPORT1)"!=""
786	@echo $(DEF3EXPORT1)										>>$@.tmpfile
787.ENDIF
788.IF "$(DEF3EXPORT2)"!=""
789	@echo $(DEF3EXPORT2)										>>$@.tmpfile
790.ENDIF
791.IF "$(DEF3EXPORT3)"!=""
792	@echo $(DEF3EXPORT3)										>>$@.tmpfile
793.ENDIF
794.IF "$(DEF3EXPORT4)"!=""
795	@echo $(DEF3EXPORT4)										>>$@.tmpfile
796.ENDIF
797.IF "$(DEF3EXPORT5)"!=""
798	@echo $(DEF3EXPORT5)										>>$@.tmpfile
799.ENDIF
800.IF "$(DEF3EXPORT6)"!=""
801	@echo $(DEF3EXPORT6)										>>$@.tmpfile
802.ENDIF
803.IF "$(DEF3EXPORT7)"!=""
804	@echo $(DEF3EXPORT7)										>>$@.tmpfile
805.ENDIF
806.IF "$(DEF3EXPORT8)"!=""
807	@echo $(DEF3EXPORT8)										>>$@.tmpfile
808.ENDIF
809.IF "$(DEF3EXPORT9)"!=""
810	@echo $(DEF3EXPORT9)										>>$@.tmpfile
811.ENDIF
812.IF "$(DEF3EXPORT10)"!=""
813	@echo $(DEF3EXPORT10)										>>$@.tmpfile
814.ENDIF
815.IF "$(DEF3EXPORT11)"!=""
816	@echo $(DEF3EXPORT11)										>>$@.tmpfile
817.ENDIF
818.IF "$(DEF3EXPORT12)"!=""
819	@echo $(DEF3EXPORT12)										>>$@.tmpfile
820.ENDIF
821.IF "$(DEF3EXPORT13)"!=""
822	@echo $(DEF3EXPORT13)										>>$@.tmpfile
823.ENDIF
824.IF "$(DEF3EXPORT14)"!=""
825	@echo $(DEF3EXPORT14)										>>$@.tmpfile
826.ENDIF
827.IF "$(DEF3EXPORT15)"!=""
828	@echo $(DEF3EXPORT15)										>>$@.tmpfile
829.ENDIF
830.IF "$(DEF3EXPORT16)"!=""
831	@echo $(DEF3EXPORT16)										>>$@.tmpfile
832.ENDIF
833.IF "$(DEF3EXPORT17)"!=""
834	@echo $(DEF3EXPORT17)										>>$@.tmpfile
835.ENDIF
836.IF "$(DEF3EXPORT18)"!=""
837	@echo $(DEF3EXPORT18)										>>$@.tmpfile
838.ENDIF
839.IF "$(DEF3EXPORT19)"!=""
840	@echo $(DEF3EXPORT19)										>>$@.tmpfile
841.ENDIF
842.IF "$(DEF3EXPORT20)"!=""
843	@echo $(DEF3EXPORT20)										>>$@.tmpfile
844.ENDIF
845.IF "$(DEF3EXPORTFILE)"!=""
846	@fix_def_file < $(DEF3EXPORTFILE) >> $@.tmp_ord
847.ENDIF
848	@sort < $@.tmp_ord | uniq > $@.exptmpfile
849	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
850	@+-$(RM) $@
851	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
852	@+-$(RM) $@.tmp_ord
853	@+-$(RM) $@.exptmpfile
854.IF "$(SHL3USE_EXPORTS)"=="" || "$(SHL3USE_EXPORTS)"=="ordinal"
855#03/11/2012  if 'name' is not used, export from def file (with ordinals)
856	@echo Build import library from DEF file.
857	@+-$(RM) $(LB)/$(SHL3TARGETN:b).lib
858	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL3TARGETN:b).lib $@
859.ENDIF			# "$(SHL3USE_EXPORTS)"==""
860
861.ENDIF			# "$(GUI)"=="OS2"
862
863.IF "$(GUI)"=="UNX"
864$(DEF3TARGETN): \
865		$(DEF3DEPN) \
866		$(DEF3EXPORTFILE)
867	@echo just a dummy for UNIX > $@
868.ENDIF
869.ENDIF			# "$(DEF3TARGETN)"!=""
870
871
872# Anweisungen fuer das Linken
873# unroll begin
874
875.IF "$(DEF4TARGETN)"!=""
876
877#to make intuitiv naming work
878.IF "$(DEF4LIBNAME)"!=""
879DEFLIB4NAME*=$(DEF4LIBNAME)
880.ENDIF			# "$(DEF4LIBNAME)"!=""
881
882.IF "$(DEFLIB4NAME)"!=""
883DEF4DEPN+=$(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib)
884.ENDIF
885
886.IF "$(SHL4VERSIONMAP)"!=""
887.IF "$(DEF4EXPORTFILE)"==""
888.IF "$(GUI)"=="WNT"
889DEF4EXPORTFILE=$(MISC)/$(SHL4VERSIONMAP:b)_$(SHL4TARGET).dxp
890.IF "$(COM)"=="GCC"
891$(DEF4EXPORTFILE) : $(SHL4OBJS) $(SHL4LIBS)
892.ENDIF # .IF "$(COM)"=="GCC"
893
894$(DEF4EXPORTFILE) : $(SHL4VERSIONMAP)
895	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
896.IF "$(COM)"=="GCC"
897	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
898	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
899# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
900# Extract RTTI symbols from all the objects that will be used to build a shared library
901	$(COMMAND_ECHO)nm -gP $(SHL4OBJS) \
902		`$(TYPE) /dev/null $(foreach,j,$(SHL4LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
903		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
904# overwrite the map file generate into the local output tree with the generated
905# exported symbols list
906	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
907.ENDIF # .IF "$(COM)"=="GCC"
908
909.ENDIF			# "$(GUI)"=="WNT"
910
911.IF "$(GUI)"=="OS2"
912DEF4EXPORTFILE=$(MISC)/$(SHL4VERSIONMAP:b)_$(SHL4TARGET).dxp
913$(DEF4EXPORTFILE) : $(SHL4VERSIONMAP)
914	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
915.ENDIF			# "$(GUI)"=="OS2"
916
917.ENDIF			# "$(DEF4EXPORTFILE)"==""
918.ENDIF			# "$(SHL4VERSIONMAP)"!=""
919
920.IF "$(GUI)"=="WNT"
921
922DEF4FILTER=$(SOLARENV)/inc/dummy.flt
923
924RMHACK4:=$(RM)
925
926.IF "$(DEF4CEXP)"!=""
927EXPORT_ALL_SWITCH=-A $(DEF4CEXP)
928.ENDIF
929
930.IF "$(link_always)"==""
931$(DEF4TARGETN) : \
932		$(DEF4DEPN) \
933		$(DEF4EXPORTFILE)
934.ELSE			# "$(link_always)"==""
935$(DEF4TARGETN) .PHONY :
936.ENDIF			# "$(link_always)"==""
937	@-$(RM) $@.tmpfile
938	@echo "Making:    module definition file" $(@:f)
939	@echo LIBRARY	  $(EMQ)"$(SHL4TARGETN:f)$(EMQ)" 								 >$@.tmpfile
940.IF "$(COM)"!="GCC"
941	@echo HEAPSIZE	  0 											>>$@.tmpfile
942.ENDIF
943	@echo EXPORTS													>>$@.tmpfile
944.IF "$(VERSIONOBJ)"!=""
945#	getversioninfo fuer alle!!
946	@echo GetVersionInfo		>>$@.tmpfile
947.ENDIF
948.IF "$(DEFLIB4NAME)"!=""
949.IF "$(COM)"=="GCC"
950	@-$(RM) $(MISC)/$(SHL4TARGET).exp
951	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL4TARGET).exp --export-all-symbols \
952		`$(TYPE) $(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
953	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL4TARGET).exp | sed '/^;/d' >>$@.tmpfile
954	@-$(RM) $(MISC)/$(SHL4TARGET).exp
955.ELSE
956.IF "$(SHL4USE_EXPORTS)"==""
957	@-$(RMHACK4) $(MISC)/$(SHL4TARGET).exp
958	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL4TARGET).exp $(SLB)/$(DEFLIB4NAME).lib
959	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL4TARGET).flt $(MISC)/$(SHL4TARGET).exp			   >>$@.tmpfile
960	$(COMMAND_ECHO)$(RMHACK4) $(MISC)/$(SHL4TARGET).exp
961.ELSE			# "$(SHL4USE_EXPORTS)"==""
962	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL4TARGET).direct
963	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF4FILTER) $(MISC)/$(SHL4TARGET).direct >>$@.tmpfile
964.ENDIF			# "$(SHL4USE_EXPORTS)"==""
965.ENDIF
966.ENDIF				# "$(DEFLIB4NAME)"!=""
967.IF "$(DEF4EXPORT1)"!=""
968	@echo $(DEF4EXPORT1)										>>$@.tmpfile
969.ENDIF
970.IF "$(DEF4EXPORT2)"!=""
971	@echo $(DEF4EXPORT2)										>>$@.tmpfile
972.ENDIF
973.IF "$(DEF4EXPORT3)"!=""
974	@echo $(DEF4EXPORT3)										>>$@.tmpfile
975.ENDIF
976.IF "$(DEF4EXPORT4)"!=""
977	@echo $(DEF4EXPORT4)										>>$@.tmpfile
978.ENDIF
979.IF "$(DEF4EXPORT5)"!=""
980	@echo $(DEF4EXPORT5)										>>$@.tmpfile
981.ENDIF
982.IF "$(DEF4EXPORT6)"!=""
983	@echo $(DEF4EXPORT6)										>>$@.tmpfile
984.ENDIF
985.IF "$(DEF4EXPORT7)"!=""
986	@echo $(DEF4EXPORT7)										>>$@.tmpfile
987.ENDIF
988.IF "$(DEF4EXPORT8)"!=""
989	@echo $(DEF4EXPORT8)										>>$@.tmpfile
990.ENDIF
991.IF "$(DEF4EXPORT9)"!=""
992	@echo $(DEF4EXPORT9)										>>$@.tmpfile
993.ENDIF
994.IF "$(DEF4EXPORT10)"!=""
995	@echo $(DEF4EXPORT10)										>>$@.tmpfile
996.ENDIF
997.IF "$(DEF4EXPORT11)"!=""
998	@echo $(DEF4EXPORT11)										>>$@.tmpfile
999.ENDIF
1000.IF "$(DEF4EXPORT12)"!=""
1001	@echo $(DEF4EXPORT12)										>>$@.tmpfile
1002.ENDIF
1003.IF "$(DEF4EXPORT13)"!=""
1004	@echo $(DEF4EXPORT13)										>>$@.tmpfile
1005.ENDIF
1006.IF "$(DEF4EXPORT14)"!=""
1007	@echo $(DEF4EXPORT14)										>>$@.tmpfile
1008.ENDIF
1009.IF "$(DEF4EXPORT15)"!=""
1010	@echo $(DEF4EXPORT15)										>>$@.tmpfile
1011.ENDIF
1012.IF "$(DEF4EXPORT16)"!=""
1013	@echo $(DEF4EXPORT16)										>>$@.tmpfile
1014.ENDIF
1015.IF "$(DEF4EXPORT17)"!=""
1016	@echo $(DEF4EXPORT17)										>>$@.tmpfile
1017.ENDIF
1018.IF "$(DEF4EXPORT18)"!=""
1019	@echo $(DEF4EXPORT18)										>>$@.tmpfile
1020.ENDIF
1021.IF "$(DEF4EXPORT19)"!=""
1022	@echo $(DEF4EXPORT19)										>>$@.tmpfile
1023.ENDIF
1024.IF "$(DEF4EXPORT20)"!=""
1025	@echo $(DEF4EXPORT20)										>>$@.tmpfile
1026.ENDIF
1027.IF "$(DEF4EXPORTFILE)"!=""
1028.IF "$(COM)"=="GCC"
1029	$(COMMAND_ECHO)$(TYPE) $(DEF4EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
1030.ELSE
1031	$(COMMAND_ECHO)$(TYPE) $(DEF4EXPORTFILE) >> $@.tmpfile
1032.ENDIF
1033.ENDIF
1034	@-$(RM) $@
1035	@$(RENAME) $@.tmpfile $@
1036.ENDIF			# "$(GUI)"=="WNT"
1037
1038.IF "$(GUI)"=="OS2"
1039
1040#21/02/2006 YD dll names must be 8.3, invoke fix script
1041#check osl/os2/module.c/osl_loadModule()
1042SHL4TARGET8=$(shell @fix_shl.cmd $(SHL4TARGETN:f))
1043
1044DEF4FILTER=$(SOLARENV)/inc/dummy.flt
1045DEF4NAMELIST=$(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib)
1046
1047.IF "$(link_always)"==""
1048$(DEF4TARGETN) : \
1049		$(DEF4DEPN) \
1050		$(DEF4EXPORTFILE)
1051.ELSE			# "$(link_always)"==""
1052$(DEF4TARGETN) .PHONY :
1053.ENDIF			# "$(link_always)"==""
1054	@+-$(RM) $@.tmpfile
1055	@echo "Making:    module definition file" $(@:f)
1056	@echo LIBRARY	  $(SHL4TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
1057	@echo DATA MULTIPLE	 >>$@.tmpfile
1058	@echo EXPORTS													>>$@.tmpfile
1059.IF "$(VERSIONOBJ)"!=""
1060#	getversioninfo fuer alle!!
1061	@echo _GetVersionInfo		>$@.tmp_ord
1062.ENDIF
1063
1064.IF "$(DEFLIB4NAME)"!=""
1065	@+echo $(SLB)/$(DEFLIB4NAME).lib
1066	@+emxexp $(DEF4NAMELIST) | fix_exp_file >> $@.tmp_ord
1067.ENDIF				# "$(DEFLIB4NAME)"!=""
1068
1069.IF "$(DEF4EXPORT1)"!=""
1070	@echo $(DEF4EXPORT1)										>>$@.tmpfile
1071.ENDIF
1072.IF "$(DEF4EXPORT2)"!=""
1073	@echo $(DEF4EXPORT2)										>>$@.tmpfile
1074.ENDIF
1075.IF "$(DEF4EXPORT3)"!=""
1076	@echo $(DEF4EXPORT3)										>>$@.tmpfile
1077.ENDIF
1078.IF "$(DEF4EXPORT4)"!=""
1079	@echo $(DEF4EXPORT4)										>>$@.tmpfile
1080.ENDIF
1081.IF "$(DEF4EXPORT5)"!=""
1082	@echo $(DEF4EXPORT5)										>>$@.tmpfile
1083.ENDIF
1084.IF "$(DEF4EXPORT6)"!=""
1085	@echo $(DEF4EXPORT6)										>>$@.tmpfile
1086.ENDIF
1087.IF "$(DEF4EXPORT7)"!=""
1088	@echo $(DEF4EXPORT7)										>>$@.tmpfile
1089.ENDIF
1090.IF "$(DEF4EXPORT8)"!=""
1091	@echo $(DEF4EXPORT8)										>>$@.tmpfile
1092.ENDIF
1093.IF "$(DEF4EXPORT9)"!=""
1094	@echo $(DEF4EXPORT9)										>>$@.tmpfile
1095.ENDIF
1096.IF "$(DEF4EXPORT10)"!=""
1097	@echo $(DEF4EXPORT10)										>>$@.tmpfile
1098.ENDIF
1099.IF "$(DEF4EXPORT11)"!=""
1100	@echo $(DEF4EXPORT11)										>>$@.tmpfile
1101.ENDIF
1102.IF "$(DEF4EXPORT12)"!=""
1103	@echo $(DEF4EXPORT12)										>>$@.tmpfile
1104.ENDIF
1105.IF "$(DEF4EXPORT13)"!=""
1106	@echo $(DEF4EXPORT13)										>>$@.tmpfile
1107.ENDIF
1108.IF "$(DEF4EXPORT14)"!=""
1109	@echo $(DEF4EXPORT14)										>>$@.tmpfile
1110.ENDIF
1111.IF "$(DEF4EXPORT15)"!=""
1112	@echo $(DEF4EXPORT15)										>>$@.tmpfile
1113.ENDIF
1114.IF "$(DEF4EXPORT16)"!=""
1115	@echo $(DEF4EXPORT16)										>>$@.tmpfile
1116.ENDIF
1117.IF "$(DEF4EXPORT17)"!=""
1118	@echo $(DEF4EXPORT17)										>>$@.tmpfile
1119.ENDIF
1120.IF "$(DEF4EXPORT18)"!=""
1121	@echo $(DEF4EXPORT18)										>>$@.tmpfile
1122.ENDIF
1123.IF "$(DEF4EXPORT19)"!=""
1124	@echo $(DEF4EXPORT19)										>>$@.tmpfile
1125.ENDIF
1126.IF "$(DEF4EXPORT20)"!=""
1127	@echo $(DEF4EXPORT20)										>>$@.tmpfile
1128.ENDIF
1129.IF "$(DEF4EXPORTFILE)"!=""
1130	@fix_def_file < $(DEF4EXPORTFILE) >> $@.tmp_ord
1131.ENDIF
1132	@sort < $@.tmp_ord | uniq > $@.exptmpfile
1133	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
1134	@+-$(RM) $@
1135	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
1136	@+-$(RM) $@.tmp_ord
1137	@+-$(RM) $@.exptmpfile
1138.IF "$(SHL4USE_EXPORTS)"=="" || "$(SHL4USE_EXPORTS)"=="ordinal"
1139#03/11/2012  if 'name' is not used, export from def file (with ordinals)
1140	@echo Build import library from DEF file.
1141	@+-$(RM) $(LB)/$(SHL4TARGETN:b).lib
1142	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL4TARGETN:b).lib $@
1143.ENDIF			# "$(SHL4USE_EXPORTS)"==""
1144
1145.ENDIF			# "$(GUI)"=="OS2"
1146
1147.IF "$(GUI)"=="UNX"
1148$(DEF4TARGETN): \
1149		$(DEF4DEPN) \
1150		$(DEF4EXPORTFILE)
1151	@echo just a dummy for UNIX > $@
1152.ENDIF
1153.ENDIF			# "$(DEF4TARGETN)"!=""
1154
1155
1156# Anweisungen fuer das Linken
1157# unroll begin
1158
1159.IF "$(DEF5TARGETN)"!=""
1160
1161#to make intuitiv naming work
1162.IF "$(DEF5LIBNAME)"!=""
1163DEFLIB5NAME*=$(DEF5LIBNAME)
1164.ENDIF			# "$(DEF5LIBNAME)"!=""
1165
1166.IF "$(DEFLIB5NAME)"!=""
1167DEF5DEPN+=$(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib)
1168.ENDIF
1169
1170.IF "$(SHL5VERSIONMAP)"!=""
1171.IF "$(DEF5EXPORTFILE)"==""
1172.IF "$(GUI)"=="WNT"
1173DEF5EXPORTFILE=$(MISC)/$(SHL5VERSIONMAP:b)_$(SHL5TARGET).dxp
1174.IF "$(COM)"=="GCC"
1175$(DEF5EXPORTFILE) : $(SHL5OBJS) $(SHL5LIBS)
1176.ENDIF # .IF "$(COM)"=="GCC"
1177
1178$(DEF5EXPORTFILE) : $(SHL5VERSIONMAP)
1179	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
1180.IF "$(COM)"=="GCC"
1181	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
1182	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
1183# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
1184# Extract RTTI symbols from all the objects that will be used to build a shared library
1185	$(COMMAND_ECHO)nm -gP $(SHL5OBJS) \
1186		`$(TYPE) /dev/null $(foreach,j,$(SHL5LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
1187		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
1188# overwrite the map file generate into the local output tree with the generated
1189# exported symbols list
1190	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
1191.ENDIF # .IF "$(COM)"=="GCC"
1192
1193.ENDIF			# "$(GUI)"=="WNT"
1194
1195.IF "$(GUI)"=="OS2"
1196DEF5EXPORTFILE=$(MISC)/$(SHL5VERSIONMAP:b)_$(SHL5TARGET).dxp
1197$(DEF5EXPORTFILE) : $(SHL5VERSIONMAP)
1198	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
1199.ENDIF			# "$(GUI)"=="OS2"
1200
1201.ENDIF			# "$(DEF5EXPORTFILE)"==""
1202.ENDIF			# "$(SHL5VERSIONMAP)"!=""
1203
1204.IF "$(GUI)"=="WNT"
1205
1206DEF5FILTER=$(SOLARENV)/inc/dummy.flt
1207
1208RMHACK5:=$(RM)
1209
1210.IF "$(DEF5CEXP)"!=""
1211EXPORT_ALL_SWITCH=-A $(DEF5CEXP)
1212.ENDIF
1213
1214.IF "$(link_always)"==""
1215$(DEF5TARGETN) : \
1216		$(DEF5DEPN) \
1217		$(DEF5EXPORTFILE)
1218.ELSE			# "$(link_always)"==""
1219$(DEF5TARGETN) .PHONY :
1220.ENDIF			# "$(link_always)"==""
1221	@-$(RM) $@.tmpfile
1222	@echo "Making:    module definition file" $(@:f)
1223	@echo LIBRARY	  $(EMQ)"$(SHL5TARGETN:f)$(EMQ)" 								 >$@.tmpfile
1224.IF "$(COM)"!="GCC"
1225	@echo HEAPSIZE	  0 											>>$@.tmpfile
1226.ENDIF
1227	@echo EXPORTS													>>$@.tmpfile
1228.IF "$(VERSIONOBJ)"!=""
1229#	getversioninfo fuer alle!!
1230	@echo GetVersionInfo		>>$@.tmpfile
1231.ENDIF
1232.IF "$(DEFLIB5NAME)"!=""
1233.IF "$(COM)"=="GCC"
1234	@-$(RM) $(MISC)/$(SHL5TARGET).exp
1235	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL5TARGET).exp --export-all-symbols \
1236		`$(TYPE) $(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
1237	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL5TARGET).exp | sed '/^;/d' >>$@.tmpfile
1238	@-$(RM) $(MISC)/$(SHL5TARGET).exp
1239.ELSE
1240.IF "$(SHL5USE_EXPORTS)"==""
1241	@-$(RMHACK5) $(MISC)/$(SHL5TARGET).exp
1242	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL5TARGET).exp $(SLB)/$(DEFLIB5NAME).lib
1243	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL5TARGET).flt $(MISC)/$(SHL5TARGET).exp			   >>$@.tmpfile
1244	$(COMMAND_ECHO)$(RMHACK5) $(MISC)/$(SHL5TARGET).exp
1245.ELSE			# "$(SHL5USE_EXPORTS)"==""
1246	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL5TARGET).direct
1247	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF5FILTER) $(MISC)/$(SHL5TARGET).direct >>$@.tmpfile
1248.ENDIF			# "$(SHL5USE_EXPORTS)"==""
1249.ENDIF
1250.ENDIF				# "$(DEFLIB5NAME)"!=""
1251.IF "$(DEF5EXPORT1)"!=""
1252	@echo $(DEF5EXPORT1)										>>$@.tmpfile
1253.ENDIF
1254.IF "$(DEF5EXPORT2)"!=""
1255	@echo $(DEF5EXPORT2)										>>$@.tmpfile
1256.ENDIF
1257.IF "$(DEF5EXPORT3)"!=""
1258	@echo $(DEF5EXPORT3)										>>$@.tmpfile
1259.ENDIF
1260.IF "$(DEF5EXPORT4)"!=""
1261	@echo $(DEF5EXPORT4)										>>$@.tmpfile
1262.ENDIF
1263.IF "$(DEF5EXPORT5)"!=""
1264	@echo $(DEF5EXPORT5)										>>$@.tmpfile
1265.ENDIF
1266.IF "$(DEF5EXPORT6)"!=""
1267	@echo $(DEF5EXPORT6)										>>$@.tmpfile
1268.ENDIF
1269.IF "$(DEF5EXPORT7)"!=""
1270	@echo $(DEF5EXPORT7)										>>$@.tmpfile
1271.ENDIF
1272.IF "$(DEF5EXPORT8)"!=""
1273	@echo $(DEF5EXPORT8)										>>$@.tmpfile
1274.ENDIF
1275.IF "$(DEF5EXPORT9)"!=""
1276	@echo $(DEF5EXPORT9)										>>$@.tmpfile
1277.ENDIF
1278.IF "$(DEF5EXPORT10)"!=""
1279	@echo $(DEF5EXPORT10)										>>$@.tmpfile
1280.ENDIF
1281.IF "$(DEF5EXPORT11)"!=""
1282	@echo $(DEF5EXPORT11)										>>$@.tmpfile
1283.ENDIF
1284.IF "$(DEF5EXPORT12)"!=""
1285	@echo $(DEF5EXPORT12)										>>$@.tmpfile
1286.ENDIF
1287.IF "$(DEF5EXPORT13)"!=""
1288	@echo $(DEF5EXPORT13)										>>$@.tmpfile
1289.ENDIF
1290.IF "$(DEF5EXPORT14)"!=""
1291	@echo $(DEF5EXPORT14)										>>$@.tmpfile
1292.ENDIF
1293.IF "$(DEF5EXPORT15)"!=""
1294	@echo $(DEF5EXPORT15)										>>$@.tmpfile
1295.ENDIF
1296.IF "$(DEF5EXPORT16)"!=""
1297	@echo $(DEF5EXPORT16)										>>$@.tmpfile
1298.ENDIF
1299.IF "$(DEF5EXPORT17)"!=""
1300	@echo $(DEF5EXPORT17)										>>$@.tmpfile
1301.ENDIF
1302.IF "$(DEF5EXPORT18)"!=""
1303	@echo $(DEF5EXPORT18)										>>$@.tmpfile
1304.ENDIF
1305.IF "$(DEF5EXPORT19)"!=""
1306	@echo $(DEF5EXPORT19)										>>$@.tmpfile
1307.ENDIF
1308.IF "$(DEF5EXPORT20)"!=""
1309	@echo $(DEF5EXPORT20)										>>$@.tmpfile
1310.ENDIF
1311.IF "$(DEF5EXPORTFILE)"!=""
1312.IF "$(COM)"=="GCC"
1313	$(COMMAND_ECHO)$(TYPE) $(DEF5EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
1314.ELSE
1315	$(COMMAND_ECHO)$(TYPE) $(DEF5EXPORTFILE) >> $@.tmpfile
1316.ENDIF
1317.ENDIF
1318	@-$(RM) $@
1319	@$(RENAME) $@.tmpfile $@
1320.ENDIF			# "$(GUI)"=="WNT"
1321
1322.IF "$(GUI)"=="OS2"
1323
1324#21/02/2006 YD dll names must be 8.3, invoke fix script
1325#check osl/os2/module.c/osl_loadModule()
1326SHL5TARGET8=$(shell @fix_shl.cmd $(SHL5TARGETN:f))
1327
1328DEF5FILTER=$(SOLARENV)/inc/dummy.flt
1329DEF5NAMELIST=$(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib)
1330
1331.IF "$(link_always)"==""
1332$(DEF5TARGETN) : \
1333		$(DEF5DEPN) \
1334		$(DEF5EXPORTFILE)
1335.ELSE			# "$(link_always)"==""
1336$(DEF5TARGETN) .PHONY :
1337.ENDIF			# "$(link_always)"==""
1338	@+-$(RM) $@.tmpfile
1339	@echo "Making:    module definition file" $(@:f)
1340	@echo LIBRARY	  $(SHL5TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
1341	@echo DATA MULTIPLE	 >>$@.tmpfile
1342	@echo EXPORTS													>>$@.tmpfile
1343.IF "$(VERSIONOBJ)"!=""
1344#	getversioninfo fuer alle!!
1345	@echo _GetVersionInfo		>$@.tmp_ord
1346.ENDIF
1347
1348.IF "$(DEFLIB5NAME)"!=""
1349	@+echo $(SLB)/$(DEFLIB5NAME).lib
1350	@+emxexp $(DEF5NAMELIST) | fix_exp_file >> $@.tmp_ord
1351.ENDIF				# "$(DEFLIB5NAME)"!=""
1352
1353.IF "$(DEF5EXPORT1)"!=""
1354	@echo $(DEF5EXPORT1)										>>$@.tmpfile
1355.ENDIF
1356.IF "$(DEF5EXPORT2)"!=""
1357	@echo $(DEF5EXPORT2)										>>$@.tmpfile
1358.ENDIF
1359.IF "$(DEF5EXPORT3)"!=""
1360	@echo $(DEF5EXPORT3)										>>$@.tmpfile
1361.ENDIF
1362.IF "$(DEF5EXPORT4)"!=""
1363	@echo $(DEF5EXPORT4)										>>$@.tmpfile
1364.ENDIF
1365.IF "$(DEF5EXPORT5)"!=""
1366	@echo $(DEF5EXPORT5)										>>$@.tmpfile
1367.ENDIF
1368.IF "$(DEF5EXPORT6)"!=""
1369	@echo $(DEF5EXPORT6)										>>$@.tmpfile
1370.ENDIF
1371.IF "$(DEF5EXPORT7)"!=""
1372	@echo $(DEF5EXPORT7)										>>$@.tmpfile
1373.ENDIF
1374.IF "$(DEF5EXPORT8)"!=""
1375	@echo $(DEF5EXPORT8)										>>$@.tmpfile
1376.ENDIF
1377.IF "$(DEF5EXPORT9)"!=""
1378	@echo $(DEF5EXPORT9)										>>$@.tmpfile
1379.ENDIF
1380.IF "$(DEF5EXPORT10)"!=""
1381	@echo $(DEF5EXPORT10)										>>$@.tmpfile
1382.ENDIF
1383.IF "$(DEF5EXPORT11)"!=""
1384	@echo $(DEF5EXPORT11)										>>$@.tmpfile
1385.ENDIF
1386.IF "$(DEF5EXPORT12)"!=""
1387	@echo $(DEF5EXPORT12)										>>$@.tmpfile
1388.ENDIF
1389.IF "$(DEF5EXPORT13)"!=""
1390	@echo $(DEF5EXPORT13)										>>$@.tmpfile
1391.ENDIF
1392.IF "$(DEF5EXPORT14)"!=""
1393	@echo $(DEF5EXPORT14)										>>$@.tmpfile
1394.ENDIF
1395.IF "$(DEF5EXPORT15)"!=""
1396	@echo $(DEF5EXPORT15)										>>$@.tmpfile
1397.ENDIF
1398.IF "$(DEF5EXPORT16)"!=""
1399	@echo $(DEF5EXPORT16)										>>$@.tmpfile
1400.ENDIF
1401.IF "$(DEF5EXPORT17)"!=""
1402	@echo $(DEF5EXPORT17)										>>$@.tmpfile
1403.ENDIF
1404.IF "$(DEF5EXPORT18)"!=""
1405	@echo $(DEF5EXPORT18)										>>$@.tmpfile
1406.ENDIF
1407.IF "$(DEF5EXPORT19)"!=""
1408	@echo $(DEF5EXPORT19)										>>$@.tmpfile
1409.ENDIF
1410.IF "$(DEF5EXPORT20)"!=""
1411	@echo $(DEF5EXPORT20)										>>$@.tmpfile
1412.ENDIF
1413.IF "$(DEF5EXPORTFILE)"!=""
1414	@fix_def_file < $(DEF5EXPORTFILE) >> $@.tmp_ord
1415.ENDIF
1416	@sort < $@.tmp_ord | uniq > $@.exptmpfile
1417	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
1418	@+-$(RM) $@
1419	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
1420	@+-$(RM) $@.tmp_ord
1421	@+-$(RM) $@.exptmpfile
1422.IF "$(SHL5USE_EXPORTS)"=="" || "$(SHL5USE_EXPORTS)"=="ordinal"
1423#03/11/2012  if 'name' is not used, export from def file (with ordinals)
1424	@echo Build import library from DEF file.
1425	@+-$(RM) $(LB)/$(SHL5TARGETN:b).lib
1426	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL5TARGETN:b).lib $@
1427.ENDIF			# "$(SHL5USE_EXPORTS)"==""
1428
1429.ENDIF			# "$(GUI)"=="OS2"
1430
1431.IF "$(GUI)"=="UNX"
1432$(DEF5TARGETN): \
1433		$(DEF5DEPN) \
1434		$(DEF5EXPORTFILE)
1435	@echo just a dummy for UNIX > $@
1436.ENDIF
1437.ENDIF			# "$(DEF5TARGETN)"!=""
1438
1439
1440# Anweisungen fuer das Linken
1441# unroll begin
1442
1443.IF "$(DEF6TARGETN)"!=""
1444
1445#to make intuitiv naming work
1446.IF "$(DEF6LIBNAME)"!=""
1447DEFLIB6NAME*=$(DEF6LIBNAME)
1448.ENDIF			# "$(DEF6LIBNAME)"!=""
1449
1450.IF "$(DEFLIB6NAME)"!=""
1451DEF6DEPN+=$(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib)
1452.ENDIF
1453
1454.IF "$(SHL6VERSIONMAP)"!=""
1455.IF "$(DEF6EXPORTFILE)"==""
1456.IF "$(GUI)"=="WNT"
1457DEF6EXPORTFILE=$(MISC)/$(SHL6VERSIONMAP:b)_$(SHL6TARGET).dxp
1458.IF "$(COM)"=="GCC"
1459$(DEF6EXPORTFILE) : $(SHL6OBJS) $(SHL6LIBS)
1460.ENDIF # .IF "$(COM)"=="GCC"
1461
1462$(DEF6EXPORTFILE) : $(SHL6VERSIONMAP)
1463	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
1464.IF "$(COM)"=="GCC"
1465	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
1466	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
1467# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
1468# Extract RTTI symbols from all the objects that will be used to build a shared library
1469	$(COMMAND_ECHO)nm -gP $(SHL6OBJS) \
1470		`$(TYPE) /dev/null $(foreach,j,$(SHL6LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
1471		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
1472# overwrite the map file generate into the local output tree with the generated
1473# exported symbols list
1474	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
1475.ENDIF # .IF "$(COM)"=="GCC"
1476
1477.ENDIF			# "$(GUI)"=="WNT"
1478
1479.IF "$(GUI)"=="OS2"
1480DEF6EXPORTFILE=$(MISC)/$(SHL6VERSIONMAP:b)_$(SHL6TARGET).dxp
1481$(DEF6EXPORTFILE) : $(SHL6VERSIONMAP)
1482	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
1483.ENDIF			# "$(GUI)"=="OS2"
1484
1485.ENDIF			# "$(DEF6EXPORTFILE)"==""
1486.ENDIF			# "$(SHL6VERSIONMAP)"!=""
1487
1488.IF "$(GUI)"=="WNT"
1489
1490DEF6FILTER=$(SOLARENV)/inc/dummy.flt
1491
1492RMHACK6:=$(RM)
1493
1494.IF "$(DEF6CEXP)"!=""
1495EXPORT_ALL_SWITCH=-A $(DEF6CEXP)
1496.ENDIF
1497
1498.IF "$(link_always)"==""
1499$(DEF6TARGETN) : \
1500		$(DEF6DEPN) \
1501		$(DEF6EXPORTFILE)
1502.ELSE			# "$(link_always)"==""
1503$(DEF6TARGETN) .PHONY :
1504.ENDIF			# "$(link_always)"==""
1505	@-$(RM) $@.tmpfile
1506	@echo "Making:    module definition file" $(@:f)
1507	@echo LIBRARY	  $(EMQ)"$(SHL6TARGETN:f)$(EMQ)" 								 >$@.tmpfile
1508.IF "$(COM)"!="GCC"
1509	@echo HEAPSIZE	  0 											>>$@.tmpfile
1510.ENDIF
1511	@echo EXPORTS													>>$@.tmpfile
1512.IF "$(VERSIONOBJ)"!=""
1513#	getversioninfo fuer alle!!
1514	@echo GetVersionInfo		>>$@.tmpfile
1515.ENDIF
1516.IF "$(DEFLIB6NAME)"!=""
1517.IF "$(COM)"=="GCC"
1518	@-$(RM) $(MISC)/$(SHL6TARGET).exp
1519	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL6TARGET).exp --export-all-symbols \
1520		`$(TYPE) $(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
1521	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL6TARGET).exp | sed '/^;/d' >>$@.tmpfile
1522	@-$(RM) $(MISC)/$(SHL6TARGET).exp
1523.ELSE
1524.IF "$(SHL6USE_EXPORTS)"==""
1525	@-$(RMHACK6) $(MISC)/$(SHL6TARGET).exp
1526	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL6TARGET).exp $(SLB)/$(DEFLIB6NAME).lib
1527	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL6TARGET).flt $(MISC)/$(SHL6TARGET).exp			   >>$@.tmpfile
1528	$(COMMAND_ECHO)$(RMHACK6) $(MISC)/$(SHL6TARGET).exp
1529.ELSE			# "$(SHL6USE_EXPORTS)"==""
1530	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL6TARGET).direct
1531	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF6FILTER) $(MISC)/$(SHL6TARGET).direct >>$@.tmpfile
1532.ENDIF			# "$(SHL6USE_EXPORTS)"==""
1533.ENDIF
1534.ENDIF				# "$(DEFLIB6NAME)"!=""
1535.IF "$(DEF6EXPORT1)"!=""
1536	@echo $(DEF6EXPORT1)										>>$@.tmpfile
1537.ENDIF
1538.IF "$(DEF6EXPORT2)"!=""
1539	@echo $(DEF6EXPORT2)										>>$@.tmpfile
1540.ENDIF
1541.IF "$(DEF6EXPORT3)"!=""
1542	@echo $(DEF6EXPORT3)										>>$@.tmpfile
1543.ENDIF
1544.IF "$(DEF6EXPORT4)"!=""
1545	@echo $(DEF6EXPORT4)										>>$@.tmpfile
1546.ENDIF
1547.IF "$(DEF6EXPORT5)"!=""
1548	@echo $(DEF6EXPORT5)										>>$@.tmpfile
1549.ENDIF
1550.IF "$(DEF6EXPORT6)"!=""
1551	@echo $(DEF6EXPORT6)										>>$@.tmpfile
1552.ENDIF
1553.IF "$(DEF6EXPORT7)"!=""
1554	@echo $(DEF6EXPORT7)										>>$@.tmpfile
1555.ENDIF
1556.IF "$(DEF6EXPORT8)"!=""
1557	@echo $(DEF6EXPORT8)										>>$@.tmpfile
1558.ENDIF
1559.IF "$(DEF6EXPORT9)"!=""
1560	@echo $(DEF6EXPORT9)										>>$@.tmpfile
1561.ENDIF
1562.IF "$(DEF6EXPORT10)"!=""
1563	@echo $(DEF6EXPORT10)										>>$@.tmpfile
1564.ENDIF
1565.IF "$(DEF6EXPORT11)"!=""
1566	@echo $(DEF6EXPORT11)										>>$@.tmpfile
1567.ENDIF
1568.IF "$(DEF6EXPORT12)"!=""
1569	@echo $(DEF6EXPORT12)										>>$@.tmpfile
1570.ENDIF
1571.IF "$(DEF6EXPORT13)"!=""
1572	@echo $(DEF6EXPORT13)										>>$@.tmpfile
1573.ENDIF
1574.IF "$(DEF6EXPORT14)"!=""
1575	@echo $(DEF6EXPORT14)										>>$@.tmpfile
1576.ENDIF
1577.IF "$(DEF6EXPORT15)"!=""
1578	@echo $(DEF6EXPORT15)										>>$@.tmpfile
1579.ENDIF
1580.IF "$(DEF6EXPORT16)"!=""
1581	@echo $(DEF6EXPORT16)										>>$@.tmpfile
1582.ENDIF
1583.IF "$(DEF6EXPORT17)"!=""
1584	@echo $(DEF6EXPORT17)										>>$@.tmpfile
1585.ENDIF
1586.IF "$(DEF6EXPORT18)"!=""
1587	@echo $(DEF6EXPORT18)										>>$@.tmpfile
1588.ENDIF
1589.IF "$(DEF6EXPORT19)"!=""
1590	@echo $(DEF6EXPORT19)										>>$@.tmpfile
1591.ENDIF
1592.IF "$(DEF6EXPORT20)"!=""
1593	@echo $(DEF6EXPORT20)										>>$@.tmpfile
1594.ENDIF
1595.IF "$(DEF6EXPORTFILE)"!=""
1596.IF "$(COM)"=="GCC"
1597	$(COMMAND_ECHO)$(TYPE) $(DEF6EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
1598.ELSE
1599	$(COMMAND_ECHO)$(TYPE) $(DEF6EXPORTFILE) >> $@.tmpfile
1600.ENDIF
1601.ENDIF
1602	@-$(RM) $@
1603	@$(RENAME) $@.tmpfile $@
1604.ENDIF			# "$(GUI)"=="WNT"
1605
1606.IF "$(GUI)"=="OS2"
1607
1608#21/02/2006 YD dll names must be 8.3, invoke fix script
1609#check osl/os2/module.c/osl_loadModule()
1610SHL6TARGET8=$(shell @fix_shl.cmd $(SHL6TARGETN:f))
1611
1612DEF6FILTER=$(SOLARENV)/inc/dummy.flt
1613DEF6NAMELIST=$(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib)
1614
1615.IF "$(link_always)"==""
1616$(DEF6TARGETN) : \
1617		$(DEF6DEPN) \
1618		$(DEF6EXPORTFILE)
1619.ELSE			# "$(link_always)"==""
1620$(DEF6TARGETN) .PHONY :
1621.ENDIF			# "$(link_always)"==""
1622	@+-$(RM) $@.tmpfile
1623	@echo "Making:    module definition file" $(@:f)
1624	@echo LIBRARY	  $(SHL6TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
1625	@echo DATA MULTIPLE	 >>$@.tmpfile
1626	@echo EXPORTS													>>$@.tmpfile
1627.IF "$(VERSIONOBJ)"!=""
1628#	getversioninfo fuer alle!!
1629	@echo _GetVersionInfo		>$@.tmp_ord
1630.ENDIF
1631
1632.IF "$(DEFLIB6NAME)"!=""
1633	@+echo $(SLB)/$(DEFLIB6NAME).lib
1634	@+emxexp $(DEF6NAMELIST) | fix_exp_file >> $@.tmp_ord
1635.ENDIF				# "$(DEFLIB6NAME)"!=""
1636
1637.IF "$(DEF6EXPORT1)"!=""
1638	@echo $(DEF6EXPORT1)										>>$@.tmpfile
1639.ENDIF
1640.IF "$(DEF6EXPORT2)"!=""
1641	@echo $(DEF6EXPORT2)										>>$@.tmpfile
1642.ENDIF
1643.IF "$(DEF6EXPORT3)"!=""
1644	@echo $(DEF6EXPORT3)										>>$@.tmpfile
1645.ENDIF
1646.IF "$(DEF6EXPORT4)"!=""
1647	@echo $(DEF6EXPORT4)										>>$@.tmpfile
1648.ENDIF
1649.IF "$(DEF6EXPORT5)"!=""
1650	@echo $(DEF6EXPORT5)										>>$@.tmpfile
1651.ENDIF
1652.IF "$(DEF6EXPORT6)"!=""
1653	@echo $(DEF6EXPORT6)										>>$@.tmpfile
1654.ENDIF
1655.IF "$(DEF6EXPORT7)"!=""
1656	@echo $(DEF6EXPORT7)										>>$@.tmpfile
1657.ENDIF
1658.IF "$(DEF6EXPORT8)"!=""
1659	@echo $(DEF6EXPORT8)										>>$@.tmpfile
1660.ENDIF
1661.IF "$(DEF6EXPORT9)"!=""
1662	@echo $(DEF6EXPORT9)										>>$@.tmpfile
1663.ENDIF
1664.IF "$(DEF6EXPORT10)"!=""
1665	@echo $(DEF6EXPORT10)										>>$@.tmpfile
1666.ENDIF
1667.IF "$(DEF6EXPORT11)"!=""
1668	@echo $(DEF6EXPORT11)										>>$@.tmpfile
1669.ENDIF
1670.IF "$(DEF6EXPORT12)"!=""
1671	@echo $(DEF6EXPORT12)										>>$@.tmpfile
1672.ENDIF
1673.IF "$(DEF6EXPORT13)"!=""
1674	@echo $(DEF6EXPORT13)										>>$@.tmpfile
1675.ENDIF
1676.IF "$(DEF6EXPORT14)"!=""
1677	@echo $(DEF6EXPORT14)										>>$@.tmpfile
1678.ENDIF
1679.IF "$(DEF6EXPORT15)"!=""
1680	@echo $(DEF6EXPORT15)										>>$@.tmpfile
1681.ENDIF
1682.IF "$(DEF6EXPORT16)"!=""
1683	@echo $(DEF6EXPORT16)										>>$@.tmpfile
1684.ENDIF
1685.IF "$(DEF6EXPORT17)"!=""
1686	@echo $(DEF6EXPORT17)										>>$@.tmpfile
1687.ENDIF
1688.IF "$(DEF6EXPORT18)"!=""
1689	@echo $(DEF6EXPORT18)										>>$@.tmpfile
1690.ENDIF
1691.IF "$(DEF6EXPORT19)"!=""
1692	@echo $(DEF6EXPORT19)										>>$@.tmpfile
1693.ENDIF
1694.IF "$(DEF6EXPORT20)"!=""
1695	@echo $(DEF6EXPORT20)										>>$@.tmpfile
1696.ENDIF
1697.IF "$(DEF6EXPORTFILE)"!=""
1698	@fix_def_file < $(DEF6EXPORTFILE) >> $@.tmp_ord
1699.ENDIF
1700	@sort < $@.tmp_ord | uniq > $@.exptmpfile
1701	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
1702	@+-$(RM) $@
1703	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
1704	@+-$(RM) $@.tmp_ord
1705	@+-$(RM) $@.exptmpfile
1706.IF "$(SHL6USE_EXPORTS)"=="" || "$(SHL6USE_EXPORTS)"=="ordinal"
1707#03/11/2012  if 'name' is not used, export from def file (with ordinals)
1708	@echo Build import library from DEF file.
1709	@+-$(RM) $(LB)/$(SHL6TARGETN:b).lib
1710	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL6TARGETN:b).lib $@
1711.ENDIF			# "$(SHL6USE_EXPORTS)"==""
1712
1713.ENDIF			# "$(GUI)"=="OS2"
1714
1715.IF "$(GUI)"=="UNX"
1716$(DEF6TARGETN): \
1717		$(DEF6DEPN) \
1718		$(DEF6EXPORTFILE)
1719	@echo just a dummy for UNIX > $@
1720.ENDIF
1721.ENDIF			# "$(DEF6TARGETN)"!=""
1722
1723
1724# Anweisungen fuer das Linken
1725# unroll begin
1726
1727.IF "$(DEF7TARGETN)"!=""
1728
1729#to make intuitiv naming work
1730.IF "$(DEF7LIBNAME)"!=""
1731DEFLIB7NAME*=$(DEF7LIBNAME)
1732.ENDIF			# "$(DEF7LIBNAME)"!=""
1733
1734.IF "$(DEFLIB7NAME)"!=""
1735DEF7DEPN+=$(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib)
1736.ENDIF
1737
1738.IF "$(SHL7VERSIONMAP)"!=""
1739.IF "$(DEF7EXPORTFILE)"==""
1740.IF "$(GUI)"=="WNT"
1741DEF7EXPORTFILE=$(MISC)/$(SHL7VERSIONMAP:b)_$(SHL7TARGET).dxp
1742.IF "$(COM)"=="GCC"
1743$(DEF7EXPORTFILE) : $(SHL7OBJS) $(SHL7LIBS)
1744.ENDIF # .IF "$(COM)"=="GCC"
1745
1746$(DEF7EXPORTFILE) : $(SHL7VERSIONMAP)
1747	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
1748.IF "$(COM)"=="GCC"
1749	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
1750	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
1751# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
1752# Extract RTTI symbols from all the objects that will be used to build a shared library
1753	$(COMMAND_ECHO)nm -gP $(SHL7OBJS) \
1754		`$(TYPE) /dev/null $(foreach,j,$(SHL7LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
1755		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
1756# overwrite the map file generate into the local output tree with the generated
1757# exported symbols list
1758	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
1759.ENDIF # .IF "$(COM)"=="GCC"
1760
1761.ENDIF			# "$(GUI)"=="WNT"
1762
1763.IF "$(GUI)"=="OS2"
1764DEF7EXPORTFILE=$(MISC)/$(SHL7VERSIONMAP:b)_$(SHL7TARGET).dxp
1765$(DEF7EXPORTFILE) : $(SHL7VERSIONMAP)
1766	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
1767.ENDIF			# "$(GUI)"=="OS2"
1768
1769.ENDIF			# "$(DEF7EXPORTFILE)"==""
1770.ENDIF			# "$(SHL7VERSIONMAP)"!=""
1771
1772.IF "$(GUI)"=="WNT"
1773
1774DEF7FILTER=$(SOLARENV)/inc/dummy.flt
1775
1776RMHACK7:=$(RM)
1777
1778.IF "$(DEF7CEXP)"!=""
1779EXPORT_ALL_SWITCH=-A $(DEF7CEXP)
1780.ENDIF
1781
1782.IF "$(link_always)"==""
1783$(DEF7TARGETN) : \
1784		$(DEF7DEPN) \
1785		$(DEF7EXPORTFILE)
1786.ELSE			# "$(link_always)"==""
1787$(DEF7TARGETN) .PHONY :
1788.ENDIF			# "$(link_always)"==""
1789	@-$(RM) $@.tmpfile
1790	@echo "Making:    module definition file" $(@:f)
1791	@echo LIBRARY	  $(EMQ)"$(SHL7TARGETN:f)$(EMQ)" 								 >$@.tmpfile
1792.IF "$(COM)"!="GCC"
1793	@echo HEAPSIZE	  0 											>>$@.tmpfile
1794.ENDIF
1795	@echo EXPORTS													>>$@.tmpfile
1796.IF "$(VERSIONOBJ)"!=""
1797#	getversioninfo fuer alle!!
1798	@echo GetVersionInfo		>>$@.tmpfile
1799.ENDIF
1800.IF "$(DEFLIB7NAME)"!=""
1801.IF "$(COM)"=="GCC"
1802	@-$(RM) $(MISC)/$(SHL7TARGET).exp
1803	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL7TARGET).exp --export-all-symbols \
1804		`$(TYPE) $(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
1805	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL7TARGET).exp | sed '/^;/d' >>$@.tmpfile
1806	@-$(RM) $(MISC)/$(SHL7TARGET).exp
1807.ELSE
1808.IF "$(SHL7USE_EXPORTS)"==""
1809	@-$(RMHACK7) $(MISC)/$(SHL7TARGET).exp
1810	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL7TARGET).exp $(SLB)/$(DEFLIB7NAME).lib
1811	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL7TARGET).flt $(MISC)/$(SHL7TARGET).exp			   >>$@.tmpfile
1812	$(COMMAND_ECHO)$(RMHACK7) $(MISC)/$(SHL7TARGET).exp
1813.ELSE			# "$(SHL7USE_EXPORTS)"==""
1814	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL7TARGET).direct
1815	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF7FILTER) $(MISC)/$(SHL7TARGET).direct >>$@.tmpfile
1816.ENDIF			# "$(SHL7USE_EXPORTS)"==""
1817.ENDIF
1818.ENDIF				# "$(DEFLIB7NAME)"!=""
1819.IF "$(DEF7EXPORT1)"!=""
1820	@echo $(DEF7EXPORT1)										>>$@.tmpfile
1821.ENDIF
1822.IF "$(DEF7EXPORT2)"!=""
1823	@echo $(DEF7EXPORT2)										>>$@.tmpfile
1824.ENDIF
1825.IF "$(DEF7EXPORT3)"!=""
1826	@echo $(DEF7EXPORT3)										>>$@.tmpfile
1827.ENDIF
1828.IF "$(DEF7EXPORT4)"!=""
1829	@echo $(DEF7EXPORT4)										>>$@.tmpfile
1830.ENDIF
1831.IF "$(DEF7EXPORT5)"!=""
1832	@echo $(DEF7EXPORT5)										>>$@.tmpfile
1833.ENDIF
1834.IF "$(DEF7EXPORT6)"!=""
1835	@echo $(DEF7EXPORT6)										>>$@.tmpfile
1836.ENDIF
1837.IF "$(DEF7EXPORT7)"!=""
1838	@echo $(DEF7EXPORT7)										>>$@.tmpfile
1839.ENDIF
1840.IF "$(DEF7EXPORT8)"!=""
1841	@echo $(DEF7EXPORT8)										>>$@.tmpfile
1842.ENDIF
1843.IF "$(DEF7EXPORT9)"!=""
1844	@echo $(DEF7EXPORT9)										>>$@.tmpfile
1845.ENDIF
1846.IF "$(DEF7EXPORT10)"!=""
1847	@echo $(DEF7EXPORT10)										>>$@.tmpfile
1848.ENDIF
1849.IF "$(DEF7EXPORT11)"!=""
1850	@echo $(DEF7EXPORT11)										>>$@.tmpfile
1851.ENDIF
1852.IF "$(DEF7EXPORT12)"!=""
1853	@echo $(DEF7EXPORT12)										>>$@.tmpfile
1854.ENDIF
1855.IF "$(DEF7EXPORT13)"!=""
1856	@echo $(DEF7EXPORT13)										>>$@.tmpfile
1857.ENDIF
1858.IF "$(DEF7EXPORT14)"!=""
1859	@echo $(DEF7EXPORT14)										>>$@.tmpfile
1860.ENDIF
1861.IF "$(DEF7EXPORT15)"!=""
1862	@echo $(DEF7EXPORT15)										>>$@.tmpfile
1863.ENDIF
1864.IF "$(DEF7EXPORT16)"!=""
1865	@echo $(DEF7EXPORT16)										>>$@.tmpfile
1866.ENDIF
1867.IF "$(DEF7EXPORT17)"!=""
1868	@echo $(DEF7EXPORT17)										>>$@.tmpfile
1869.ENDIF
1870.IF "$(DEF7EXPORT18)"!=""
1871	@echo $(DEF7EXPORT18)										>>$@.tmpfile
1872.ENDIF
1873.IF "$(DEF7EXPORT19)"!=""
1874	@echo $(DEF7EXPORT19)										>>$@.tmpfile
1875.ENDIF
1876.IF "$(DEF7EXPORT20)"!=""
1877	@echo $(DEF7EXPORT20)										>>$@.tmpfile
1878.ENDIF
1879.IF "$(DEF7EXPORTFILE)"!=""
1880.IF "$(COM)"=="GCC"
1881	$(COMMAND_ECHO)$(TYPE) $(DEF7EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
1882.ELSE
1883	$(COMMAND_ECHO)$(TYPE) $(DEF7EXPORTFILE) >> $@.tmpfile
1884.ENDIF
1885.ENDIF
1886	@-$(RM) $@
1887	@$(RENAME) $@.tmpfile $@
1888.ENDIF			# "$(GUI)"=="WNT"
1889
1890.IF "$(GUI)"=="OS2"
1891
1892#21/02/2006 YD dll names must be 8.3, invoke fix script
1893#check osl/os2/module.c/osl_loadModule()
1894SHL7TARGET8=$(shell @fix_shl.cmd $(SHL7TARGETN:f))
1895
1896DEF7FILTER=$(SOLARENV)/inc/dummy.flt
1897DEF7NAMELIST=$(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib)
1898
1899.IF "$(link_always)"==""
1900$(DEF7TARGETN) : \
1901		$(DEF7DEPN) \
1902		$(DEF7EXPORTFILE)
1903.ELSE			# "$(link_always)"==""
1904$(DEF7TARGETN) .PHONY :
1905.ENDIF			# "$(link_always)"==""
1906	@+-$(RM) $@.tmpfile
1907	@echo "Making:    module definition file" $(@:f)
1908	@echo LIBRARY	  $(SHL7TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
1909	@echo DATA MULTIPLE	 >>$@.tmpfile
1910	@echo EXPORTS													>>$@.tmpfile
1911.IF "$(VERSIONOBJ)"!=""
1912#	getversioninfo fuer alle!!
1913	@echo _GetVersionInfo		>$@.tmp_ord
1914.ENDIF
1915
1916.IF "$(DEFLIB7NAME)"!=""
1917	@+echo $(SLB)/$(DEFLIB7NAME).lib
1918	@+emxexp $(DEF7NAMELIST) | fix_exp_file >> $@.tmp_ord
1919.ENDIF				# "$(DEFLIB7NAME)"!=""
1920
1921.IF "$(DEF7EXPORT1)"!=""
1922	@echo $(DEF7EXPORT1)										>>$@.tmpfile
1923.ENDIF
1924.IF "$(DEF7EXPORT2)"!=""
1925	@echo $(DEF7EXPORT2)										>>$@.tmpfile
1926.ENDIF
1927.IF "$(DEF7EXPORT3)"!=""
1928	@echo $(DEF7EXPORT3)										>>$@.tmpfile
1929.ENDIF
1930.IF "$(DEF7EXPORT4)"!=""
1931	@echo $(DEF7EXPORT4)										>>$@.tmpfile
1932.ENDIF
1933.IF "$(DEF7EXPORT5)"!=""
1934	@echo $(DEF7EXPORT5)										>>$@.tmpfile
1935.ENDIF
1936.IF "$(DEF7EXPORT6)"!=""
1937	@echo $(DEF7EXPORT6)										>>$@.tmpfile
1938.ENDIF
1939.IF "$(DEF7EXPORT7)"!=""
1940	@echo $(DEF7EXPORT7)										>>$@.tmpfile
1941.ENDIF
1942.IF "$(DEF7EXPORT8)"!=""
1943	@echo $(DEF7EXPORT8)										>>$@.tmpfile
1944.ENDIF
1945.IF "$(DEF7EXPORT9)"!=""
1946	@echo $(DEF7EXPORT9)										>>$@.tmpfile
1947.ENDIF
1948.IF "$(DEF7EXPORT10)"!=""
1949	@echo $(DEF7EXPORT10)										>>$@.tmpfile
1950.ENDIF
1951.IF "$(DEF7EXPORT11)"!=""
1952	@echo $(DEF7EXPORT11)										>>$@.tmpfile
1953.ENDIF
1954.IF "$(DEF7EXPORT12)"!=""
1955	@echo $(DEF7EXPORT12)										>>$@.tmpfile
1956.ENDIF
1957.IF "$(DEF7EXPORT13)"!=""
1958	@echo $(DEF7EXPORT13)										>>$@.tmpfile
1959.ENDIF
1960.IF "$(DEF7EXPORT14)"!=""
1961	@echo $(DEF7EXPORT14)										>>$@.tmpfile
1962.ENDIF
1963.IF "$(DEF7EXPORT15)"!=""
1964	@echo $(DEF7EXPORT15)										>>$@.tmpfile
1965.ENDIF
1966.IF "$(DEF7EXPORT16)"!=""
1967	@echo $(DEF7EXPORT16)										>>$@.tmpfile
1968.ENDIF
1969.IF "$(DEF7EXPORT17)"!=""
1970	@echo $(DEF7EXPORT17)										>>$@.tmpfile
1971.ENDIF
1972.IF "$(DEF7EXPORT18)"!=""
1973	@echo $(DEF7EXPORT18)										>>$@.tmpfile
1974.ENDIF
1975.IF "$(DEF7EXPORT19)"!=""
1976	@echo $(DEF7EXPORT19)										>>$@.tmpfile
1977.ENDIF
1978.IF "$(DEF7EXPORT20)"!=""
1979	@echo $(DEF7EXPORT20)										>>$@.tmpfile
1980.ENDIF
1981.IF "$(DEF7EXPORTFILE)"!=""
1982	@fix_def_file < $(DEF7EXPORTFILE) >> $@.tmp_ord
1983.ENDIF
1984	@sort < $@.tmp_ord | uniq > $@.exptmpfile
1985	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
1986	@+-$(RM) $@
1987	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
1988	@+-$(RM) $@.tmp_ord
1989	@+-$(RM) $@.exptmpfile
1990.IF "$(SHL7USE_EXPORTS)"=="" || "$(SHL7USE_EXPORTS)"=="ordinal"
1991#03/11/2012  if 'name' is not used, export from def file (with ordinals)
1992	@echo Build import library from DEF file.
1993	@+-$(RM) $(LB)/$(SHL7TARGETN:b).lib
1994	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL7TARGETN:b).lib $@
1995.ENDIF			# "$(SHL7USE_EXPORTS)"==""
1996
1997.ENDIF			# "$(GUI)"=="OS2"
1998
1999.IF "$(GUI)"=="UNX"
2000$(DEF7TARGETN): \
2001		$(DEF7DEPN) \
2002		$(DEF7EXPORTFILE)
2003	@echo just a dummy for UNIX > $@
2004.ENDIF
2005.ENDIF			# "$(DEF7TARGETN)"!=""
2006
2007
2008# Anweisungen fuer das Linken
2009# unroll begin
2010
2011.IF "$(DEF8TARGETN)"!=""
2012
2013#to make intuitiv naming work
2014.IF "$(DEF8LIBNAME)"!=""
2015DEFLIB8NAME*=$(DEF8LIBNAME)
2016.ENDIF			# "$(DEF8LIBNAME)"!=""
2017
2018.IF "$(DEFLIB8NAME)"!=""
2019DEF8DEPN+=$(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib)
2020.ENDIF
2021
2022.IF "$(SHL8VERSIONMAP)"!=""
2023.IF "$(DEF8EXPORTFILE)"==""
2024.IF "$(GUI)"=="WNT"
2025DEF8EXPORTFILE=$(MISC)/$(SHL8VERSIONMAP:b)_$(SHL8TARGET).dxp
2026.IF "$(COM)"=="GCC"
2027$(DEF8EXPORTFILE) : $(SHL8OBJS) $(SHL8LIBS)
2028.ENDIF # .IF "$(COM)"=="GCC"
2029
2030$(DEF8EXPORTFILE) : $(SHL8VERSIONMAP)
2031	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
2032.IF "$(COM)"=="GCC"
2033	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
2034	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
2035# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
2036# Extract RTTI symbols from all the objects that will be used to build a shared library
2037	$(COMMAND_ECHO)nm -gP $(SHL8OBJS) \
2038		`$(TYPE) /dev/null $(foreach,j,$(SHL8LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
2039		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
2040# overwrite the map file generate into the local output tree with the generated
2041# exported symbols list
2042	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
2043.ENDIF # .IF "$(COM)"=="GCC"
2044
2045.ENDIF			# "$(GUI)"=="WNT"
2046
2047.IF "$(GUI)"=="OS2"
2048DEF8EXPORTFILE=$(MISC)/$(SHL8VERSIONMAP:b)_$(SHL8TARGET).dxp
2049$(DEF8EXPORTFILE) : $(SHL8VERSIONMAP)
2050	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
2051.ENDIF			# "$(GUI)"=="OS2"
2052
2053.ENDIF			# "$(DEF8EXPORTFILE)"==""
2054.ENDIF			# "$(SHL8VERSIONMAP)"!=""
2055
2056.IF "$(GUI)"=="WNT"
2057
2058DEF8FILTER=$(SOLARENV)/inc/dummy.flt
2059
2060RMHACK8:=$(RM)
2061
2062.IF "$(DEF8CEXP)"!=""
2063EXPORT_ALL_SWITCH=-A $(DEF8CEXP)
2064.ENDIF
2065
2066.IF "$(link_always)"==""
2067$(DEF8TARGETN) : \
2068		$(DEF8DEPN) \
2069		$(DEF8EXPORTFILE)
2070.ELSE			# "$(link_always)"==""
2071$(DEF8TARGETN) .PHONY :
2072.ENDIF			# "$(link_always)"==""
2073	@-$(RM) $@.tmpfile
2074	@echo "Making:    module definition file" $(@:f)
2075	@echo LIBRARY	  $(EMQ)"$(SHL8TARGETN:f)$(EMQ)" 								 >$@.tmpfile
2076.IF "$(COM)"!="GCC"
2077	@echo HEAPSIZE	  0 											>>$@.tmpfile
2078.ENDIF
2079	@echo EXPORTS													>>$@.tmpfile
2080.IF "$(VERSIONOBJ)"!=""
2081#	getversioninfo fuer alle!!
2082	@echo GetVersionInfo		>>$@.tmpfile
2083.ENDIF
2084.IF "$(DEFLIB8NAME)"!=""
2085.IF "$(COM)"=="GCC"
2086	@-$(RM) $(MISC)/$(SHL8TARGET).exp
2087	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL8TARGET).exp --export-all-symbols \
2088		`$(TYPE) $(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
2089	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL8TARGET).exp | sed '/^;/d' >>$@.tmpfile
2090	@-$(RM) $(MISC)/$(SHL8TARGET).exp
2091.ELSE
2092.IF "$(SHL8USE_EXPORTS)"==""
2093	@-$(RMHACK8) $(MISC)/$(SHL8TARGET).exp
2094	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL8TARGET).exp $(SLB)/$(DEFLIB8NAME).lib
2095	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL8TARGET).flt $(MISC)/$(SHL8TARGET).exp			   >>$@.tmpfile
2096	$(COMMAND_ECHO)$(RMHACK8) $(MISC)/$(SHL8TARGET).exp
2097.ELSE			# "$(SHL8USE_EXPORTS)"==""
2098	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL8TARGET).direct
2099	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF8FILTER) $(MISC)/$(SHL8TARGET).direct >>$@.tmpfile
2100.ENDIF			# "$(SHL8USE_EXPORTS)"==""
2101.ENDIF
2102.ENDIF				# "$(DEFLIB8NAME)"!=""
2103.IF "$(DEF8EXPORT1)"!=""
2104	@echo $(DEF8EXPORT1)										>>$@.tmpfile
2105.ENDIF
2106.IF "$(DEF8EXPORT2)"!=""
2107	@echo $(DEF8EXPORT2)										>>$@.tmpfile
2108.ENDIF
2109.IF "$(DEF8EXPORT3)"!=""
2110	@echo $(DEF8EXPORT3)										>>$@.tmpfile
2111.ENDIF
2112.IF "$(DEF8EXPORT4)"!=""
2113	@echo $(DEF8EXPORT4)										>>$@.tmpfile
2114.ENDIF
2115.IF "$(DEF8EXPORT5)"!=""
2116	@echo $(DEF8EXPORT5)										>>$@.tmpfile
2117.ENDIF
2118.IF "$(DEF8EXPORT6)"!=""
2119	@echo $(DEF8EXPORT6)										>>$@.tmpfile
2120.ENDIF
2121.IF "$(DEF8EXPORT7)"!=""
2122	@echo $(DEF8EXPORT7)										>>$@.tmpfile
2123.ENDIF
2124.IF "$(DEF8EXPORT8)"!=""
2125	@echo $(DEF8EXPORT8)										>>$@.tmpfile
2126.ENDIF
2127.IF "$(DEF8EXPORT9)"!=""
2128	@echo $(DEF8EXPORT9)										>>$@.tmpfile
2129.ENDIF
2130.IF "$(DEF8EXPORT10)"!=""
2131	@echo $(DEF8EXPORT10)										>>$@.tmpfile
2132.ENDIF
2133.IF "$(DEF8EXPORT11)"!=""
2134	@echo $(DEF8EXPORT11)										>>$@.tmpfile
2135.ENDIF
2136.IF "$(DEF8EXPORT12)"!=""
2137	@echo $(DEF8EXPORT12)										>>$@.tmpfile
2138.ENDIF
2139.IF "$(DEF8EXPORT13)"!=""
2140	@echo $(DEF8EXPORT13)										>>$@.tmpfile
2141.ENDIF
2142.IF "$(DEF8EXPORT14)"!=""
2143	@echo $(DEF8EXPORT14)										>>$@.tmpfile
2144.ENDIF
2145.IF "$(DEF8EXPORT15)"!=""
2146	@echo $(DEF8EXPORT15)										>>$@.tmpfile
2147.ENDIF
2148.IF "$(DEF8EXPORT16)"!=""
2149	@echo $(DEF8EXPORT16)										>>$@.tmpfile
2150.ENDIF
2151.IF "$(DEF8EXPORT17)"!=""
2152	@echo $(DEF8EXPORT17)										>>$@.tmpfile
2153.ENDIF
2154.IF "$(DEF8EXPORT18)"!=""
2155	@echo $(DEF8EXPORT18)										>>$@.tmpfile
2156.ENDIF
2157.IF "$(DEF8EXPORT19)"!=""
2158	@echo $(DEF8EXPORT19)										>>$@.tmpfile
2159.ENDIF
2160.IF "$(DEF8EXPORT20)"!=""
2161	@echo $(DEF8EXPORT20)										>>$@.tmpfile
2162.ENDIF
2163.IF "$(DEF8EXPORTFILE)"!=""
2164.IF "$(COM)"=="GCC"
2165	$(COMMAND_ECHO)$(TYPE) $(DEF8EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
2166.ELSE
2167	$(COMMAND_ECHO)$(TYPE) $(DEF8EXPORTFILE) >> $@.tmpfile
2168.ENDIF
2169.ENDIF
2170	@-$(RM) $@
2171	@$(RENAME) $@.tmpfile $@
2172.ENDIF			# "$(GUI)"=="WNT"
2173
2174.IF "$(GUI)"=="OS2"
2175
2176#21/02/2006 YD dll names must be 8.3, invoke fix script
2177#check osl/os2/module.c/osl_loadModule()
2178SHL8TARGET8=$(shell @fix_shl.cmd $(SHL8TARGETN:f))
2179
2180DEF8FILTER=$(SOLARENV)/inc/dummy.flt
2181DEF8NAMELIST=$(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib)
2182
2183.IF "$(link_always)"==""
2184$(DEF8TARGETN) : \
2185		$(DEF8DEPN) \
2186		$(DEF8EXPORTFILE)
2187.ELSE			# "$(link_always)"==""
2188$(DEF8TARGETN) .PHONY :
2189.ENDIF			# "$(link_always)"==""
2190	@+-$(RM) $@.tmpfile
2191	@echo "Making:    module definition file" $(@:f)
2192	@echo LIBRARY	  $(SHL8TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
2193	@echo DATA MULTIPLE	 >>$@.tmpfile
2194	@echo EXPORTS													>>$@.tmpfile
2195.IF "$(VERSIONOBJ)"!=""
2196#	getversioninfo fuer alle!!
2197	@echo _GetVersionInfo		>$@.tmp_ord
2198.ENDIF
2199
2200.IF "$(DEFLIB8NAME)"!=""
2201	@+echo $(SLB)/$(DEFLIB8NAME).lib
2202	@+emxexp $(DEF8NAMELIST) | fix_exp_file >> $@.tmp_ord
2203.ENDIF				# "$(DEFLIB8NAME)"!=""
2204
2205.IF "$(DEF8EXPORT1)"!=""
2206	@echo $(DEF8EXPORT1)										>>$@.tmpfile
2207.ENDIF
2208.IF "$(DEF8EXPORT2)"!=""
2209	@echo $(DEF8EXPORT2)										>>$@.tmpfile
2210.ENDIF
2211.IF "$(DEF8EXPORT3)"!=""
2212	@echo $(DEF8EXPORT3)										>>$@.tmpfile
2213.ENDIF
2214.IF "$(DEF8EXPORT4)"!=""
2215	@echo $(DEF8EXPORT4)										>>$@.tmpfile
2216.ENDIF
2217.IF "$(DEF8EXPORT5)"!=""
2218	@echo $(DEF8EXPORT5)										>>$@.tmpfile
2219.ENDIF
2220.IF "$(DEF8EXPORT6)"!=""
2221	@echo $(DEF8EXPORT6)										>>$@.tmpfile
2222.ENDIF
2223.IF "$(DEF8EXPORT7)"!=""
2224	@echo $(DEF8EXPORT7)										>>$@.tmpfile
2225.ENDIF
2226.IF "$(DEF8EXPORT8)"!=""
2227	@echo $(DEF8EXPORT8)										>>$@.tmpfile
2228.ENDIF
2229.IF "$(DEF8EXPORT9)"!=""
2230	@echo $(DEF8EXPORT9)										>>$@.tmpfile
2231.ENDIF
2232.IF "$(DEF8EXPORT10)"!=""
2233	@echo $(DEF8EXPORT10)										>>$@.tmpfile
2234.ENDIF
2235.IF "$(DEF8EXPORT11)"!=""
2236	@echo $(DEF8EXPORT11)										>>$@.tmpfile
2237.ENDIF
2238.IF "$(DEF8EXPORT12)"!=""
2239	@echo $(DEF8EXPORT12)										>>$@.tmpfile
2240.ENDIF
2241.IF "$(DEF8EXPORT13)"!=""
2242	@echo $(DEF8EXPORT13)										>>$@.tmpfile
2243.ENDIF
2244.IF "$(DEF8EXPORT14)"!=""
2245	@echo $(DEF8EXPORT14)										>>$@.tmpfile
2246.ENDIF
2247.IF "$(DEF8EXPORT15)"!=""
2248	@echo $(DEF8EXPORT15)										>>$@.tmpfile
2249.ENDIF
2250.IF "$(DEF8EXPORT16)"!=""
2251	@echo $(DEF8EXPORT16)										>>$@.tmpfile
2252.ENDIF
2253.IF "$(DEF8EXPORT17)"!=""
2254	@echo $(DEF8EXPORT17)										>>$@.tmpfile
2255.ENDIF
2256.IF "$(DEF8EXPORT18)"!=""
2257	@echo $(DEF8EXPORT18)										>>$@.tmpfile
2258.ENDIF
2259.IF "$(DEF8EXPORT19)"!=""
2260	@echo $(DEF8EXPORT19)										>>$@.tmpfile
2261.ENDIF
2262.IF "$(DEF8EXPORT20)"!=""
2263	@echo $(DEF8EXPORT20)										>>$@.tmpfile
2264.ENDIF
2265.IF "$(DEF8EXPORTFILE)"!=""
2266	@fix_def_file < $(DEF8EXPORTFILE) >> $@.tmp_ord
2267.ENDIF
2268	@sort < $@.tmp_ord | uniq > $@.exptmpfile
2269	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
2270	@+-$(RM) $@
2271	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
2272	@+-$(RM) $@.tmp_ord
2273	@+-$(RM) $@.exptmpfile
2274.IF "$(SHL8USE_EXPORTS)"=="" || "$(SHL8USE_EXPORTS)"=="ordinal"
2275#03/11/2012  if 'name' is not used, export from def file (with ordinals)
2276	@echo Build import library from DEF file.
2277	@+-$(RM) $(LB)/$(SHL8TARGETN:b).lib
2278	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL8TARGETN:b).lib $@
2279.ENDIF			# "$(SHL8USE_EXPORTS)"==""
2280
2281.ENDIF			# "$(GUI)"=="OS2"
2282
2283.IF "$(GUI)"=="UNX"
2284$(DEF8TARGETN): \
2285		$(DEF8DEPN) \
2286		$(DEF8EXPORTFILE)
2287	@echo just a dummy for UNIX > $@
2288.ENDIF
2289.ENDIF			# "$(DEF8TARGETN)"!=""
2290
2291
2292# Anweisungen fuer das Linken
2293# unroll begin
2294
2295.IF "$(DEF9TARGETN)"!=""
2296
2297#to make intuitiv naming work
2298.IF "$(DEF9LIBNAME)"!=""
2299DEFLIB9NAME*=$(DEF9LIBNAME)
2300.ENDIF			# "$(DEF9LIBNAME)"!=""
2301
2302.IF "$(DEFLIB9NAME)"!=""
2303DEF9DEPN+=$(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib)
2304.ENDIF
2305
2306.IF "$(SHL9VERSIONMAP)"!=""
2307.IF "$(DEF9EXPORTFILE)"==""
2308.IF "$(GUI)"=="WNT"
2309DEF9EXPORTFILE=$(MISC)/$(SHL9VERSIONMAP:b)_$(SHL9TARGET).dxp
2310.IF "$(COM)"=="GCC"
2311$(DEF9EXPORTFILE) : $(SHL9OBJS) $(SHL9LIBS)
2312.ENDIF # .IF "$(COM)"=="GCC"
2313
2314$(DEF9EXPORTFILE) : $(SHL9VERSIONMAP)
2315	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
2316.IF "$(COM)"=="GCC"
2317	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
2318	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
2319# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
2320# Extract RTTI symbols from all the objects that will be used to build a shared library
2321	$(COMMAND_ECHO)nm -gP $(SHL9OBJS) \
2322		`$(TYPE) /dev/null $(foreach,j,$(SHL9LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
2323		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
2324# overwrite the map file generate into the local output tree with the generated
2325# exported symbols list
2326	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
2327.ENDIF # .IF "$(COM)"=="GCC"
2328
2329.ENDIF			# "$(GUI)"=="WNT"
2330
2331.IF "$(GUI)"=="OS2"
2332DEF9EXPORTFILE=$(MISC)/$(SHL9VERSIONMAP:b)_$(SHL9TARGET).dxp
2333$(DEF9EXPORTFILE) : $(SHL9VERSIONMAP)
2334	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
2335.ENDIF			# "$(GUI)"=="OS2"
2336
2337.ENDIF			# "$(DEF9EXPORTFILE)"==""
2338.ENDIF			# "$(SHL9VERSIONMAP)"!=""
2339
2340.IF "$(GUI)"=="WNT"
2341
2342DEF9FILTER=$(SOLARENV)/inc/dummy.flt
2343
2344RMHACK9:=$(RM)
2345
2346.IF "$(DEF9CEXP)"!=""
2347EXPORT_ALL_SWITCH=-A $(DEF9CEXP)
2348.ENDIF
2349
2350.IF "$(link_always)"==""
2351$(DEF9TARGETN) : \
2352		$(DEF9DEPN) \
2353		$(DEF9EXPORTFILE)
2354.ELSE			# "$(link_always)"==""
2355$(DEF9TARGETN) .PHONY :
2356.ENDIF			# "$(link_always)"==""
2357	@-$(RM) $@.tmpfile
2358	@echo "Making:    module definition file" $(@:f)
2359	@echo LIBRARY	  $(EMQ)"$(SHL9TARGETN:f)$(EMQ)" 								 >$@.tmpfile
2360.IF "$(COM)"!="GCC"
2361	@echo HEAPSIZE	  0 											>>$@.tmpfile
2362.ENDIF
2363	@echo EXPORTS													>>$@.tmpfile
2364.IF "$(VERSIONOBJ)"!=""
2365#	getversioninfo fuer alle!!
2366	@echo GetVersionInfo		>>$@.tmpfile
2367.ENDIF
2368.IF "$(DEFLIB9NAME)"!=""
2369.IF "$(COM)"=="GCC"
2370	@-$(RM) $(MISC)/$(SHL9TARGET).exp
2371	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL9TARGET).exp --export-all-symbols \
2372		`$(TYPE) $(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
2373	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL9TARGET).exp | sed '/^;/d' >>$@.tmpfile
2374	@-$(RM) $(MISC)/$(SHL9TARGET).exp
2375.ELSE
2376.IF "$(SHL9USE_EXPORTS)"==""
2377	@-$(RMHACK9) $(MISC)/$(SHL9TARGET).exp
2378	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL9TARGET).exp $(SLB)/$(DEFLIB9NAME).lib
2379	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL9TARGET).flt $(MISC)/$(SHL9TARGET).exp			   >>$@.tmpfile
2380	$(COMMAND_ECHO)$(RMHACK9) $(MISC)/$(SHL9TARGET).exp
2381.ELSE			# "$(SHL9USE_EXPORTS)"==""
2382	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL9TARGET).direct
2383	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF9FILTER) $(MISC)/$(SHL9TARGET).direct >>$@.tmpfile
2384.ENDIF			# "$(SHL9USE_EXPORTS)"==""
2385.ENDIF
2386.ENDIF				# "$(DEFLIB9NAME)"!=""
2387.IF "$(DEF9EXPORT1)"!=""
2388	@echo $(DEF9EXPORT1)										>>$@.tmpfile
2389.ENDIF
2390.IF "$(DEF9EXPORT2)"!=""
2391	@echo $(DEF9EXPORT2)										>>$@.tmpfile
2392.ENDIF
2393.IF "$(DEF9EXPORT3)"!=""
2394	@echo $(DEF9EXPORT3)										>>$@.tmpfile
2395.ENDIF
2396.IF "$(DEF9EXPORT4)"!=""
2397	@echo $(DEF9EXPORT4)										>>$@.tmpfile
2398.ENDIF
2399.IF "$(DEF9EXPORT5)"!=""
2400	@echo $(DEF9EXPORT5)										>>$@.tmpfile
2401.ENDIF
2402.IF "$(DEF9EXPORT6)"!=""
2403	@echo $(DEF9EXPORT6)										>>$@.tmpfile
2404.ENDIF
2405.IF "$(DEF9EXPORT7)"!=""
2406	@echo $(DEF9EXPORT7)										>>$@.tmpfile
2407.ENDIF
2408.IF "$(DEF9EXPORT8)"!=""
2409	@echo $(DEF9EXPORT8)										>>$@.tmpfile
2410.ENDIF
2411.IF "$(DEF9EXPORT9)"!=""
2412	@echo $(DEF9EXPORT9)										>>$@.tmpfile
2413.ENDIF
2414.IF "$(DEF9EXPORT10)"!=""
2415	@echo $(DEF9EXPORT10)										>>$@.tmpfile
2416.ENDIF
2417.IF "$(DEF9EXPORT11)"!=""
2418	@echo $(DEF9EXPORT11)										>>$@.tmpfile
2419.ENDIF
2420.IF "$(DEF9EXPORT12)"!=""
2421	@echo $(DEF9EXPORT12)										>>$@.tmpfile
2422.ENDIF
2423.IF "$(DEF9EXPORT13)"!=""
2424	@echo $(DEF9EXPORT13)										>>$@.tmpfile
2425.ENDIF
2426.IF "$(DEF9EXPORT14)"!=""
2427	@echo $(DEF9EXPORT14)										>>$@.tmpfile
2428.ENDIF
2429.IF "$(DEF9EXPORT15)"!=""
2430	@echo $(DEF9EXPORT15)										>>$@.tmpfile
2431.ENDIF
2432.IF "$(DEF9EXPORT16)"!=""
2433	@echo $(DEF9EXPORT16)										>>$@.tmpfile
2434.ENDIF
2435.IF "$(DEF9EXPORT17)"!=""
2436	@echo $(DEF9EXPORT17)										>>$@.tmpfile
2437.ENDIF
2438.IF "$(DEF9EXPORT18)"!=""
2439	@echo $(DEF9EXPORT18)										>>$@.tmpfile
2440.ENDIF
2441.IF "$(DEF9EXPORT19)"!=""
2442	@echo $(DEF9EXPORT19)										>>$@.tmpfile
2443.ENDIF
2444.IF "$(DEF9EXPORT20)"!=""
2445	@echo $(DEF9EXPORT20)										>>$@.tmpfile
2446.ENDIF
2447.IF "$(DEF9EXPORTFILE)"!=""
2448.IF "$(COM)"=="GCC"
2449	$(COMMAND_ECHO)$(TYPE) $(DEF9EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
2450.ELSE
2451	$(COMMAND_ECHO)$(TYPE) $(DEF9EXPORTFILE) >> $@.tmpfile
2452.ENDIF
2453.ENDIF
2454	@-$(RM) $@
2455	@$(RENAME) $@.tmpfile $@
2456.ENDIF			# "$(GUI)"=="WNT"
2457
2458.IF "$(GUI)"=="OS2"
2459
2460#21/02/2006 YD dll names must be 8.3, invoke fix script
2461#check osl/os2/module.c/osl_loadModule()
2462SHL9TARGET8=$(shell @fix_shl.cmd $(SHL9TARGETN:f))
2463
2464DEF9FILTER=$(SOLARENV)/inc/dummy.flt
2465DEF9NAMELIST=$(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib)
2466
2467.IF "$(link_always)"==""
2468$(DEF9TARGETN) : \
2469		$(DEF9DEPN) \
2470		$(DEF9EXPORTFILE)
2471.ELSE			# "$(link_always)"==""
2472$(DEF9TARGETN) .PHONY :
2473.ENDIF			# "$(link_always)"==""
2474	@+-$(RM) $@.tmpfile
2475	@echo "Making:    module definition file" $(@:f)
2476	@echo LIBRARY	  $(SHL9TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
2477	@echo DATA MULTIPLE	 >>$@.tmpfile
2478	@echo EXPORTS													>>$@.tmpfile
2479.IF "$(VERSIONOBJ)"!=""
2480#	getversioninfo fuer alle!!
2481	@echo _GetVersionInfo		>$@.tmp_ord
2482.ENDIF
2483
2484.IF "$(DEFLIB9NAME)"!=""
2485	@+echo $(SLB)/$(DEFLIB9NAME).lib
2486	@+emxexp $(DEF9NAMELIST) | fix_exp_file >> $@.tmp_ord
2487.ENDIF				# "$(DEFLIB9NAME)"!=""
2488
2489.IF "$(DEF9EXPORT1)"!=""
2490	@echo $(DEF9EXPORT1)										>>$@.tmpfile
2491.ENDIF
2492.IF "$(DEF9EXPORT2)"!=""
2493	@echo $(DEF9EXPORT2)										>>$@.tmpfile
2494.ENDIF
2495.IF "$(DEF9EXPORT3)"!=""
2496	@echo $(DEF9EXPORT3)										>>$@.tmpfile
2497.ENDIF
2498.IF "$(DEF9EXPORT4)"!=""
2499	@echo $(DEF9EXPORT4)										>>$@.tmpfile
2500.ENDIF
2501.IF "$(DEF9EXPORT5)"!=""
2502	@echo $(DEF9EXPORT5)										>>$@.tmpfile
2503.ENDIF
2504.IF "$(DEF9EXPORT6)"!=""
2505	@echo $(DEF9EXPORT6)										>>$@.tmpfile
2506.ENDIF
2507.IF "$(DEF9EXPORT7)"!=""
2508	@echo $(DEF9EXPORT7)										>>$@.tmpfile
2509.ENDIF
2510.IF "$(DEF9EXPORT8)"!=""
2511	@echo $(DEF9EXPORT8)										>>$@.tmpfile
2512.ENDIF
2513.IF "$(DEF9EXPORT9)"!=""
2514	@echo $(DEF9EXPORT9)										>>$@.tmpfile
2515.ENDIF
2516.IF "$(DEF9EXPORT10)"!=""
2517	@echo $(DEF9EXPORT10)										>>$@.tmpfile
2518.ENDIF
2519.IF "$(DEF9EXPORT11)"!=""
2520	@echo $(DEF9EXPORT11)										>>$@.tmpfile
2521.ENDIF
2522.IF "$(DEF9EXPORT12)"!=""
2523	@echo $(DEF9EXPORT12)										>>$@.tmpfile
2524.ENDIF
2525.IF "$(DEF9EXPORT13)"!=""
2526	@echo $(DEF9EXPORT13)										>>$@.tmpfile
2527.ENDIF
2528.IF "$(DEF9EXPORT14)"!=""
2529	@echo $(DEF9EXPORT14)										>>$@.tmpfile
2530.ENDIF
2531.IF "$(DEF9EXPORT15)"!=""
2532	@echo $(DEF9EXPORT15)										>>$@.tmpfile
2533.ENDIF
2534.IF "$(DEF9EXPORT16)"!=""
2535	@echo $(DEF9EXPORT16)										>>$@.tmpfile
2536.ENDIF
2537.IF "$(DEF9EXPORT17)"!=""
2538	@echo $(DEF9EXPORT17)										>>$@.tmpfile
2539.ENDIF
2540.IF "$(DEF9EXPORT18)"!=""
2541	@echo $(DEF9EXPORT18)										>>$@.tmpfile
2542.ENDIF
2543.IF "$(DEF9EXPORT19)"!=""
2544	@echo $(DEF9EXPORT19)										>>$@.tmpfile
2545.ENDIF
2546.IF "$(DEF9EXPORT20)"!=""
2547	@echo $(DEF9EXPORT20)										>>$@.tmpfile
2548.ENDIF
2549.IF "$(DEF9EXPORTFILE)"!=""
2550	@fix_def_file < $(DEF9EXPORTFILE) >> $@.tmp_ord
2551.ENDIF
2552	@sort < $@.tmp_ord | uniq > $@.exptmpfile
2553	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
2554	@+-$(RM) $@
2555	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
2556	@+-$(RM) $@.tmp_ord
2557	@+-$(RM) $@.exptmpfile
2558.IF "$(SHL9USE_EXPORTS)"=="" || "$(SHL9USE_EXPORTS)"=="ordinal"
2559#03/11/2012  if 'name' is not used, export from def file (with ordinals)
2560	@echo Build import library from DEF file.
2561	@+-$(RM) $(LB)/$(SHL9TARGETN:b).lib
2562	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL9TARGETN:b).lib $@
2563.ENDIF			# "$(SHL9USE_EXPORTS)"==""
2564
2565.ENDIF			# "$(GUI)"=="OS2"
2566
2567.IF "$(GUI)"=="UNX"
2568$(DEF9TARGETN): \
2569		$(DEF9DEPN) \
2570		$(DEF9EXPORTFILE)
2571	@echo just a dummy for UNIX > $@
2572.ENDIF
2573.ENDIF			# "$(DEF9TARGETN)"!=""
2574
2575
2576# Anweisungen fuer das Linken
2577# unroll begin
2578
2579.IF "$(DEF10TARGETN)"!=""
2580
2581#to make intuitiv naming work
2582.IF "$(DEF10LIBNAME)"!=""
2583DEFLIB10NAME*=$(DEF10LIBNAME)
2584.ENDIF			# "$(DEF10LIBNAME)"!=""
2585
2586.IF "$(DEFLIB10NAME)"!=""
2587DEF10DEPN+=$(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib)
2588.ENDIF
2589
2590.IF "$(SHL10VERSIONMAP)"!=""
2591.IF "$(DEF10EXPORTFILE)"==""
2592.IF "$(GUI)"=="WNT"
2593DEF10EXPORTFILE=$(MISC)/$(SHL10VERSIONMAP:b)_$(SHL10TARGET).dxp
2594.IF "$(COM)"=="GCC"
2595$(DEF10EXPORTFILE) : $(SHL10OBJS) $(SHL10LIBS)
2596.ENDIF # .IF "$(COM)"=="GCC"
2597
2598$(DEF10EXPORTFILE) : $(SHL10VERSIONMAP)
2599	$(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
2600.IF "$(COM)"=="GCC"
2601	$(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
2602	$(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
2603# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
2604# Extract RTTI symbols from all the objects that will be used to build a shared library
2605	$(COMMAND_ECHO)nm -gP $(SHL10OBJS) \
2606		`$(TYPE) /dev/null $(foreach,j,$(SHL10LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
2607		| $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
2608# overwrite the map file generate into the local output tree with the generated
2609# exported symbols list
2610	$(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
2611.ENDIF # .IF "$(COM)"=="GCC"
2612
2613.ENDIF			# "$(GUI)"=="WNT"
2614
2615.IF "$(GUI)"=="OS2"
2616DEF10EXPORTFILE=$(MISC)/$(SHL10VERSIONMAP:b)_$(SHL10TARGET).dxp
2617$(DEF10EXPORTFILE) : $(SHL10VERSIONMAP)
2618	$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
2619.ENDIF			# "$(GUI)"=="OS2"
2620
2621.ENDIF			# "$(DEF10EXPORTFILE)"==""
2622.ENDIF			# "$(SHL10VERSIONMAP)"!=""
2623
2624.IF "$(GUI)"=="WNT"
2625
2626DEF10FILTER=$(SOLARENV)/inc/dummy.flt
2627
2628RMHACK10:=$(RM)
2629
2630.IF "$(DEF10CEXP)"!=""
2631EXPORT_ALL_SWITCH=-A $(DEF10CEXP)
2632.ENDIF
2633
2634.IF "$(link_always)"==""
2635$(DEF10TARGETN) : \
2636		$(DEF10DEPN) \
2637		$(DEF10EXPORTFILE)
2638.ELSE			# "$(link_always)"==""
2639$(DEF10TARGETN) .PHONY :
2640.ENDIF			# "$(link_always)"==""
2641	@-$(RM) $@.tmpfile
2642	@echo "Making:    module definition file" $(@:f)
2643	@echo LIBRARY	  $(EMQ)"$(SHL10TARGETN:f)$(EMQ)" 								 >$@.tmpfile
2644.IF "$(COM)"!="GCC"
2645	@echo HEAPSIZE	  0 											>>$@.tmpfile
2646.ENDIF
2647	@echo EXPORTS													>>$@.tmpfile
2648.IF "$(VERSIONOBJ)"!=""
2649#	getversioninfo fuer alle!!
2650	@echo GetVersionInfo		>>$@.tmpfile
2651.ENDIF
2652.IF "$(DEFLIB10NAME)"!=""
2653.IF "$(COM)"=="GCC"
2654	@-$(RM) $(MISC)/$(SHL10TARGET).exp
2655	$(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL10TARGET).exp --export-all-symbols \
2656		`$(TYPE) $(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
2657	$(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL10TARGET).exp | sed '/^;/d' >>$@.tmpfile
2658	@-$(RM) $(MISC)/$(SHL10TARGET).exp
2659.ELSE
2660.IF "$(SHL10USE_EXPORTS)"==""
2661	@-$(RMHACK10) $(MISC)/$(SHL10TARGET).exp
2662	@$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL10TARGET).exp $(SLB)/$(DEFLIB10NAME).lib
2663	@$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL10TARGET).flt $(MISC)/$(SHL10TARGET).exp			   >>$@.tmpfile
2664	$(COMMAND_ECHO)$(RMHACK10) $(MISC)/$(SHL10TARGET).exp
2665.ELSE			# "$(SHL10USE_EXPORTS)"==""
2666	@$(DUMPBIN) -DIRECTIVES  $(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL10TARGET).direct
2667	@$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF10FILTER) $(MISC)/$(SHL10TARGET).direct >>$@.tmpfile
2668.ENDIF			# "$(SHL10USE_EXPORTS)"==""
2669.ENDIF
2670.ENDIF				# "$(DEFLIB10NAME)"!=""
2671.IF "$(DEF10EXPORT1)"!=""
2672	@echo $(DEF10EXPORT1)										>>$@.tmpfile
2673.ENDIF
2674.IF "$(DEF10EXPORT2)"!=""
2675	@echo $(DEF10EXPORT2)										>>$@.tmpfile
2676.ENDIF
2677.IF "$(DEF10EXPORT3)"!=""
2678	@echo $(DEF10EXPORT3)										>>$@.tmpfile
2679.ENDIF
2680.IF "$(DEF10EXPORT4)"!=""
2681	@echo $(DEF10EXPORT4)										>>$@.tmpfile
2682.ENDIF
2683.IF "$(DEF10EXPORT5)"!=""
2684	@echo $(DEF10EXPORT5)										>>$@.tmpfile
2685.ENDIF
2686.IF "$(DEF10EXPORT6)"!=""
2687	@echo $(DEF10EXPORT6)										>>$@.tmpfile
2688.ENDIF
2689.IF "$(DEF10EXPORT7)"!=""
2690	@echo $(DEF10EXPORT7)										>>$@.tmpfile
2691.ENDIF
2692.IF "$(DEF10EXPORT8)"!=""
2693	@echo $(DEF10EXPORT8)										>>$@.tmpfile
2694.ENDIF
2695.IF "$(DEF10EXPORT9)"!=""
2696	@echo $(DEF10EXPORT9)										>>$@.tmpfile
2697.ENDIF
2698.IF "$(DEF10EXPORT10)"!=""
2699	@echo $(DEF10EXPORT10)										>>$@.tmpfile
2700.ENDIF
2701.IF "$(DEF10EXPORT11)"!=""
2702	@echo $(DEF10EXPORT11)										>>$@.tmpfile
2703.ENDIF
2704.IF "$(DEF10EXPORT12)"!=""
2705	@echo $(DEF10EXPORT12)										>>$@.tmpfile
2706.ENDIF
2707.IF "$(DEF10EXPORT13)"!=""
2708	@echo $(DEF10EXPORT13)										>>$@.tmpfile
2709.ENDIF
2710.IF "$(DEF10EXPORT14)"!=""
2711	@echo $(DEF10EXPORT14)										>>$@.tmpfile
2712.ENDIF
2713.IF "$(DEF10EXPORT15)"!=""
2714	@echo $(DEF10EXPORT15)										>>$@.tmpfile
2715.ENDIF
2716.IF "$(DEF10EXPORT16)"!=""
2717	@echo $(DEF10EXPORT16)										>>$@.tmpfile
2718.ENDIF
2719.IF "$(DEF10EXPORT17)"!=""
2720	@echo $(DEF10EXPORT17)										>>$@.tmpfile
2721.ENDIF
2722.IF "$(DEF10EXPORT18)"!=""
2723	@echo $(DEF10EXPORT18)										>>$@.tmpfile
2724.ENDIF
2725.IF "$(DEF10EXPORT19)"!=""
2726	@echo $(DEF10EXPORT19)										>>$@.tmpfile
2727.ENDIF
2728.IF "$(DEF10EXPORT20)"!=""
2729	@echo $(DEF10EXPORT20)										>>$@.tmpfile
2730.ENDIF
2731.IF "$(DEF10EXPORTFILE)"!=""
2732.IF "$(COM)"=="GCC"
2733	$(COMMAND_ECHO)$(TYPE) $(DEF10EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
2734.ELSE
2735	$(COMMAND_ECHO)$(TYPE) $(DEF10EXPORTFILE) >> $@.tmpfile
2736.ENDIF
2737.ENDIF
2738	@-$(RM) $@
2739	@$(RENAME) $@.tmpfile $@
2740.ENDIF			# "$(GUI)"=="WNT"
2741
2742.IF "$(GUI)"=="OS2"
2743
2744#21/02/2006 YD dll names must be 8.3, invoke fix script
2745#check osl/os2/module.c/osl_loadModule()
2746SHL10TARGET8=$(shell @fix_shl.cmd $(SHL10TARGETN:f))
2747
2748DEF10FILTER=$(SOLARENV)/inc/dummy.flt
2749DEF10NAMELIST=$(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib)
2750
2751.IF "$(link_always)"==""
2752$(DEF10TARGETN) : \
2753		$(DEF10DEPN) \
2754		$(DEF10EXPORTFILE)
2755.ELSE			# "$(link_always)"==""
2756$(DEF10TARGETN) .PHONY :
2757.ENDIF			# "$(link_always)"==""
2758	@+-$(RM) $@.tmpfile
2759	@echo "Making:    module definition file" $(@:f)
2760	@echo LIBRARY	  $(SHL10TARGET8) INITINSTANCE TERMINSTANCE	 >$@.tmpfile
2761	@echo DATA MULTIPLE	 >>$@.tmpfile
2762	@echo EXPORTS													>>$@.tmpfile
2763.IF "$(VERSIONOBJ)"!=""
2764#	getversioninfo fuer alle!!
2765	@echo _GetVersionInfo		>$@.tmp_ord
2766.ENDIF
2767
2768.IF "$(DEFLIB10NAME)"!=""
2769	@+echo $(SLB)/$(DEFLIB10NAME).lib
2770	@+emxexp $(DEF10NAMELIST) | fix_exp_file >> $@.tmp_ord
2771.ENDIF				# "$(DEFLIB10NAME)"!=""
2772
2773.IF "$(DEF10EXPORT1)"!=""
2774	@echo $(DEF10EXPORT1)										>>$@.tmpfile
2775.ENDIF
2776.IF "$(DEF10EXPORT2)"!=""
2777	@echo $(DEF10EXPORT2)										>>$@.tmpfile
2778.ENDIF
2779.IF "$(DEF10EXPORT3)"!=""
2780	@echo $(DEF10EXPORT3)										>>$@.tmpfile
2781.ENDIF
2782.IF "$(DEF10EXPORT4)"!=""
2783	@echo $(DEF10EXPORT4)										>>$@.tmpfile
2784.ENDIF
2785.IF "$(DEF10EXPORT5)"!=""
2786	@echo $(DEF10EXPORT5)										>>$@.tmpfile
2787.ENDIF
2788.IF "$(DEF10EXPORT6)"!=""
2789	@echo $(DEF10EXPORT6)										>>$@.tmpfile
2790.ENDIF
2791.IF "$(DEF10EXPORT7)"!=""
2792	@echo $(DEF10EXPORT7)										>>$@.tmpfile
2793.ENDIF
2794.IF "$(DEF10EXPORT8)"!=""
2795	@echo $(DEF10EXPORT8)										>>$@.tmpfile
2796.ENDIF
2797.IF "$(DEF10EXPORT9)"!=""
2798	@echo $(DEF10EXPORT9)										>>$@.tmpfile
2799.ENDIF
2800.IF "$(DEF10EXPORT10)"!=""
2801	@echo $(DEF10EXPORT10)										>>$@.tmpfile
2802.ENDIF
2803.IF "$(DEF10EXPORT11)"!=""
2804	@echo $(DEF10EXPORT11)										>>$@.tmpfile
2805.ENDIF
2806.IF "$(DEF10EXPORT12)"!=""
2807	@echo $(DEF10EXPORT12)										>>$@.tmpfile
2808.ENDIF
2809.IF "$(DEF10EXPORT13)"!=""
2810	@echo $(DEF10EXPORT13)										>>$@.tmpfile
2811.ENDIF
2812.IF "$(DEF10EXPORT14)"!=""
2813	@echo $(DEF10EXPORT14)										>>$@.tmpfile
2814.ENDIF
2815.IF "$(DEF10EXPORT15)"!=""
2816	@echo $(DEF10EXPORT15)										>>$@.tmpfile
2817.ENDIF
2818.IF "$(DEF10EXPORT16)"!=""
2819	@echo $(DEF10EXPORT16)										>>$@.tmpfile
2820.ENDIF
2821.IF "$(DEF10EXPORT17)"!=""
2822	@echo $(DEF10EXPORT17)										>>$@.tmpfile
2823.ENDIF
2824.IF "$(DEF10EXPORT18)"!=""
2825	@echo $(DEF10EXPORT18)										>>$@.tmpfile
2826.ENDIF
2827.IF "$(DEF10EXPORT19)"!=""
2828	@echo $(DEF10EXPORT19)										>>$@.tmpfile
2829.ENDIF
2830.IF "$(DEF10EXPORT20)"!=""
2831	@echo $(DEF10EXPORT20)										>>$@.tmpfile
2832.ENDIF
2833.IF "$(DEF10EXPORTFILE)"!=""
2834	@fix_def_file < $(DEF10EXPORTFILE) >> $@.tmp_ord
2835.ENDIF
2836	@sort < $@.tmp_ord | uniq > $@.exptmpfile
2837	@fix_def_ord < $@.exptmpfile >> $@.tmpfile
2838	@+-$(RM) $@
2839	$(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
2840	@+-$(RM) $@.tmp_ord
2841	@+-$(RM) $@.exptmpfile
2842.IF "$(SHL10USE_EXPORTS)"=="" || "$(SHL10USE_EXPORTS)"=="ordinal"
2843#03/11/2012  if 'name' is not used, export from def file (with ordinals)
2844	@echo Build import library from DEF file.
2845	@+-$(RM) $(LB)/$(SHL10TARGETN:b).lib
2846	$(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(LB)/$(SHL10TARGETN:b).lib $@
2847.ENDIF			# "$(SHL10USE_EXPORTS)"==""
2848
2849.ENDIF			# "$(GUI)"=="OS2"
2850
2851.IF "$(GUI)"=="UNX"
2852$(DEF10TARGETN): \
2853		$(DEF10DEPN) \
2854		$(DEF10EXPORTFILE)
2855	@echo just a dummy for UNIX > $@
2856.ENDIF
2857.ENDIF			# "$(DEF10TARGETN)"!=""
2858
2859
2860# Anweisungen fuer das Linken
2861