xref: /aoo41x/main/solenv/inc/_tg_shl.mk (revision cdf0e10c)
1# unroll begin
2
3.IF "$(SHL1TARGETN)"!=""
4
5.IF "$(OS)"=="AIX"
6SHL1STDLIBS=
7.ENDIF
8
9.IF "$(SHLLINKARCONLY)" != ""
10SHL1STDLIBS=
11STDSHL=
12.ELSE
13SHL1ARCHIVES=
14.ENDIF
15
16# decide how to link
17.IF "$(SHL1CODETYPE)"=="C"
18SHL1LINKER=$(LINKC)
19SHL1STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
20SHL1LINKFLAGS+=$(LINKCFLAGS)
21.ELSE			# "$(SHL1CODETYPE)"=="C"
22SHL1LINKER=$(LINK)
23SHL1STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
24SHL1LINKFLAGS+=$(LINKFLAGS)
25.ENDIF			# "$(SHL1CODETYPE)"=="C"
26
27SHL1RPATH*=OOO
28LINKFLAGSRUNPATH_$(SHL1RPATH)*=/ERROR:/Bad_SHL1RPATH_value
29SHL1LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL1RPATH))
30
31.IF "$(SHL1USE_EXPORTS)"==""
32SHL1DEF*=$(MISC)/$(SHL1TARGET).def
33.ENDIF			# "$(SHL1USE_EXPORTS)"==""
34
35EXTRALIBPATHS1=$(EXTRALIBPATHS)
36.IF "$(UPDATER)"=="YES"
37.IF "$(SHL1NOCHECK)"==""
38.IF "$(SOLAR_STLLIBPATH)"!=""
39EXTRALIBPATHS1+=-L$(SOLAR_STLLIBPATH)
40.ENDIF
41.ENDIF				# "$(SHL1NOCHECK)"!=""
42.ENDIF
43#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
44#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
45#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
46
47.IF "$(L10N_framework)"==""
48.IF "$(VERSIONOBJ)"!=""
49SHL1VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL1TARGET))}$(VERSIONOBJ:f)
50USE_VERSIONH:=$(INCCOM)/$(SHL1VERSIONOBJ:b).h
51.IF "$(GUI)" == "UNX"
52SHL1VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL1TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
53.ELSE           # "$(GUI)" == "UNX"
54SHL1VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL1TARGET))}$(VERSIONOBJ:f)
55.ENDIF          # "$(GUI)" == "UNX"
56$(MISC)/$(SHL1VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL1VERSIONOBJ:b).h
57#    $(COPY) $(SOLARENV)/src/version.c $@
58	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL1VERSIONOBJ:b).h/ > $@
59
60.INIT : $(SHL1VERSIONOBJDEP)
61.ENDIF			# "$(VERSIONOBJ)"!=""
62.ENDIF
63
64.IF "$(GUI)" != "UNX"
65.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
66.IF "$(SHL1IMPLIB)" == ""
67SHL1IMPLIB=i$(TARGET)_t1
68.ENDIF			# "$(SHL1IMPLIB)" == ""
69.IF "$(COM)" != "GCC"
70USE_1IMPLIB=-implib:$(LB)/$(SHL1IMPLIB).lib
71.ENDIF			# "$(COM)" != "GCC"
72SHL1IMPLIBN=$(LB)/$(SHL1IMPLIB).lib
73ALLTAR : $(SHL1IMPLIBN)
74
75.IF "$(USE_DEFFILE)"==""
76USE_1IMPLIB_DEPS=$(LB)/$(SHL1IMPLIB).lib
77.ENDIF			# "$(USE_DEFFILE)"==""
78.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
79USE_SHL1DEF=$(SHL1DEF)
80.ELSE			# "$(GUI)" != "UNX"
81USE_SHL1DEF=
82SHL1DEPN+:=$(SHL1DEPNU)
83
84.IF "$(SHL1VERSIONMAP)"==""
85# to activate vmaps remove "#"
86USE_SHL1VERSIONMAP=$(MISC)/$(SHL1TARGET).vmap
87.ENDIF			# "$(SHL1VERSIONMAP)"==""
88
89.IF "$(USE_SHL1VERSIONMAP)"!=""
90
91.IF "$(SHL1FILTERFILE)"!=""
92.IF "$(SHL1VERSIONMAP)"!=""
93#eine von beiden ist zuviel
94USE_SHL1VERSIONMAP=$(MISC)/$(SHL1TARGET).vmap
95$(USE_SHL1VERSIONMAP) .PHONY:
96	@echo -----------------------------
97	@echo you should only use versionmap OR exportfile
98	@echo -----------------------------
99#	force_dmake_to_error
100
101.ENDIF			# "$(SHL1VERSIONMAP)"!=""
102
103SHL1VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL1VERSIONMAP)
104
105$(USE_SHL1VERSIONMAP): \
106					$(SHL1OBJS)\
107					$(SHL1LIBS)\
108					$(SHL1FILTERFILE)
109	@$(RM) $@.dump
110.IF "$(SHL1OBJS)"!=""
111# dump remaining objects on the fly
112.IF "$(OS)"=="MACOSX"
113	@-nm $(SHL1OBJS:s/.obj/.o/) > $@.dump
114.ELSE
115	@nm $(SHL1OBJS:s/.obj/.o/) > $@.dump
116.ENDIF
117.ENDIF			# "$(SHL1OBJS)!"=""
118	@$(TYPE) /dev/null $(SHL1LIBS:s/.lib/.dump/) >> $@.dump
119	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL1INTERFACE) -f $(SHL1FILTERFILE) -m $@
120
121.ELSE			# "$(SHL1FILTERFILE)"!=""
122USE_SHL1VERSIONMAP=$(MISC)/$(SHL1TARGET).vmap
123$(USE_SHL1VERSIONMAP) :
124.IF "$(VERBOSE)" == "TRUE"
125	@echo -----------------------------
126	@echo SHL1FILTERFILE not set!
127	@echo -----------------------------
128	@$(TOUCH) $@
129	@echo dummy file to keep the dependencies for later use.
130.ELSE
131	@$(TOUCH) $@
132.ENDIF
133#	force_dmake_to_error
134.ENDIF			# "$(SHL1FILTERFILE)"!=""
135.ELSE			# "$(USE_SHL1VERSIONMAP)"!=""
136
137#and now for the plain non-generic way...
138.IF "$(SHL1VERSIONMAP)"!=""
139USE_SHL1VERSIONMAP=$(MISC)/$(SHL1VERSIONMAP:b)_$(SHL1TARGET)$(SHL1VERSIONMAP:e)
140SHL1VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL1VERSIONMAP)
141
142.IF "$(OS)"=="MACOSX"
143$(USE_SHL1VERSIONMAP): $(SHL1OBJS) $(SHL1LIBS)
144.ENDIF
145
146# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
147# even if the $(AWK) part fails:
148$(USE_SHL1VERSIONMAP) .ERRREMOVE: $(SHL1VERSIONMAP)
149	@@-$(RM) -f $@
150# The following files will only be generated and needed on Mac OS X as temporary files
151# in order to generate exported symbols list out of Linux/Solaris map files
152.IF "$(OS)"=="MACOSX"
153	@-$(RM) -f $@.symregexp >& $(NULLDEV)
154	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
155.ENDIF
156# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
157# happens if somebody will change it in the future
158.IF "$(COMID)"=="gcc3"
159	$(COMMAND_ECHO) tr -d "\015" < $(SHL1VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
160.ELIF "$(COMNAME)"=="sunpro5"
161	$(COMMAND_ECHO) tr -d "\015" < $(SHL1VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
162.ELSE           # "$(COMID)"=="gcc3"
163	$(COMMAND_ECHO) tr -d "\015" < $(SHL1VERSIONMAP) > $@
164.ENDIF          # "$(COMID)"=="gcc3"
165	@chmod a+w $@
166# Mac OS X post-processing generate an exported symbols list from the generated map file
167# for details on exported symbols list see man ld on Mac OS X
168.IF "$(OS)"=="MACOSX"
169	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
170	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
171# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
172# Extract RTTI symbols from all the objects that will be used to build a shared library
173.IF "$(SHL1OBJS)"!=""
174	-echo $(foreach,i,$(SHL1OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
175.ENDIF
176.IF "$(SHL1LIBS)"!=""
177	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL1LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
178.ENDIF
179# overwrite the map file generate into the local output tree with the generated
180# exported symbols list
181	cp $@.exported-symbols $@
182.ENDIF # .IF "$(OS)"=="MACOSX"
183.ENDIF			# "$(SHL1VERSIONMAP)"!=""
184.ENDIF			# "$(USE_SHL1VERSIONMAP)"!=""
185.ENDIF			# "$(GUI)" != "UNX"
186
187.IF "$(UNIXVERSIONNAMES)"!=""
188.IF "$(OS)"!="MACOSX"
189.IF "$(GUI)"=="UNX"
190SHL1SONAME=\"$(SONAME_SWITCH)$(SHL1TARGETN:f)\"
191.ENDIF			# "$(GUI)"!="UNX"
192.ENDIF			# "$(OS)"!="MACOSX"
193.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
194
195.IF "$(SHL1RES)"!=""
196SHL1ALLRES+=$(SHL1RES)
197SHL1LINKRES*=$(MISC)/$(SHL1TARGET).res
198SHL1LINKRESO*=$(MISC)/$(SHL1TARGET)_res.o
199.ENDIF			# "$(SHL1RES)"!=""
200
201.IF "$(SHL1DEFAULTRES)$(use_shl_versions)"!=""
202SHL1DEFAULTRES*=$(MISC)/$(SHL1TARGET)_def.res
203SHL1ALLRES+=$(SHL1DEFAULTRES)
204SHL1LINKRES*=$(MISC)/$(SHL1TARGET).res
205SHL1LINKRESO*=$(MISC)/$(SHL1TARGET)_res.o
206.ENDIF			# "$(SHL1DEFAULTRES)$(use_shl_versions)"!=""
207
208#.IF "$(SHL1TARGETN)"!=""
209
210.IF "$(linkinc)"!=""
211.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
212.IF "$(SHL1LIBS)"!=""
213$(MISC)/$(SHL1TARGET)_linkinc.ls .PHONY:
214	@@-$(RM) $@
215	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL1LIBS) $(i:s/.lib/.lin/)) >> $@
216.ENDIF          # "$(SHL1LIBS)"!=""
217.ENDIF
218
219LINKINCTARGETS+=$(MISC)/$(SHL1TARGETN:b)_linkinc.ls
220$(SHL1TARGETN) : $(LINKINCTARGETS)
221
222.ELSE
223.IF "$(SHL1USE_EXPORTS)"=="name"
224.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
225.IF "$(COM)"!="GCC"
226.IF "$(SHL1LIBS)"!=""
227SHL1LINKLIST=$(MISC)/$(SHL1TARGET)_link.lst
228SHL1LINKLISTPARAM=@$(SHL1LINKLIST)
229$(SHL1LINKLIST) : $(SHL1LIBS)
230    @@-$(RM) $@
231	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL1LIBS) $(i:s/.lib/.lin/)) >> $@
232.ENDIF          # "$(SHL1LIBS)"!=""
233.ENDIF          # "$(COM)"!="GCC"
234.ENDIF
235.ENDIF			# "$(SHL1USE_EXPORTS)"=="name"
236
237$(MISC)/%linkinc.ls:
238	@echo . > $@
239.ENDIF          # "$(linkinc)"!=""
240
241.IF "$(GUI)" == "OS2"
242#21/02/2006 YD dll names must be 8.3, invoke fix script
243#check osl/os2/module.c/osl_loadModule()
244SHL1TARGET8=$(shell @fix_shl $(SHL1TARGET))
245.ENDIF
246
247.IF "$(GUI)" == "OS2"
248_SHL1IMP_ORD = $(SHL1STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL1STDLIBS:^"$(LB)/")
249SHL1IMP_ORD = $(foreach,i,$(_SHL1IMP_ORD) $(shell @-ls $i))
250.ELSE
251SHL1IMP_ORD =
252.ENDIF
253
254
255$(SHL1TARGETN) : \
256					$(SHL1OBJS)\
257					$(SHL1LIBS)\
258					$(USE_1IMPLIB_DEPS)\
259					$(USE_SHL1DEF)\
260					$(USE_SHL1VERSIONMAP)\
261					$(SHL1RES)\
262					$(SHL1DEPN) \
263					$(SHL1IMP_ORD) \
264					$(SHL1LINKLIST)
265	@echo "Making:   " $(@:f)
266.IF "$(GUI)" == "WNT"
267.IF "$(SHL1DEFAULTRES)"!=""
268	@@-$(RM) $(MISC)/$(SHL1DEFAULTRES:b).rc
269.IF "$(SHL1ICON)" != ""
270	@echo 1 ICON $(SHL1ICON) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
271.ENDIF
272.IF "$(use_shl_versions)" != ""
273.IF "$(SHL1ADD_VERINFO)"!=""
274	@echo $(EMQ)#include $(EMQ)"$(SHL1ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL1DEFAULTRES:b).rc
275.ELSE			# "$(SHL1ADD_VERINFO)"!=""
276	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL1DEFAULTRES:b).rc
277	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL1DEFAULTRES:b).rc
278	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL1DEFAULTRES:b).rc
279.ENDIF			# "$(SHL1ADD_VERINFO)"!=""
280	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
281	@echo $(EMQ)#define ORG_NAME	$(SHL1TARGET)$(DLLPOST) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
282	@echo $(EMQ)#define INTERNAL_NAME $(SHL1TARGET:b) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
283	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL1DEFAULTRES:b).rc
284.ENDIF			# "$(use_shl_versions)" != ""
285	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL1DEFAULTRES:b).rc
286.ENDIF			# "$(SHL1DEFAULTRES)"!=""
287.IF "$(SHL1ALLRES)"!=""
288	$(COMMAND_ECHO)$(TYPE) $(SHL1ALLRES) > $(SHL1LINKRES)
289.IF "$(COM)"=="GCC"
290	windres $(SHL1LINKRES) $(SHL1LINKRESO)
291.ENDIF			# "$(COM)"=="GCC"
292.ENDIF			# "$(SHL1ALLRES)"!=""
293.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
294	@echo dlltool --dllname $(SHL1TARGET)$(DLLPOST) \
295		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_1.cmd
296	@noop $(assign ALL1OBJLIST:=$(STDOBJ) $(SHL1OBJS) $(SHL1LINKRESO) $(shell $(TYPE) /dev/null $(SHL1LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
297.IF "$(DEFLIB1NAME)"!=""	# do not have to include objs
298	@noop $(assign DEF1OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
299	@noop $(foreach,i,$(DEF1OBJLIST) $(assign ALL1OBJLIST:=$(ALL1OBJLIST:s?$i??)))
300.ENDIF			# "$(DEFLIB1NAME)"!=""
301	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
302.IF "$(SHL1DEF)"!=""
303	@echo	--input-def $(SHL1DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
304.ELSE
305	@echo	$(SHL1VERSIONOBJ) $(SHL1DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
306.ENDIF
307	@echo	$(ALL1OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_1.cmd
308	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
309		$(STDOBJ) $(SHL1VERSIONOBJ) $(SHL1DESCRIPTIONOBJ) $(SHL1OBJS) $(SHL1LINKRESO) \
310		`$(TYPE) /dev/null $(SHL1LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
311		-Wl,--exclude-libs,ALL,--start-group $(SHL1STDLIBS) -Wl,--end-group \
312		$(SHL1STDSHL) $(STDSHL1) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
313		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_1.cmd
314  .IF "$(VERBOSE)" == "TRUE"
315	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_1.cmd
316  .ENDIF
317	@+source $(MISC)/$(TARGET).$(@:b)_1.cmd
318.ELSE
319.IF "$(linkinc)"==""
320.IF "$(SHL1USE_EXPORTS)"!="name"
321.IF "$(USE_DEFFILE)"!=""
322	$(COMMAND_ECHO)$(SHL1LINKER) @$(mktmp \
323		$(SHL1LINKFLAGS) \
324		$(LINKFLAGSSHL) \
325		$(SHL1STACK) $(SHL1BASEX)	\
326		-out:$@ \
327		-map:$(MISC)/$(@:b).map \
328		-def:$(SHL1DEF) \
329		$(USE_1IMPLIB) \
330		$(STDOBJ) \
331		$(SHL1VERSIONOBJ) $(SHL1OBJS) \
332		$(SHL1LIBS) \
333		$(SHL1STDLIBS) \
334		$(SHL1STDSHL) $(STDSHL1) \
335		$(SHL1LINKRES) \
336	)
337# double check if target was really written... still making sense?
338    @@$(LS) $@
339	@echo linking $@.manifest ...
340.IF "$(VISTA_MANIFEST)"!=""
341	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
342	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
343.ELSE
344	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
345.ENDIF # "$(VISTA_MANIFEST)"!=""
346	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
347	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
348.ELSE			# "$(USE_DEFFILE)"!=""
349	$(COMMAND_ECHO)$(SHL1LINKER) @$(mktmp	$(SHL1LINKFLAGS)			\
350		$(LINKFLAGSSHL) $(SHL1BASEX)		\
351		$(SHL1STACK) -out:$(SHL1TARGETN)	\
352		-map:$(MISC)/$(@:B).map				\
353		$(LB)/$(SHL1IMPLIB).exp				\
354		$(STDOBJ)							\
355		$(SHL1OBJS) $(SHL1VERSIONOBJ) \
356		$(SHL1LIBS)                         \
357		$(SHL1STDLIBS)                      \
358		$(SHL1STDSHL) $(STDSHL1)                           \
359		$(SHL1LINKRES) \
360	)
361# double check if target was really written... still making sense?
362    @@$(LS) $@
363	@echo linking $@.manifest ...
364.IF "$(VISTA_MANIFEST)"!=""
365	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
366	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
367.ELSE
368	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
369.ENDIF # "$(VISTA_MANIFEST)"!=""
370	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
371	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
372.ENDIF			# "$(USE_DEFFILE)"!=""
373.ELSE			# "$(SHL1USE_EXPORTS)"!="name"
374	$(COMMAND_ECHO)$(SHL1LINKER) @$(mktmp	$(SHL1LINKFLAGS)			\
375		$(LINKFLAGSSHL) $(SHL1BASEX)		\
376		$(SHL1STACK) -out:$(SHL1TARGETN)	\
377		-map:$(MISC)/$(@:B).map				\
378		$(USE_1IMPLIB) \
379		$(STDOBJ)							\
380		$(SHL1OBJS) $(SHL1VERSIONOBJ))   \
381		$(SHL1LINKLISTPARAM) \
382		@$(mktmp $(SHL1STDLIBS)                      \
383		$(SHL1STDSHL) $(STDSHL1)                           \
384		$(SHL1LINKRES) \
385	)
386	@echo linking $@.manifest ...
387.IF "$(VISTA_MANIFEST)"!=""
388	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
389	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
390.ELSE
391	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
392.ENDIF # "$(VISTA_MANIFEST)"!=""
393	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
394	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
395.ENDIF			# "$(SHL1USE_EXPORTS)"!="name"
396.ELSE			# "$(linkinc)"==""
397		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL1TARGET).lnk
398		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL1TARGET).lst
399		$(COMMAND_ECHO)$(TYPE) $(mktmp \
400		$(SHL1LINKFLAGS) \
401		$(LINKFLAGSSHL) $(SHL1BASEX) \
402		$(SHL1STACK) $(MAPFILE) \
403		-out:$@ \
404		$(LB)/$(SHL1IMPLIB).exp \
405		$(STDOBJ) \
406		$(SHL1OBJS) \
407		$(SHL1STDLIBS) \
408		$(SHL1STDSHL) $(STDSHL1) \
409		$(SHL1LINKRES) \
410		) >> $(MISC)/$(SHL1TARGET).lnk
411		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL1TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL1TARGET).lnk
412		$(COMMAND_ECHO)$(SHL1LINKER) @$(MISC)/$(SHL1TARGET).lnk
413		@echo linking $@.manifest ...
414.IF "$(VISTA_MANIFEST)"!=""
415		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
416		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
417.ELSE
418		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
419.ENDIF # "$(VISTA_MANIFEST)"!=""
420		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
421		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
422.ENDIF			# "$(linkinc)"==""
423.ENDIF			# "$(COM)"=="GCC"
424.ENDIF			# "$(GUI)" == "WNT"
425.IF "$(GUI)"=="UNX"
426.IF "$(OS)"=="MACOSX"
427	@-$(RM) $(MISC)/$(@:b).list
428	@-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
429	@echo $(STDSLO) $(SHL1OBJS:s/.obj/.o/) \
430	$(SHL1VERSIONOBJ) \
431	`cat /dev/null $(SHL1LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
432	@echo -n $(SHL1LINKER) $(SHL1LINKFLAGS) $(SHL1VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
433	$(SHL1STDLIBS) $(SHL1ARCHIVES) $(SHL1STDSHL) $(STDSHL1) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_1.cmd
434    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
435        `cat $(MISC)/$(TARGET).$(@:b)_1.cmd` \
436        >> $(MISC)/$(TARGET).$(@:b)_1.cmd
437  .IF "$(VERBOSE)" == "TRUE"
438	@cat $(MISC)/$(TARGET).$(@:b)_1.cmd
439  .ENDIF
440	@+source $(MISC)/$(TARGET).$(@:b)_1.cmd
441    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
442        shl $(SHL1RPATH) $@
443.IF "$(SHL1CREATEJNILIB)"!=""
444	@echo "Making:   " $(@:f).jnilib
445	@macosx-create-bundle $@
446.ENDIF          # "$(SHL1CREATEJNILIB)"!=""
447.IF "$(UPDATER)"=="YES"
448.IF "$(SHL1NOCHECK)"==""
449	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN)
450.ENDIF				# "$(SHL1NOCHECK)"!=""
451.ENDIF
452.ELSE			# "$(OS)"=="MACOSX"
453	@-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
454	@echo $(SHL1LINKER) $(SHL1LINKFLAGS) $(SHL1SONAME) $(LINKFLAGSSHL) $(SHL1VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL1OBJS:s/.obj/.o/) \
455	$(SHL1VERSIONOBJ) -o $@ \
456	`cat /dev/null $(SHL1LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
457	$(SHL1STDLIBS) $(SHL1ARCHIVES) $(SHL1STDSHL) $(STDSHL1) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_1.cmd
458  .IF "$(VERBOSE)" == "TRUE"
459	@cat $(MISC)/$(TARGET).$(@:b)_1.cmd
460  .ENDIF
461	@+source $(MISC)/$(TARGET).$(@:b)_1.cmd
462.IF "$(UPDATER)"=="YES"
463.IF "$(SHL1NOCHECK)"==""
464	$(COMMAND_ECHO)-$(RM) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
465	$(COMMAND_ECHO)$(RENAME) $(SHL1TARGETN) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
466.IF "$(VERBOSE)"=="TRUE"
467	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
468.ELSE
469	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) -- -s $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
470.ENDIF
471.ENDIF				# "$(SHL1NOCHECK)"!=""
472.ENDIF			# "$(UPDATER)"=="YES"
473.ENDIF			# "$(OS)"=="MACOSX"
474.IF "$(UNIXVERSIONNAMES)"!=""
475	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL1TARGETN:b)
476	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL1TARGETN:f) $(SHL1TARGETN:b)
477.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
478.IF "$(VERBOSE)" == "TRUE"
479	@ls -l $@
480.ENDIF
481.ENDIF			# "$(GUI)" == "UNX"
482
483.IF "$(GUI)" == "OS2"
484
485.IF "$(SHL1DEFAULTRES)"!=""
486	@+-$(RM) $(MISC)/$(SHL1DEFAULTRES:b).rc >& $(NULLDEV)
487.IF "$(SHL1ICON)" != ""
488	@-+echo 1 ICON $(SHL1ICON) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
489.ENDIF
490.IF "$(use_shl_versions)" != ""
491.IF "$(SHL1ADD_VERINFO)"!=""
492	@-+echo $(EMQ)#include $(EMQ)"$(SHL1ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL1DEFAULTRES:b).rc
493.ENDIF			# "$(SHL1ADD_VERINFO)"!=""
494	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL1DEFAULTRES:b).rc
495#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
496.ENDIF			# "$(use_shl_versions)" != ""
497# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
498	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL1DEFAULTRES:b).rc
499.ENDIF			# "$(SHL1DEFAULTRES)"!=""
500
501.IF "$(SHL1ALLRES)"!=""
502	$(COMMAND_ECHO)+$(TYPE) $(SHL1ALLRES) > $(SHL1LINKRES)
503.ENDIF			# "$(SHL1ALLRES)"!=""
504
505.IF "$(USE_DEFFILE)"!=""
506
507	$(COMMAND_ECHO)$(SHL1LINKER) $(SHL1LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
508		$(SHL1DEF) \
509		$(STDOBJ) \
510		-L$(LB) \
511		-L$(SOLARVERSION)/$(INPATH)/lib \
512		$(SHL1OBJS) $(SHL1VERSIONOBJ) \
513		$(SHL1LIBS) \
514		$(SHL1STDLIBS:^"-l") \
515		$(SHL1LINKRES) \
516		$(SHL1STDSHL:^"-l") $(STDSHL1:^"-l")
517
518.ELSE			# "$(USE_DEFFILE)"!=""
519
520	$(COMMAND_ECHO)$(SHL1LINKER) -v 	$(SHL1LINKFLAGS)			\
521		$(LINKFLAGSSHL) $(SHL1BASEX)		\
522		$(SHL1STACK) -o $(SHL1TARGETN)	\
523		$(SHL1DEF) \
524		$(STDOBJ)							\
525		-L$(LB) \
526		-L$(SOLARVERSION)/$(INPATH)/lib \
527		$(SHL1OBJS) $(SHL1VERSIONOBJ) \
528		$(SHL1LIBS) \
529		$(SHL1STDLIBS:^"-l") \
530		$(SHL1LINKRES) \
531		$(SHL1STDSHL:^"-l") $(STDSHL1:^"-l")                           \
532	@$(LS) $@ >& $(NULLDEV)
533
534.ENDIF			# "$(USE_DEFFILE)"!=""
535
536.IF "$(SHL1TARGET8)" != "$(SHL1TARGET)"
537	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL1TARGET8).dll
538.ENDIF
539
540.ENDIF			# "$(GUI)" == "OS2"
541
542.ENDIF			# "$(SHL1TARGETN)"!=""
543
544# unroll begin
545
546.IF "$(SHL2TARGETN)"!=""
547
548.IF "$(OS)"=="AIX"
549SHL2STDLIBS=
550.ENDIF
551
552.IF "$(SHLLINKARCONLY)" != ""
553SHL2STDLIBS=
554STDSHL=
555.ELSE
556SHL2ARCHIVES=
557.ENDIF
558
559# decide how to link
560.IF "$(SHL2CODETYPE)"=="C"
561SHL2LINKER=$(LINKC)
562SHL2STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
563SHL2LINKFLAGS+=$(LINKCFLAGS)
564.ELSE			# "$(SHL2CODETYPE)"=="C"
565SHL2LINKER=$(LINK)
566SHL2STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
567SHL2LINKFLAGS+=$(LINKFLAGS)
568.ENDIF			# "$(SHL2CODETYPE)"=="C"
569
570SHL2RPATH*=OOO
571LINKFLAGSRUNPATH_$(SHL2RPATH)*=/ERROR:/Bad_SHL2RPATH_value
572SHL2LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL2RPATH))
573
574.IF "$(SHL2USE_EXPORTS)"==""
575SHL2DEF*=$(MISC)/$(SHL2TARGET).def
576.ENDIF			# "$(SHL2USE_EXPORTS)"==""
577
578EXTRALIBPATHS2=$(EXTRALIBPATHS)
579.IF "$(UPDATER)"=="YES"
580.IF "$(SHL2NOCHECK)"==""
581.IF "$(SOLAR_STLLIBPATH)"!=""
582EXTRALIBPATHS2+=-L$(SOLAR_STLLIBPATH)
583.ENDIF
584.ENDIF				# "$(SHL2NOCHECK)"!=""
585.ENDIF
586#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
587#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
588#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
589
590.IF "$(L10N_framework)"==""
591.IF "$(VERSIONOBJ)"!=""
592SHL2VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL2TARGET))}$(VERSIONOBJ:f)
593USE_VERSIONH:=$(INCCOM)/$(SHL2VERSIONOBJ:b).h
594.IF "$(GUI)" == "UNX"
595SHL2VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL2TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
596.ELSE           # "$(GUI)" == "UNX"
597SHL2VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL2TARGET))}$(VERSIONOBJ:f)
598.ENDIF          # "$(GUI)" == "UNX"
599$(MISC)/$(SHL2VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL2VERSIONOBJ:b).h
600#    $(COPY) $(SOLARENV)/src/version.c $@
601	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL2VERSIONOBJ:b).h/ > $@
602
603.INIT : $(SHL2VERSIONOBJDEP)
604.ENDIF			# "$(VERSIONOBJ)"!=""
605.ENDIF
606
607.IF "$(GUI)" != "UNX"
608.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
609.IF "$(SHL2IMPLIB)" == ""
610SHL2IMPLIB=i$(TARGET)_t2
611.ENDIF			# "$(SHL2IMPLIB)" == ""
612.IF "$(COM)" != "GCC"
613USE_2IMPLIB=-implib:$(LB)/$(SHL2IMPLIB).lib
614.ENDIF			# "$(COM)" != "GCC"
615SHL2IMPLIBN=$(LB)/$(SHL2IMPLIB).lib
616ALLTAR : $(SHL2IMPLIBN)
617
618.IF "$(USE_DEFFILE)"==""
619USE_2IMPLIB_DEPS=$(LB)/$(SHL2IMPLIB).lib
620.ENDIF			# "$(USE_DEFFILE)"==""
621.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
622USE_SHL2DEF=$(SHL2DEF)
623.ELSE			# "$(GUI)" != "UNX"
624USE_SHL2DEF=
625SHL2DEPN+:=$(SHL2DEPNU)
626
627.IF "$(SHL2VERSIONMAP)"==""
628# to activate vmaps remove "#"
629USE_SHL2VERSIONMAP=$(MISC)/$(SHL2TARGET).vmap
630.ENDIF			# "$(SHL2VERSIONMAP)"==""
631
632.IF "$(USE_SHL2VERSIONMAP)"!=""
633
634.IF "$(SHL2FILTERFILE)"!=""
635.IF "$(SHL2VERSIONMAP)"!=""
636#eine von beiden ist zuviel
637USE_SHL2VERSIONMAP=$(MISC)/$(SHL2TARGET).vmap
638$(USE_SHL2VERSIONMAP) .PHONY:
639	@echo -----------------------------
640	@echo you should only use versionmap OR exportfile
641	@echo -----------------------------
642#	force_dmake_to_error
643
644.ENDIF			# "$(SHL2VERSIONMAP)"!=""
645
646SHL2VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL2VERSIONMAP)
647
648$(USE_SHL2VERSIONMAP): \
649					$(SHL2OBJS)\
650					$(SHL2LIBS)\
651					$(SHL2FILTERFILE)
652	@$(RM) $@.dump
653.IF "$(SHL2OBJS)"!=""
654# dump remaining objects on the fly
655.IF "$(OS)"=="MACOSX"
656	@-nm $(SHL2OBJS:s/.obj/.o/) > $@.dump
657.ELSE
658	@nm $(SHL2OBJS:s/.obj/.o/) > $@.dump
659.ENDIF
660.ENDIF			# "$(SHL2OBJS)!"=""
661	@$(TYPE) /dev/null $(SHL2LIBS:s/.lib/.dump/) >> $@.dump
662	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL2INTERFACE) -f $(SHL2FILTERFILE) -m $@
663
664.ELSE			# "$(SHL2FILTERFILE)"!=""
665USE_SHL2VERSIONMAP=$(MISC)/$(SHL2TARGET).vmap
666$(USE_SHL2VERSIONMAP) :
667.IF "$(VERBOSE)" == "TRUE"
668	@echo -----------------------------
669	@echo SHL2FILTERFILE not set!
670	@echo -----------------------------
671	@$(TOUCH) $@
672	@echo dummy file to keep the dependencies for later use.
673.ELSE
674	@$(TOUCH) $@
675.ENDIF
676#	force_dmake_to_error
677.ENDIF			# "$(SHL2FILTERFILE)"!=""
678.ELSE			# "$(USE_SHL2VERSIONMAP)"!=""
679
680#and now for the plain non-generic way...
681.IF "$(SHL2VERSIONMAP)"!=""
682USE_SHL2VERSIONMAP=$(MISC)/$(SHL2VERSIONMAP:b)_$(SHL2TARGET)$(SHL2VERSIONMAP:e)
683SHL2VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL2VERSIONMAP)
684
685.IF "$(OS)"=="MACOSX"
686$(USE_SHL2VERSIONMAP): $(SHL2OBJS) $(SHL2LIBS)
687.ENDIF
688
689# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
690# even if the $(AWK) part fails:
691$(USE_SHL2VERSIONMAP) .ERRREMOVE: $(SHL2VERSIONMAP)
692	@@-$(RM) -f $@
693# The following files will only be generated and needed on Mac OS X as temporary files
694# in order to generate exported symbols list out of Linux/Solaris map files
695.IF "$(OS)"=="MACOSX"
696	@-$(RM) -f $@.symregexp >& $(NULLDEV)
697	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
698.ENDIF
699# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
700# happens if somebody will change it in the future
701.IF "$(COMID)"=="gcc3"
702	$(COMMAND_ECHO) tr -d "\015" < $(SHL2VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
703.ELIF "$(COMNAME)"=="sunpro5"
704	$(COMMAND_ECHO) tr -d "\015" < $(SHL2VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
705.ELSE           # "$(COMID)"=="gcc3"
706	$(COMMAND_ECHO) tr -d "\015" < $(SHL2VERSIONMAP) > $@
707.ENDIF          # "$(COMID)"=="gcc3"
708	@chmod a+w $@
709# Mac OS X post-processing generate an exported symbols list from the generated map file
710# for details on exported symbols list see man ld on Mac OS X
711.IF "$(OS)"=="MACOSX"
712	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
713	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
714# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
715# Extract RTTI symbols from all the objects that will be used to build a shared library
716.IF "$(SHL2OBJS)"!=""
717	-echo $(foreach,i,$(SHL2OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
718.ENDIF
719.IF "$(SHL2LIBS)"!=""
720	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL2LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
721.ENDIF
722# overwrite the map file generate into the local output tree with the generated
723# exported symbols list
724	cp $@.exported-symbols $@
725.ENDIF # .IF "$(OS)"=="MACOSX"
726.ENDIF			# "$(SHL2VERSIONMAP)"!=""
727.ENDIF			# "$(USE_SHL2VERSIONMAP)"!=""
728.ENDIF			# "$(GUI)" != "UNX"
729
730.IF "$(UNIXVERSIONNAMES)"!=""
731.IF "$(OS)"!="MACOSX"
732.IF "$(GUI)"=="UNX"
733SHL2SONAME=\"$(SONAME_SWITCH)$(SHL2TARGETN:f)\"
734.ENDIF			# "$(GUI)"!="UNX"
735.ENDIF			# "$(OS)"!="MACOSX"
736.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
737
738.IF "$(SHL2RES)"!=""
739SHL2ALLRES+=$(SHL2RES)
740SHL2LINKRES*=$(MISC)/$(SHL2TARGET).res
741SHL2LINKRESO*=$(MISC)/$(SHL2TARGET)_res.o
742.ENDIF			# "$(SHL2RES)"!=""
743
744.IF "$(SHL2DEFAULTRES)$(use_shl_versions)"!=""
745SHL2DEFAULTRES*=$(MISC)/$(SHL2TARGET)_def.res
746SHL2ALLRES+=$(SHL2DEFAULTRES)
747SHL2LINKRES*=$(MISC)/$(SHL2TARGET).res
748SHL2LINKRESO*=$(MISC)/$(SHL2TARGET)_res.o
749.ENDIF			# "$(SHL2DEFAULTRES)$(use_shl_versions)"!=""
750
751#.IF "$(SHL2TARGETN)"!=""
752
753.IF "$(linkinc)"!=""
754.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
755.IF "$(SHL2LIBS)"!=""
756$(MISC)/$(SHL2TARGET)_linkinc.ls .PHONY:
757	@@-$(RM) $@
758	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL2LIBS) $(i:s/.lib/.lin/)) >> $@
759.ENDIF          # "$(SHL2LIBS)"!=""
760.ENDIF
761
762LINKINCTARGETS+=$(MISC)/$(SHL2TARGETN:b)_linkinc.ls
763$(SHL2TARGETN) : $(LINKINCTARGETS)
764
765.ELSE
766.IF "$(SHL2USE_EXPORTS)"=="name"
767.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
768.IF "$(COM)"!="GCC"
769.IF "$(SHL2LIBS)"!=""
770SHL2LINKLIST=$(MISC)/$(SHL2TARGET)_link.lst
771SHL2LINKLISTPARAM=@$(SHL2LINKLIST)
772$(SHL2LINKLIST) : $(SHL2LIBS)
773    @@-$(RM) $@
774	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL2LIBS) $(i:s/.lib/.lin/)) >> $@
775.ENDIF          # "$(SHL2LIBS)"!=""
776.ENDIF          # "$(COM)"!="GCC"
777.ENDIF
778.ENDIF			# "$(SHL2USE_EXPORTS)"=="name"
779
780$(MISC)/%linkinc.ls:
781	@echo . > $@
782.ENDIF          # "$(linkinc)"!=""
783
784.IF "$(GUI)" == "OS2"
785#21/02/2006 YD dll names must be 8.3, invoke fix script
786#check osl/os2/module.c/osl_loadModule()
787SHL2TARGET8=$(shell @fix_shl $(SHL2TARGET))
788.ENDIF
789
790.IF "$(GUI)" == "OS2"
791_SHL2IMP_ORD = $(SHL2STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL2STDLIBS:^"$(LB)/")
792SHL2IMP_ORD = $(foreach,i,$(_SHL2IMP_ORD) $(shell @-ls $i))
793.ELSE
794SHL2IMP_ORD =
795.ENDIF
796
797
798$(SHL2TARGETN) : \
799					$(SHL2OBJS)\
800					$(SHL2LIBS)\
801					$(USE_2IMPLIB_DEPS)\
802					$(USE_SHL2DEF)\
803					$(USE_SHL2VERSIONMAP)\
804					$(SHL2RES)\
805					$(SHL2DEPN) \
806					$(SHL2IMP_ORD) \
807					$(SHL2LINKLIST)
808	@echo "Making:   " $(@:f)
809.IF "$(GUI)" == "WNT"
810.IF "$(SHL2DEFAULTRES)"!=""
811	@@-$(RM) $(MISC)/$(SHL2DEFAULTRES:b).rc
812.IF "$(SHL2ICON)" != ""
813	@echo 1 ICON $(SHL2ICON) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
814.ENDIF
815.IF "$(use_shl_versions)" != ""
816.IF "$(SHL2ADD_VERINFO)"!=""
817	@echo $(EMQ)#include $(EMQ)"$(SHL2ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL2DEFAULTRES:b).rc
818.ELSE			# "$(SHL2ADD_VERINFO)"!=""
819	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL2DEFAULTRES:b).rc
820	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL2DEFAULTRES:b).rc
821	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL2DEFAULTRES:b).rc
822.ENDIF			# "$(SHL2ADD_VERINFO)"!=""
823	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
824	@echo $(EMQ)#define ORG_NAME	$(SHL2TARGET)$(DLLPOST) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
825	@echo $(EMQ)#define INTERNAL_NAME $(SHL2TARGET:b) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
826	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL2DEFAULTRES:b).rc
827.ENDIF			# "$(use_shl_versions)" != ""
828	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL2DEFAULTRES:b).rc
829.ENDIF			# "$(SHL2DEFAULTRES)"!=""
830.IF "$(SHL2ALLRES)"!=""
831	$(COMMAND_ECHO)$(TYPE) $(SHL2ALLRES) > $(SHL2LINKRES)
832.IF "$(COM)"=="GCC"
833	windres $(SHL2LINKRES) $(SHL2LINKRESO)
834.ENDIF			# "$(COM)"=="GCC"
835.ENDIF			# "$(SHL2ALLRES)"!=""
836.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
837	@echo dlltool --dllname $(SHL2TARGET)$(DLLPOST) \
838		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_2.cmd
839	@noop $(assign ALL2OBJLIST:=$(STDOBJ) $(SHL2OBJS) $(SHL2LINKRESO) $(shell $(TYPE) /dev/null $(SHL2LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
840.IF "$(DEFLIB2NAME)"!=""	# do not have to include objs
841	@noop $(assign DEF2OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
842	@noop $(foreach,i,$(DEF2OBJLIST) $(assign ALL2OBJLIST:=$(ALL2OBJLIST:s?$i??)))
843.ENDIF			# "$(DEFLIB2NAME)"!=""
844	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
845.IF "$(SHL2DEF)"!=""
846	@echo	--input-def $(SHL2DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
847.ELSE
848	@echo	$(SHL2VERSIONOBJ) $(SHL2DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
849.ENDIF
850	@echo	$(ALL2OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_2.cmd
851	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
852		$(STDOBJ) $(SHL2VERSIONOBJ) $(SHL2DESCRIPTIONOBJ) $(SHL2OBJS) $(SHL2LINKRESO) \
853		`$(TYPE) /dev/null $(SHL2LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
854		-Wl,--exclude-libs,ALL,--start-group $(SHL2STDLIBS) -Wl,--end-group \
855		$(SHL2STDSHL) $(STDSHL2) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
856		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_2.cmd
857  .IF "$(VERBOSE)" == "TRUE"
858	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_2.cmd
859  .ENDIF
860	@+source $(MISC)/$(TARGET).$(@:b)_2.cmd
861.ELSE
862.IF "$(linkinc)"==""
863.IF "$(SHL2USE_EXPORTS)"!="name"
864.IF "$(USE_DEFFILE)"!=""
865	$(COMMAND_ECHO)$(SHL2LINKER) @$(mktmp \
866		$(SHL2LINKFLAGS) \
867		$(LINKFLAGSSHL) \
868		$(SHL2STACK) $(SHL2BASEX)	\
869		-out:$@ \
870		-map:$(MISC)/$(@:b).map \
871		-def:$(SHL2DEF) \
872		$(USE_2IMPLIB) \
873		$(STDOBJ) \
874		$(SHL2VERSIONOBJ) $(SHL2OBJS) \
875		$(SHL2LIBS) \
876		$(SHL2STDLIBS) \
877		$(SHL2STDSHL) $(STDSHL2) \
878		$(SHL2LINKRES) \
879	)
880# double check if target was really written... still making sense?
881    @@$(LS) $@
882	@echo linking $@.manifest ...
883.IF "$(VISTA_MANIFEST)"!=""
884	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
885	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
886.ELSE
887	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
888.ENDIF # "$(VISTA_MANIFEST)"!=""
889	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
890	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
891.ELSE			# "$(USE_DEFFILE)"!=""
892	$(COMMAND_ECHO)$(SHL2LINKER) @$(mktmp	$(SHL2LINKFLAGS)			\
893		$(LINKFLAGSSHL) $(SHL2BASEX)		\
894		$(SHL2STACK) -out:$(SHL2TARGETN)	\
895		-map:$(MISC)/$(@:B).map				\
896		$(LB)/$(SHL2IMPLIB).exp				\
897		$(STDOBJ)							\
898		$(SHL2OBJS) $(SHL2VERSIONOBJ) \
899		$(SHL2LIBS)                         \
900		$(SHL2STDLIBS)                      \
901		$(SHL2STDSHL) $(STDSHL2)                           \
902		$(SHL2LINKRES) \
903	)
904# double check if target was really written... still making sense?
905    @@$(LS) $@
906	@echo linking $@.manifest ...
907.IF "$(VISTA_MANIFEST)"!=""
908	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
909	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
910.ELSE
911	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
912.ENDIF # "$(VISTA_MANIFEST)"!=""
913	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
914	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
915.ENDIF			# "$(USE_DEFFILE)"!=""
916.ELSE			# "$(SHL2USE_EXPORTS)"!="name"
917	$(COMMAND_ECHO)$(SHL2LINKER) @$(mktmp	$(SHL2LINKFLAGS)			\
918		$(LINKFLAGSSHL) $(SHL2BASEX)		\
919		$(SHL2STACK) -out:$(SHL2TARGETN)	\
920		-map:$(MISC)/$(@:B).map				\
921		$(USE_2IMPLIB) \
922		$(STDOBJ)							\
923		$(SHL2OBJS) $(SHL2VERSIONOBJ))   \
924		$(SHL2LINKLISTPARAM) \
925		@$(mktmp $(SHL2STDLIBS)                      \
926		$(SHL2STDSHL) $(STDSHL2)                           \
927		$(SHL2LINKRES) \
928	)
929	@echo linking $@.manifest ...
930.IF "$(VISTA_MANIFEST)"!=""
931	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
932	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
933.ELSE
934	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
935.ENDIF # "$(VISTA_MANIFEST)"!=""
936	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
937	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
938.ENDIF			# "$(SHL2USE_EXPORTS)"!="name"
939.ELSE			# "$(linkinc)"==""
940		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL2TARGET).lnk
941		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL2TARGET).lst
942		$(COMMAND_ECHO)$(TYPE) $(mktmp \
943		$(SHL2LINKFLAGS) \
944		$(LINKFLAGSSHL) $(SHL2BASEX) \
945		$(SHL2STACK) $(MAPFILE) \
946		-out:$@ \
947		$(LB)/$(SHL2IMPLIB).exp \
948		$(STDOBJ) \
949		$(SHL2OBJS) \
950		$(SHL2STDLIBS) \
951		$(SHL2STDSHL) $(STDSHL2) \
952		$(SHL2LINKRES) \
953		) >> $(MISC)/$(SHL2TARGET).lnk
954		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL2TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL2TARGET).lnk
955		$(COMMAND_ECHO)$(SHL2LINKER) @$(MISC)/$(SHL2TARGET).lnk
956		@echo linking $@.manifest ...
957.IF "$(VISTA_MANIFEST)"!=""
958		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
959		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
960.ELSE
961		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
962.ENDIF # "$(VISTA_MANIFEST)"!=""
963		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
964		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
965.ENDIF			# "$(linkinc)"==""
966.ENDIF			# "$(COM)"=="GCC"
967.ENDIF			# "$(GUI)" == "WNT"
968.IF "$(GUI)"=="UNX"
969.IF "$(OS)"=="MACOSX"
970	@-$(RM) $(MISC)/$(@:b).list
971	@-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
972	@echo $(STDSLO) $(SHL2OBJS:s/.obj/.o/) \
973	$(SHL2VERSIONOBJ) \
974	`cat /dev/null $(SHL2LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
975	@echo -n $(SHL2LINKER) $(SHL2LINKFLAGS) $(SHL2VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
976	$(SHL2STDLIBS) $(SHL2ARCHIVES) $(SHL2STDSHL) $(STDSHL2) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_2.cmd
977    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
978        `cat $(MISC)/$(TARGET).$(@:b)_2.cmd` \
979        >> $(MISC)/$(TARGET).$(@:b)_2.cmd
980  .IF "$(VERBOSE)" == "TRUE"
981	@cat $(MISC)/$(TARGET).$(@:b)_2.cmd
982  .ENDIF
983	@+source $(MISC)/$(TARGET).$(@:b)_2.cmd
984    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
985        shl $(SHL2RPATH) $@
986.IF "$(SHL2CREATEJNILIB)"!=""
987	@echo "Making:   " $(@:f).jnilib
988	@macosx-create-bundle $@
989.ENDIF          # "$(SHL2CREATEJNILIB)"!=""
990.IF "$(UPDATER)"=="YES"
991.IF "$(SHL2NOCHECK)"==""
992	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN)
993.ENDIF				# "$(SHL2NOCHECK)"!=""
994.ENDIF
995.ELSE			# "$(OS)"=="MACOSX"
996	@-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
997	@echo $(SHL2LINKER) $(SHL2LINKFLAGS) $(SHL2SONAME) $(LINKFLAGSSHL) $(SHL2VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL2OBJS:s/.obj/.o/) \
998	$(SHL2VERSIONOBJ) -o $@ \
999	`cat /dev/null $(SHL2LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
1000	$(SHL2STDLIBS) $(SHL2ARCHIVES) $(SHL2STDSHL) $(STDSHL2) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_2.cmd
1001  .IF "$(VERBOSE)" == "TRUE"
1002	@cat $(MISC)/$(TARGET).$(@:b)_2.cmd
1003  .ENDIF
1004	@+source $(MISC)/$(TARGET).$(@:b)_2.cmd
1005.IF "$(UPDATER)"=="YES"
1006.IF "$(SHL2NOCHECK)"==""
1007	$(COMMAND_ECHO)-$(RM) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
1008	$(COMMAND_ECHO)$(RENAME) $(SHL2TARGETN) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
1009.IF "$(VERBOSE)"=="TRUE"
1010	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
1011.ELSE
1012	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) -- -s $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
1013.ENDIF
1014.ENDIF				# "$(SHL2NOCHECK)"!=""
1015.ENDIF			# "$(UPDATER)"=="YES"
1016.ENDIF			# "$(OS)"=="MACOSX"
1017.IF "$(UNIXVERSIONNAMES)"!=""
1018	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL2TARGETN:b)
1019	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL2TARGETN:f) $(SHL2TARGETN:b)
1020.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
1021.IF "$(VERBOSE)" == "TRUE"
1022	@ls -l $@
1023.ENDIF
1024.ENDIF			# "$(GUI)" == "UNX"
1025
1026.IF "$(GUI)" == "OS2"
1027
1028.IF "$(SHL2DEFAULTRES)"!=""
1029	@+-$(RM) $(MISC)/$(SHL2DEFAULTRES:b).rc >& $(NULLDEV)
1030.IF "$(SHL2ICON)" != ""
1031	@-+echo 1 ICON $(SHL2ICON) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
1032.ENDIF
1033.IF "$(use_shl_versions)" != ""
1034.IF "$(SHL2ADD_VERINFO)"!=""
1035	@-+echo $(EMQ)#include $(EMQ)"$(SHL2ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL2DEFAULTRES:b).rc
1036.ENDIF			# "$(SHL2ADD_VERINFO)"!=""
1037	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL2DEFAULTRES:b).rc
1038#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
1039.ENDIF			# "$(use_shl_versions)" != ""
1040# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
1041	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL2DEFAULTRES:b).rc
1042.ENDIF			# "$(SHL2DEFAULTRES)"!=""
1043
1044.IF "$(SHL2ALLRES)"!=""
1045	$(COMMAND_ECHO)+$(TYPE) $(SHL2ALLRES) > $(SHL2LINKRES)
1046.ENDIF			# "$(SHL2ALLRES)"!=""
1047
1048.IF "$(USE_DEFFILE)"!=""
1049
1050	$(COMMAND_ECHO)$(SHL2LINKER) $(SHL2LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
1051		$(SHL2DEF) \
1052		$(STDOBJ) \
1053		-L$(LB) \
1054		-L$(SOLARVERSION)/$(INPATH)/lib \
1055		$(SHL2OBJS) $(SHL2VERSIONOBJ) \
1056		$(SHL2LIBS) \
1057		$(SHL2STDLIBS:^"-l") \
1058		$(SHL2LINKRES) \
1059		$(SHL2STDSHL:^"-l") $(STDSHL2:^"-l")
1060
1061.ELSE			# "$(USE_DEFFILE)"!=""
1062
1063	$(COMMAND_ECHO)$(SHL2LINKER) -v 	$(SHL2LINKFLAGS)			\
1064		$(LINKFLAGSSHL) $(SHL2BASEX)		\
1065		$(SHL2STACK) -o $(SHL2TARGETN)	\
1066		$(SHL2DEF) \
1067		$(STDOBJ)							\
1068		-L$(LB) \
1069		-L$(SOLARVERSION)/$(INPATH)/lib \
1070		$(SHL2OBJS) $(SHL2VERSIONOBJ) \
1071		$(SHL2LIBS) \
1072		$(SHL2STDLIBS:^"-l") \
1073		$(SHL2LINKRES) \
1074		$(SHL2STDSHL:^"-l") $(STDSHL2:^"-l")                           \
1075	@$(LS) $@ >& $(NULLDEV)
1076
1077.ENDIF			# "$(USE_DEFFILE)"!=""
1078
1079.IF "$(SHL2TARGET8)" != "$(SHL2TARGET)"
1080	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL2TARGET8).dll
1081.ENDIF
1082
1083.ENDIF			# "$(GUI)" == "OS2"
1084
1085.ENDIF			# "$(SHL2TARGETN)"!=""
1086
1087# unroll begin
1088
1089.IF "$(SHL3TARGETN)"!=""
1090
1091.IF "$(OS)"=="AIX"
1092SHL3STDLIBS=
1093.ENDIF
1094
1095.IF "$(SHLLINKARCONLY)" != ""
1096SHL3STDLIBS=
1097STDSHL=
1098.ELSE
1099SHL3ARCHIVES=
1100.ENDIF
1101
1102# decide how to link
1103.IF "$(SHL3CODETYPE)"=="C"
1104SHL3LINKER=$(LINKC)
1105SHL3STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
1106SHL3LINKFLAGS+=$(LINKCFLAGS)
1107.ELSE			# "$(SHL3CODETYPE)"=="C"
1108SHL3LINKER=$(LINK)
1109SHL3STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
1110SHL3LINKFLAGS+=$(LINKFLAGS)
1111.ENDIF			# "$(SHL3CODETYPE)"=="C"
1112
1113SHL3RPATH*=OOO
1114LINKFLAGSRUNPATH_$(SHL3RPATH)*=/ERROR:/Bad_SHL3RPATH_value
1115SHL3LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL3RPATH))
1116
1117.IF "$(SHL3USE_EXPORTS)"==""
1118SHL3DEF*=$(MISC)/$(SHL3TARGET).def
1119.ENDIF			# "$(SHL3USE_EXPORTS)"==""
1120
1121EXTRALIBPATHS3=$(EXTRALIBPATHS)
1122.IF "$(UPDATER)"=="YES"
1123.IF "$(SHL3NOCHECK)"==""
1124.IF "$(SOLAR_STLLIBPATH)"!=""
1125EXTRALIBPATHS3+=-L$(SOLAR_STLLIBPATH)
1126.ENDIF
1127.ENDIF				# "$(SHL3NOCHECK)"!=""
1128.ENDIF
1129#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1130#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
1131#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1132
1133.IF "$(L10N_framework)"==""
1134.IF "$(VERSIONOBJ)"!=""
1135SHL3VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL3TARGET))}$(VERSIONOBJ:f)
1136USE_VERSIONH:=$(INCCOM)/$(SHL3VERSIONOBJ:b).h
1137.IF "$(GUI)" == "UNX"
1138SHL3VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL3TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
1139.ELSE           # "$(GUI)" == "UNX"
1140SHL3VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL3TARGET))}$(VERSIONOBJ:f)
1141.ENDIF          # "$(GUI)" == "UNX"
1142$(MISC)/$(SHL3VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL3VERSIONOBJ:b).h
1143#    $(COPY) $(SOLARENV)/src/version.c $@
1144	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL3VERSIONOBJ:b).h/ > $@
1145
1146.INIT : $(SHL3VERSIONOBJDEP)
1147.ENDIF			# "$(VERSIONOBJ)"!=""
1148.ENDIF
1149
1150.IF "$(GUI)" != "UNX"
1151.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
1152.IF "$(SHL3IMPLIB)" == ""
1153SHL3IMPLIB=i$(TARGET)_t3
1154.ENDIF			# "$(SHL3IMPLIB)" == ""
1155.IF "$(COM)" != "GCC"
1156USE_3IMPLIB=-implib:$(LB)/$(SHL3IMPLIB).lib
1157.ENDIF			# "$(COM)" != "GCC"
1158SHL3IMPLIBN=$(LB)/$(SHL3IMPLIB).lib
1159ALLTAR : $(SHL3IMPLIBN)
1160
1161.IF "$(USE_DEFFILE)"==""
1162USE_3IMPLIB_DEPS=$(LB)/$(SHL3IMPLIB).lib
1163.ENDIF			# "$(USE_DEFFILE)"==""
1164.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
1165USE_SHL3DEF=$(SHL3DEF)
1166.ELSE			# "$(GUI)" != "UNX"
1167USE_SHL3DEF=
1168SHL3DEPN+:=$(SHL3DEPNU)
1169
1170.IF "$(SHL3VERSIONMAP)"==""
1171# to activate vmaps remove "#"
1172USE_SHL3VERSIONMAP=$(MISC)/$(SHL3TARGET).vmap
1173.ENDIF			# "$(SHL3VERSIONMAP)"==""
1174
1175.IF "$(USE_SHL3VERSIONMAP)"!=""
1176
1177.IF "$(SHL3FILTERFILE)"!=""
1178.IF "$(SHL3VERSIONMAP)"!=""
1179#eine von beiden ist zuviel
1180USE_SHL3VERSIONMAP=$(MISC)/$(SHL3TARGET).vmap
1181$(USE_SHL3VERSIONMAP) .PHONY:
1182	@echo -----------------------------
1183	@echo you should only use versionmap OR exportfile
1184	@echo -----------------------------
1185#	force_dmake_to_error
1186
1187.ENDIF			# "$(SHL3VERSIONMAP)"!=""
1188
1189SHL3VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL3VERSIONMAP)
1190
1191$(USE_SHL3VERSIONMAP): \
1192					$(SHL3OBJS)\
1193					$(SHL3LIBS)\
1194					$(SHL3FILTERFILE)
1195	@$(RM) $@.dump
1196.IF "$(SHL3OBJS)"!=""
1197# dump remaining objects on the fly
1198.IF "$(OS)"=="MACOSX"
1199	@-nm $(SHL3OBJS:s/.obj/.o/) > $@.dump
1200.ELSE
1201	@nm $(SHL3OBJS:s/.obj/.o/) > $@.dump
1202.ENDIF
1203.ENDIF			# "$(SHL3OBJS)!"=""
1204	@$(TYPE) /dev/null $(SHL3LIBS:s/.lib/.dump/) >> $@.dump
1205	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL3INTERFACE) -f $(SHL3FILTERFILE) -m $@
1206
1207.ELSE			# "$(SHL3FILTERFILE)"!=""
1208USE_SHL3VERSIONMAP=$(MISC)/$(SHL3TARGET).vmap
1209$(USE_SHL3VERSIONMAP) :
1210.IF "$(VERBOSE)" == "TRUE"
1211	@echo -----------------------------
1212	@echo SHL3FILTERFILE not set!
1213	@echo -----------------------------
1214	@$(TOUCH) $@
1215	@echo dummy file to keep the dependencies for later use.
1216.ELSE
1217	@$(TOUCH) $@
1218.ENDIF
1219#	force_dmake_to_error
1220.ENDIF			# "$(SHL3FILTERFILE)"!=""
1221.ELSE			# "$(USE_SHL3VERSIONMAP)"!=""
1222
1223#and now for the plain non-generic way...
1224.IF "$(SHL3VERSIONMAP)"!=""
1225USE_SHL3VERSIONMAP=$(MISC)/$(SHL3VERSIONMAP:b)_$(SHL3TARGET)$(SHL3VERSIONMAP:e)
1226SHL3VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL3VERSIONMAP)
1227
1228.IF "$(OS)"=="MACOSX"
1229$(USE_SHL3VERSIONMAP): $(SHL3OBJS) $(SHL3LIBS)
1230.ENDIF
1231
1232# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
1233# even if the $(AWK) part fails:
1234$(USE_SHL3VERSIONMAP) .ERRREMOVE: $(SHL3VERSIONMAP)
1235	@@-$(RM) -f $@
1236# The following files will only be generated and needed on Mac OS X as temporary files
1237# in order to generate exported symbols list out of Linux/Solaris map files
1238.IF "$(OS)"=="MACOSX"
1239	@-$(RM) -f $@.symregexp >& $(NULLDEV)
1240	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
1241.ENDIF
1242# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
1243# happens if somebody will change it in the future
1244.IF "$(COMID)"=="gcc3"
1245	$(COMMAND_ECHO) tr -d "\015" < $(SHL3VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
1246.ELIF "$(COMNAME)"=="sunpro5"
1247	$(COMMAND_ECHO) tr -d "\015" < $(SHL3VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
1248.ELSE           # "$(COMID)"=="gcc3"
1249	$(COMMAND_ECHO) tr -d "\015" < $(SHL3VERSIONMAP) > $@
1250.ENDIF          # "$(COMID)"=="gcc3"
1251	@chmod a+w $@
1252# Mac OS X post-processing generate an exported symbols list from the generated map file
1253# for details on exported symbols list see man ld on Mac OS X
1254.IF "$(OS)"=="MACOSX"
1255	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
1256	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
1257# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
1258# Extract RTTI symbols from all the objects that will be used to build a shared library
1259.IF "$(SHL3OBJS)"!=""
1260	-echo $(foreach,i,$(SHL3OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
1261.ENDIF
1262.IF "$(SHL3LIBS)"!=""
1263	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL3LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
1264.ENDIF
1265# overwrite the map file generate into the local output tree with the generated
1266# exported symbols list
1267	cp $@.exported-symbols $@
1268.ENDIF # .IF "$(OS)"=="MACOSX"
1269.ENDIF			# "$(SHL3VERSIONMAP)"!=""
1270.ENDIF			# "$(USE_SHL3VERSIONMAP)"!=""
1271.ENDIF			# "$(GUI)" != "UNX"
1272
1273.IF "$(UNIXVERSIONNAMES)"!=""
1274.IF "$(OS)"!="MACOSX"
1275.IF "$(GUI)"=="UNX"
1276SHL3SONAME=\"$(SONAME_SWITCH)$(SHL3TARGETN:f)\"
1277.ENDIF			# "$(GUI)"!="UNX"
1278.ENDIF			# "$(OS)"!="MACOSX"
1279.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
1280
1281.IF "$(SHL3RES)"!=""
1282SHL3ALLRES+=$(SHL3RES)
1283SHL3LINKRES*=$(MISC)/$(SHL3TARGET).res
1284SHL3LINKRESO*=$(MISC)/$(SHL3TARGET)_res.o
1285.ENDIF			# "$(SHL3RES)"!=""
1286
1287.IF "$(SHL3DEFAULTRES)$(use_shl_versions)"!=""
1288SHL3DEFAULTRES*=$(MISC)/$(SHL3TARGET)_def.res
1289SHL3ALLRES+=$(SHL3DEFAULTRES)
1290SHL3LINKRES*=$(MISC)/$(SHL3TARGET).res
1291SHL3LINKRESO*=$(MISC)/$(SHL3TARGET)_res.o
1292.ENDIF			# "$(SHL3DEFAULTRES)$(use_shl_versions)"!=""
1293
1294#.IF "$(SHL3TARGETN)"!=""
1295
1296.IF "$(linkinc)"!=""
1297.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
1298.IF "$(SHL3LIBS)"!=""
1299$(MISC)/$(SHL3TARGET)_linkinc.ls .PHONY:
1300	@@-$(RM) $@
1301	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL3LIBS) $(i:s/.lib/.lin/)) >> $@
1302.ENDIF          # "$(SHL3LIBS)"!=""
1303.ENDIF
1304
1305LINKINCTARGETS+=$(MISC)/$(SHL3TARGETN:b)_linkinc.ls
1306$(SHL3TARGETN) : $(LINKINCTARGETS)
1307
1308.ELSE
1309.IF "$(SHL3USE_EXPORTS)"=="name"
1310.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
1311.IF "$(COM)"!="GCC"
1312.IF "$(SHL3LIBS)"!=""
1313SHL3LINKLIST=$(MISC)/$(SHL3TARGET)_link.lst
1314SHL3LINKLISTPARAM=@$(SHL3LINKLIST)
1315$(SHL3LINKLIST) : $(SHL3LIBS)
1316    @@-$(RM) $@
1317	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL3LIBS) $(i:s/.lib/.lin/)) >> $@
1318.ENDIF          # "$(SHL3LIBS)"!=""
1319.ENDIF          # "$(COM)"!="GCC"
1320.ENDIF
1321.ENDIF			# "$(SHL3USE_EXPORTS)"=="name"
1322
1323$(MISC)/%linkinc.ls:
1324	@echo . > $@
1325.ENDIF          # "$(linkinc)"!=""
1326
1327.IF "$(GUI)" == "OS2"
1328#21/02/2006 YD dll names must be 8.3, invoke fix script
1329#check osl/os2/module.c/osl_loadModule()
1330SHL3TARGET8=$(shell @fix_shl $(SHL3TARGET))
1331.ENDIF
1332
1333.IF "$(GUI)" == "OS2"
1334_SHL3IMP_ORD = $(SHL3STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL3STDLIBS:^"$(LB)/")
1335SHL3IMP_ORD = $(foreach,i,$(_SHL3IMP_ORD) $(shell @-ls $i))
1336.ELSE
1337SHL3IMP_ORD =
1338.ENDIF
1339
1340
1341$(SHL3TARGETN) : \
1342					$(SHL3OBJS)\
1343					$(SHL3LIBS)\
1344					$(USE_3IMPLIB_DEPS)\
1345					$(USE_SHL3DEF)\
1346					$(USE_SHL3VERSIONMAP)\
1347					$(SHL3RES)\
1348					$(SHL3DEPN) \
1349					$(SHL3IMP_ORD) \
1350					$(SHL3LINKLIST)
1351	@echo "Making:   " $(@:f)
1352.IF "$(GUI)" == "WNT"
1353.IF "$(SHL3DEFAULTRES)"!=""
1354	@@-$(RM) $(MISC)/$(SHL3DEFAULTRES:b).rc
1355.IF "$(SHL3ICON)" != ""
1356	@echo 1 ICON $(SHL3ICON) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1357.ENDIF
1358.IF "$(use_shl_versions)" != ""
1359.IF "$(SHL3ADD_VERINFO)"!=""
1360	@echo $(EMQ)#include $(EMQ)"$(SHL3ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1361.ELSE			# "$(SHL3ADD_VERINFO)"!=""
1362	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1363	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1364	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1365.ENDIF			# "$(SHL3ADD_VERINFO)"!=""
1366	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1367	@echo $(EMQ)#define ORG_NAME	$(SHL3TARGET)$(DLLPOST) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1368	@echo $(EMQ)#define INTERNAL_NAME $(SHL3TARGET:b) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1369	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1370.ENDIF			# "$(use_shl_versions)" != ""
1371	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL3DEFAULTRES:b).rc
1372.ENDIF			# "$(SHL3DEFAULTRES)"!=""
1373.IF "$(SHL3ALLRES)"!=""
1374	$(COMMAND_ECHO)$(TYPE) $(SHL3ALLRES) > $(SHL3LINKRES)
1375.IF "$(COM)"=="GCC"
1376	windres $(SHL3LINKRES) $(SHL3LINKRESO)
1377.ENDIF			# "$(COM)"=="GCC"
1378.ENDIF			# "$(SHL3ALLRES)"!=""
1379.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
1380	@echo dlltool --dllname $(SHL3TARGET)$(DLLPOST) \
1381		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_3.cmd
1382	@noop $(assign ALL3OBJLIST:=$(STDOBJ) $(SHL3OBJS) $(SHL3LINKRESO) $(shell $(TYPE) /dev/null $(SHL3LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
1383.IF "$(DEFLIB3NAME)"!=""	# do not have to include objs
1384	@noop $(assign DEF3OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
1385	@noop $(foreach,i,$(DEF3OBJLIST) $(assign ALL3OBJLIST:=$(ALL3OBJLIST:s?$i??)))
1386.ENDIF			# "$(DEFLIB3NAME)"!=""
1387	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
1388.IF "$(SHL3DEF)"!=""
1389	@echo	--input-def $(SHL3DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
1390.ELSE
1391	@echo	$(SHL3VERSIONOBJ) $(SHL3DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
1392.ENDIF
1393	@echo	$(ALL3OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_3.cmd
1394	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
1395		$(STDOBJ) $(SHL3VERSIONOBJ) $(SHL3DESCRIPTIONOBJ) $(SHL3OBJS) $(SHL3LINKRESO) \
1396		`$(TYPE) /dev/null $(SHL3LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
1397		-Wl,--exclude-libs,ALL,--start-group $(SHL3STDLIBS) -Wl,--end-group \
1398		$(SHL3STDSHL) $(STDSHL3) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
1399		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_3.cmd
1400  .IF "$(VERBOSE)" == "TRUE"
1401	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_3.cmd
1402  .ENDIF
1403	@+source $(MISC)/$(TARGET).$(@:b)_3.cmd
1404.ELSE
1405.IF "$(linkinc)"==""
1406.IF "$(SHL3USE_EXPORTS)"!="name"
1407.IF "$(USE_DEFFILE)"!=""
1408	$(COMMAND_ECHO)$(SHL3LINKER) @$(mktmp \
1409		$(SHL3LINKFLAGS) \
1410		$(LINKFLAGSSHL) \
1411		$(SHL3STACK) $(SHL3BASEX)	\
1412		-out:$@ \
1413		-map:$(MISC)/$(@:b).map \
1414		-def:$(SHL3DEF) \
1415		$(USE_3IMPLIB) \
1416		$(STDOBJ) \
1417		$(SHL3VERSIONOBJ) $(SHL3OBJS) \
1418		$(SHL3LIBS) \
1419		$(SHL3STDLIBS) \
1420		$(SHL3STDSHL) $(STDSHL3) \
1421		$(SHL3LINKRES) \
1422	)
1423# double check if target was really written... still making sense?
1424    @@$(LS) $@
1425	@echo linking $@.manifest ...
1426.IF "$(VISTA_MANIFEST)"!=""
1427	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1428	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
1429.ELSE
1430	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
1431.ENDIF # "$(VISTA_MANIFEST)"!=""
1432	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1433	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1434.ELSE			# "$(USE_DEFFILE)"!=""
1435	$(COMMAND_ECHO)$(SHL3LINKER) @$(mktmp	$(SHL3LINKFLAGS)			\
1436		$(LINKFLAGSSHL) $(SHL3BASEX)		\
1437		$(SHL3STACK) -out:$(SHL3TARGETN)	\
1438		-map:$(MISC)/$(@:B).map				\
1439		$(LB)/$(SHL3IMPLIB).exp				\
1440		$(STDOBJ)							\
1441		$(SHL3OBJS) $(SHL3VERSIONOBJ) \
1442		$(SHL3LIBS)                         \
1443		$(SHL3STDLIBS)                      \
1444		$(SHL3STDSHL) $(STDSHL3)                           \
1445		$(SHL3LINKRES) \
1446	)
1447# double check if target was really written... still making sense?
1448    @@$(LS) $@
1449	@echo linking $@.manifest ...
1450.IF "$(VISTA_MANIFEST)"!=""
1451	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1452	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
1453.ELSE
1454	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
1455.ENDIF # "$(VISTA_MANIFEST)"!=""
1456	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1457	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1458.ENDIF			# "$(USE_DEFFILE)"!=""
1459.ELSE			# "$(SHL3USE_EXPORTS)"!="name"
1460	$(COMMAND_ECHO)$(SHL3LINKER) @$(mktmp	$(SHL3LINKFLAGS)			\
1461		$(LINKFLAGSSHL) $(SHL3BASEX)		\
1462		$(SHL3STACK) -out:$(SHL3TARGETN)	\
1463		-map:$(MISC)/$(@:B).map				\
1464		$(USE_3IMPLIB) \
1465		$(STDOBJ)							\
1466		$(SHL3OBJS) $(SHL3VERSIONOBJ))   \
1467		$(SHL3LINKLISTPARAM) \
1468		@$(mktmp $(SHL3STDLIBS)                      \
1469		$(SHL3STDSHL) $(STDSHL3)                           \
1470		$(SHL3LINKRES) \
1471	)
1472	@echo linking $@.manifest ...
1473.IF "$(VISTA_MANIFEST)"!=""
1474	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1475	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
1476.ELSE
1477	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
1478.ENDIF # "$(VISTA_MANIFEST)"!=""
1479	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1480	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1481.ENDIF			# "$(SHL3USE_EXPORTS)"!="name"
1482.ELSE			# "$(linkinc)"==""
1483		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL3TARGET).lnk
1484		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL3TARGET).lst
1485		$(COMMAND_ECHO)$(TYPE) $(mktmp \
1486		$(SHL3LINKFLAGS) \
1487		$(LINKFLAGSSHL) $(SHL3BASEX) \
1488		$(SHL3STACK) $(MAPFILE) \
1489		-out:$@ \
1490		$(LB)/$(SHL3IMPLIB).exp \
1491		$(STDOBJ) \
1492		$(SHL3OBJS) \
1493		$(SHL3STDLIBS) \
1494		$(SHL3STDSHL) $(STDSHL3) \
1495		$(SHL3LINKRES) \
1496		) >> $(MISC)/$(SHL3TARGET).lnk
1497		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL3TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL3TARGET).lnk
1498		$(COMMAND_ECHO)$(SHL3LINKER) @$(MISC)/$(SHL3TARGET).lnk
1499		@echo linking $@.manifest ...
1500.IF "$(VISTA_MANIFEST)"!=""
1501		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1502		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
1503.ELSE
1504		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
1505.ENDIF # "$(VISTA_MANIFEST)"!=""
1506		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1507		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1508.ENDIF			# "$(linkinc)"==""
1509.ENDIF			# "$(COM)"=="GCC"
1510.ENDIF			# "$(GUI)" == "WNT"
1511.IF "$(GUI)"=="UNX"
1512.IF "$(OS)"=="MACOSX"
1513	@-$(RM) $(MISC)/$(@:b).list
1514	@-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
1515	@echo $(STDSLO) $(SHL3OBJS:s/.obj/.o/) \
1516	$(SHL3VERSIONOBJ) \
1517	`cat /dev/null $(SHL3LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
1518	@echo -n $(SHL3LINKER) $(SHL3LINKFLAGS) $(SHL3VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
1519	$(SHL3STDLIBS) $(SHL3ARCHIVES) $(SHL3STDSHL) $(STDSHL3) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_3.cmd
1520    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
1521        `cat $(MISC)/$(TARGET).$(@:b)_3.cmd` \
1522        >> $(MISC)/$(TARGET).$(@:b)_3.cmd
1523  .IF "$(VERBOSE)" == "TRUE"
1524	@cat $(MISC)/$(TARGET).$(@:b)_3.cmd
1525  .ENDIF
1526	@+source $(MISC)/$(TARGET).$(@:b)_3.cmd
1527    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
1528        shl $(SHL3RPATH) $@
1529.IF "$(SHL3CREATEJNILIB)"!=""
1530	@echo "Making:   " $(@:f).jnilib
1531	@macosx-create-bundle $@
1532.ENDIF          # "$(SHL3CREATEJNILIB)"!=""
1533.IF "$(UPDATER)"=="YES"
1534.IF "$(SHL3NOCHECK)"==""
1535	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN)
1536.ENDIF				# "$(SHL3NOCHECK)"!=""
1537.ENDIF
1538.ELSE			# "$(OS)"=="MACOSX"
1539	@-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
1540	@echo $(SHL3LINKER) $(SHL3LINKFLAGS) $(SHL3SONAME) $(LINKFLAGSSHL) $(SHL3VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL3OBJS:s/.obj/.o/) \
1541	$(SHL3VERSIONOBJ) -o $@ \
1542	`cat /dev/null $(SHL3LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
1543	$(SHL3STDLIBS) $(SHL3ARCHIVES) $(SHL3STDSHL) $(STDSHL3) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_3.cmd
1544  .IF "$(VERBOSE)" == "TRUE"
1545	@cat $(MISC)/$(TARGET).$(@:b)_3.cmd
1546  .ENDIF
1547	@+source $(MISC)/$(TARGET).$(@:b)_3.cmd
1548.IF "$(UPDATER)"=="YES"
1549.IF "$(SHL3NOCHECK)"==""
1550	$(COMMAND_ECHO)-$(RM) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
1551	$(COMMAND_ECHO)$(RENAME) $(SHL3TARGETN) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
1552.IF "$(VERBOSE)"=="TRUE"
1553	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
1554.ELSE
1555	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) -- -s $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
1556.ENDIF
1557.ENDIF				# "$(SHL3NOCHECK)"!=""
1558.ENDIF			# "$(UPDATER)"=="YES"
1559.ENDIF			# "$(OS)"=="MACOSX"
1560.IF "$(UNIXVERSIONNAMES)"!=""
1561	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL3TARGETN:b)
1562	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL3TARGETN:f) $(SHL3TARGETN:b)
1563.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
1564.IF "$(VERBOSE)" == "TRUE"
1565	@ls -l $@
1566.ENDIF
1567.ENDIF			# "$(GUI)" == "UNX"
1568
1569.IF "$(GUI)" == "OS2"
1570
1571.IF "$(SHL3DEFAULTRES)"!=""
1572	@+-$(RM) $(MISC)/$(SHL3DEFAULTRES:b).rc >& $(NULLDEV)
1573.IF "$(SHL3ICON)" != ""
1574	@-+echo 1 ICON $(SHL3ICON) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1575.ENDIF
1576.IF "$(use_shl_versions)" != ""
1577.IF "$(SHL3ADD_VERINFO)"!=""
1578	@-+echo $(EMQ)#include $(EMQ)"$(SHL3ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1579.ENDIF			# "$(SHL3ADD_VERINFO)"!=""
1580	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1581#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
1582.ENDIF			# "$(use_shl_versions)" != ""
1583# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
1584	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL3DEFAULTRES:b).rc
1585.ENDIF			# "$(SHL3DEFAULTRES)"!=""
1586
1587.IF "$(SHL3ALLRES)"!=""
1588	$(COMMAND_ECHO)+$(TYPE) $(SHL3ALLRES) > $(SHL3LINKRES)
1589.ENDIF			# "$(SHL3ALLRES)"!=""
1590
1591.IF "$(USE_DEFFILE)"!=""
1592
1593	$(COMMAND_ECHO)$(SHL3LINKER) $(SHL3LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
1594		$(SHL3DEF) \
1595		$(STDOBJ) \
1596		-L$(LB) \
1597		-L$(SOLARVERSION)/$(INPATH)/lib \
1598		$(SHL3OBJS) $(SHL3VERSIONOBJ) \
1599		$(SHL3LIBS) \
1600		$(SHL3STDLIBS:^"-l") \
1601		$(SHL3LINKRES) \
1602		$(SHL3STDSHL:^"-l") $(STDSHL3:^"-l")
1603
1604.ELSE			# "$(USE_DEFFILE)"!=""
1605
1606	$(COMMAND_ECHO)$(SHL3LINKER) -v 	$(SHL3LINKFLAGS)			\
1607		$(LINKFLAGSSHL) $(SHL3BASEX)		\
1608		$(SHL3STACK) -o $(SHL3TARGETN)	\
1609		$(SHL3DEF) \
1610		$(STDOBJ)							\
1611		-L$(LB) \
1612		-L$(SOLARVERSION)/$(INPATH)/lib \
1613		$(SHL3OBJS) $(SHL3VERSIONOBJ) \
1614		$(SHL3LIBS) \
1615		$(SHL3STDLIBS:^"-l") \
1616		$(SHL3LINKRES) \
1617		$(SHL3STDSHL:^"-l") $(STDSHL3:^"-l")                           \
1618	@$(LS) $@ >& $(NULLDEV)
1619
1620.ENDIF			# "$(USE_DEFFILE)"!=""
1621
1622.IF "$(SHL3TARGET8)" != "$(SHL3TARGET)"
1623	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL3TARGET8).dll
1624.ENDIF
1625
1626.ENDIF			# "$(GUI)" == "OS2"
1627
1628.ENDIF			# "$(SHL3TARGETN)"!=""
1629
1630# unroll begin
1631
1632.IF "$(SHL4TARGETN)"!=""
1633
1634.IF "$(OS)"=="AIX"
1635SHL4STDLIBS=
1636.ENDIF
1637
1638.IF "$(SHLLINKARCONLY)" != ""
1639SHL4STDLIBS=
1640STDSHL=
1641.ELSE
1642SHL4ARCHIVES=
1643.ENDIF
1644
1645# decide how to link
1646.IF "$(SHL4CODETYPE)"=="C"
1647SHL4LINKER=$(LINKC)
1648SHL4STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
1649SHL4LINKFLAGS+=$(LINKCFLAGS)
1650.ELSE			# "$(SHL4CODETYPE)"=="C"
1651SHL4LINKER=$(LINK)
1652SHL4STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
1653SHL4LINKFLAGS+=$(LINKFLAGS)
1654.ENDIF			# "$(SHL4CODETYPE)"=="C"
1655
1656SHL4RPATH*=OOO
1657LINKFLAGSRUNPATH_$(SHL4RPATH)*=/ERROR:/Bad_SHL4RPATH_value
1658SHL4LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL4RPATH))
1659
1660.IF "$(SHL4USE_EXPORTS)"==""
1661SHL4DEF*=$(MISC)/$(SHL4TARGET).def
1662.ENDIF			# "$(SHL4USE_EXPORTS)"==""
1663
1664EXTRALIBPATHS4=$(EXTRALIBPATHS)
1665.IF "$(UPDATER)"=="YES"
1666.IF "$(SHL4NOCHECK)"==""
1667.IF "$(SOLAR_STLLIBPATH)"!=""
1668EXTRALIBPATHS4+=-L$(SOLAR_STLLIBPATH)
1669.ENDIF
1670.ENDIF				# "$(SHL4NOCHECK)"!=""
1671.ENDIF
1672#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1673#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
1674#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1675
1676.IF "$(L10N_framework)"==""
1677.IF "$(VERSIONOBJ)"!=""
1678SHL4VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL4TARGET))}$(VERSIONOBJ:f)
1679USE_VERSIONH:=$(INCCOM)/$(SHL4VERSIONOBJ:b).h
1680.IF "$(GUI)" == "UNX"
1681SHL4VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL4TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
1682.ELSE           # "$(GUI)" == "UNX"
1683SHL4VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL4TARGET))}$(VERSIONOBJ:f)
1684.ENDIF          # "$(GUI)" == "UNX"
1685$(MISC)/$(SHL4VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL4VERSIONOBJ:b).h
1686#    $(COPY) $(SOLARENV)/src/version.c $@
1687	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL4VERSIONOBJ:b).h/ > $@
1688
1689.INIT : $(SHL4VERSIONOBJDEP)
1690.ENDIF			# "$(VERSIONOBJ)"!=""
1691.ENDIF
1692
1693.IF "$(GUI)" != "UNX"
1694.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
1695.IF "$(SHL4IMPLIB)" == ""
1696SHL4IMPLIB=i$(TARGET)_t4
1697.ENDIF			# "$(SHL4IMPLIB)" == ""
1698.IF "$(COM)" != "GCC"
1699USE_4IMPLIB=-implib:$(LB)/$(SHL4IMPLIB).lib
1700.ENDIF			# "$(COM)" != "GCC"
1701SHL4IMPLIBN=$(LB)/$(SHL4IMPLIB).lib
1702ALLTAR : $(SHL4IMPLIBN)
1703
1704.IF "$(USE_DEFFILE)"==""
1705USE_4IMPLIB_DEPS=$(LB)/$(SHL4IMPLIB).lib
1706.ENDIF			# "$(USE_DEFFILE)"==""
1707.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
1708USE_SHL4DEF=$(SHL4DEF)
1709.ELSE			# "$(GUI)" != "UNX"
1710USE_SHL4DEF=
1711SHL4DEPN+:=$(SHL4DEPNU)
1712
1713.IF "$(SHL4VERSIONMAP)"==""
1714# to activate vmaps remove "#"
1715USE_SHL4VERSIONMAP=$(MISC)/$(SHL4TARGET).vmap
1716.ENDIF			# "$(SHL4VERSIONMAP)"==""
1717
1718.IF "$(USE_SHL4VERSIONMAP)"!=""
1719
1720.IF "$(SHL4FILTERFILE)"!=""
1721.IF "$(SHL4VERSIONMAP)"!=""
1722#eine von beiden ist zuviel
1723USE_SHL4VERSIONMAP=$(MISC)/$(SHL4TARGET).vmap
1724$(USE_SHL4VERSIONMAP) .PHONY:
1725	@echo -----------------------------
1726	@echo you should only use versionmap OR exportfile
1727	@echo -----------------------------
1728#	force_dmake_to_error
1729
1730.ENDIF			# "$(SHL4VERSIONMAP)"!=""
1731
1732SHL4VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL4VERSIONMAP)
1733
1734$(USE_SHL4VERSIONMAP): \
1735					$(SHL4OBJS)\
1736					$(SHL4LIBS)\
1737					$(SHL4FILTERFILE)
1738	@$(RM) $@.dump
1739.IF "$(SHL4OBJS)"!=""
1740# dump remaining objects on the fly
1741.IF "$(OS)"=="MACOSX"
1742	@-nm $(SHL4OBJS:s/.obj/.o/) > $@.dump
1743.ELSE
1744	@nm $(SHL4OBJS:s/.obj/.o/) > $@.dump
1745.ENDIF
1746.ENDIF			# "$(SHL4OBJS)!"=""
1747	@$(TYPE) /dev/null $(SHL4LIBS:s/.lib/.dump/) >> $@.dump
1748	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL4INTERFACE) -f $(SHL4FILTERFILE) -m $@
1749
1750.ELSE			# "$(SHL4FILTERFILE)"!=""
1751USE_SHL4VERSIONMAP=$(MISC)/$(SHL4TARGET).vmap
1752$(USE_SHL4VERSIONMAP) :
1753.IF "$(VERBOSE)" == "TRUE"
1754	@echo -----------------------------
1755	@echo SHL4FILTERFILE not set!
1756	@echo -----------------------------
1757	@$(TOUCH) $@
1758	@echo dummy file to keep the dependencies for later use.
1759.ELSE
1760	@$(TOUCH) $@
1761.ENDIF
1762#	force_dmake_to_error
1763.ENDIF			# "$(SHL4FILTERFILE)"!=""
1764.ELSE			# "$(USE_SHL4VERSIONMAP)"!=""
1765
1766#and now for the plain non-generic way...
1767.IF "$(SHL4VERSIONMAP)"!=""
1768USE_SHL4VERSIONMAP=$(MISC)/$(SHL4VERSIONMAP:b)_$(SHL4TARGET)$(SHL4VERSIONMAP:e)
1769SHL4VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL4VERSIONMAP)
1770
1771.IF "$(OS)"=="MACOSX"
1772$(USE_SHL4VERSIONMAP): $(SHL4OBJS) $(SHL4LIBS)
1773.ENDIF
1774
1775# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
1776# even if the $(AWK) part fails:
1777$(USE_SHL4VERSIONMAP) .ERRREMOVE: $(SHL4VERSIONMAP)
1778	@@-$(RM) -f $@
1779# The following files will only be generated and needed on Mac OS X as temporary files
1780# in order to generate exported symbols list out of Linux/Solaris map files
1781.IF "$(OS)"=="MACOSX"
1782	@-$(RM) -f $@.symregexp >& $(NULLDEV)
1783	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
1784.ENDIF
1785# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
1786# happens if somebody will change it in the future
1787.IF "$(COMID)"=="gcc3"
1788	$(COMMAND_ECHO) tr -d "\015" < $(SHL4VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
1789.ELIF "$(COMNAME)"=="sunpro5"
1790	$(COMMAND_ECHO) tr -d "\015" < $(SHL4VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
1791.ELSE           # "$(COMID)"=="gcc3"
1792	$(COMMAND_ECHO) tr -d "\015" < $(SHL4VERSIONMAP) > $@
1793.ENDIF          # "$(COMID)"=="gcc3"
1794	@chmod a+w $@
1795# Mac OS X post-processing generate an exported symbols list from the generated map file
1796# for details on exported symbols list see man ld on Mac OS X
1797.IF "$(OS)"=="MACOSX"
1798	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
1799	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
1800# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
1801# Extract RTTI symbols from all the objects that will be used to build a shared library
1802.IF "$(SHL4OBJS)"!=""
1803	-echo $(foreach,i,$(SHL4OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
1804.ENDIF
1805.IF "$(SHL4LIBS)"!=""
1806	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL4LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
1807.ENDIF
1808# overwrite the map file generate into the local output tree with the generated
1809# exported symbols list
1810	cp $@.exported-symbols $@
1811.ENDIF # .IF "$(OS)"=="MACOSX"
1812.ENDIF			# "$(SHL4VERSIONMAP)"!=""
1813.ENDIF			# "$(USE_SHL4VERSIONMAP)"!=""
1814.ENDIF			# "$(GUI)" != "UNX"
1815
1816.IF "$(UNIXVERSIONNAMES)"!=""
1817.IF "$(OS)"!="MACOSX"
1818.IF "$(GUI)"=="UNX"
1819SHL4SONAME=\"$(SONAME_SWITCH)$(SHL4TARGETN:f)\"
1820.ENDIF			# "$(GUI)"!="UNX"
1821.ENDIF			# "$(OS)"!="MACOSX"
1822.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
1823
1824.IF "$(SHL4RES)"!=""
1825SHL4ALLRES+=$(SHL4RES)
1826SHL4LINKRES*=$(MISC)/$(SHL4TARGET).res
1827SHL4LINKRESO*=$(MISC)/$(SHL4TARGET)_res.o
1828.ENDIF			# "$(SHL4RES)"!=""
1829
1830.IF "$(SHL4DEFAULTRES)$(use_shl_versions)"!=""
1831SHL4DEFAULTRES*=$(MISC)/$(SHL4TARGET)_def.res
1832SHL4ALLRES+=$(SHL4DEFAULTRES)
1833SHL4LINKRES*=$(MISC)/$(SHL4TARGET).res
1834SHL4LINKRESO*=$(MISC)/$(SHL4TARGET)_res.o
1835.ENDIF			# "$(SHL4DEFAULTRES)$(use_shl_versions)"!=""
1836
1837#.IF "$(SHL4TARGETN)"!=""
1838
1839.IF "$(linkinc)"!=""
1840.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
1841.IF "$(SHL4LIBS)"!=""
1842$(MISC)/$(SHL4TARGET)_linkinc.ls .PHONY:
1843	@@-$(RM) $@
1844	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL4LIBS) $(i:s/.lib/.lin/)) >> $@
1845.ENDIF          # "$(SHL4LIBS)"!=""
1846.ENDIF
1847
1848LINKINCTARGETS+=$(MISC)/$(SHL4TARGETN:b)_linkinc.ls
1849$(SHL4TARGETN) : $(LINKINCTARGETS)
1850
1851.ELSE
1852.IF "$(SHL4USE_EXPORTS)"=="name"
1853.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
1854.IF "$(COM)"!="GCC"
1855.IF "$(SHL4LIBS)"!=""
1856SHL4LINKLIST=$(MISC)/$(SHL4TARGET)_link.lst
1857SHL4LINKLISTPARAM=@$(SHL4LINKLIST)
1858$(SHL4LINKLIST) : $(SHL4LIBS)
1859    @@-$(RM) $@
1860	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL4LIBS) $(i:s/.lib/.lin/)) >> $@
1861.ENDIF          # "$(SHL4LIBS)"!=""
1862.ENDIF          # "$(COM)"!="GCC"
1863.ENDIF
1864.ENDIF			# "$(SHL4USE_EXPORTS)"=="name"
1865
1866$(MISC)/%linkinc.ls:
1867	@echo . > $@
1868.ENDIF          # "$(linkinc)"!=""
1869
1870.IF "$(GUI)" == "OS2"
1871#21/02/2006 YD dll names must be 8.3, invoke fix script
1872#check osl/os2/module.c/osl_loadModule()
1873SHL4TARGET8=$(shell @fix_shl $(SHL4TARGET))
1874.ENDIF
1875
1876.IF "$(GUI)" == "OS2"
1877_SHL4IMP_ORD = $(SHL4STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL4STDLIBS:^"$(LB)/")
1878SHL4IMP_ORD = $(foreach,i,$(_SHL4IMP_ORD) $(shell @-ls $i))
1879.ELSE
1880SHL4IMP_ORD =
1881.ENDIF
1882
1883
1884$(SHL4TARGETN) : \
1885					$(SHL4OBJS)\
1886					$(SHL4LIBS)\
1887					$(USE_4IMPLIB_DEPS)\
1888					$(USE_SHL4DEF)\
1889					$(USE_SHL4VERSIONMAP)\
1890					$(SHL4RES)\
1891					$(SHL4DEPN) \
1892					$(SHL4IMP_ORD) \
1893					$(SHL4LINKLIST)
1894	@echo "Making:   " $(@:f)
1895.IF "$(GUI)" == "WNT"
1896.IF "$(SHL4DEFAULTRES)"!=""
1897	@@-$(RM) $(MISC)/$(SHL4DEFAULTRES:b).rc
1898.IF "$(SHL4ICON)" != ""
1899	@echo 1 ICON $(SHL4ICON) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1900.ENDIF
1901.IF "$(use_shl_versions)" != ""
1902.IF "$(SHL4ADD_VERINFO)"!=""
1903	@echo $(EMQ)#include $(EMQ)"$(SHL4ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1904.ELSE			# "$(SHL4ADD_VERINFO)"!=""
1905	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1906	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1907	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1908.ENDIF			# "$(SHL4ADD_VERINFO)"!=""
1909	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1910	@echo $(EMQ)#define ORG_NAME	$(SHL4TARGET)$(DLLPOST) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1911	@echo $(EMQ)#define INTERNAL_NAME $(SHL4TARGET:b) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1912	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL4DEFAULTRES:b).rc
1913.ENDIF			# "$(use_shl_versions)" != ""
1914	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL4DEFAULTRES:b).rc
1915.ENDIF			# "$(SHL4DEFAULTRES)"!=""
1916.IF "$(SHL4ALLRES)"!=""
1917	$(COMMAND_ECHO)$(TYPE) $(SHL4ALLRES) > $(SHL4LINKRES)
1918.IF "$(COM)"=="GCC"
1919	windres $(SHL4LINKRES) $(SHL4LINKRESO)
1920.ENDIF			# "$(COM)"=="GCC"
1921.ENDIF			# "$(SHL4ALLRES)"!=""
1922.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
1923	@echo dlltool --dllname $(SHL4TARGET)$(DLLPOST) \
1924		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_4.cmd
1925	@noop $(assign ALL4OBJLIST:=$(STDOBJ) $(SHL4OBJS) $(SHL4LINKRESO) $(shell $(TYPE) /dev/null $(SHL4LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
1926.IF "$(DEFLIB4NAME)"!=""	# do not have to include objs
1927	@noop $(assign DEF4OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
1928	@noop $(foreach,i,$(DEF4OBJLIST) $(assign ALL4OBJLIST:=$(ALL4OBJLIST:s?$i??)))
1929.ENDIF			# "$(DEFLIB4NAME)"!=""
1930	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
1931.IF "$(SHL4DEF)"!=""
1932	@echo	--input-def $(SHL4DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
1933.ELSE
1934	@echo	$(SHL4VERSIONOBJ) $(SHL4DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
1935.ENDIF
1936	@echo	$(ALL4OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_4.cmd
1937	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
1938		$(STDOBJ) $(SHL4VERSIONOBJ) $(SHL4DESCRIPTIONOBJ) $(SHL4OBJS) $(SHL4LINKRESO) \
1939		`$(TYPE) /dev/null $(SHL4LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
1940		-Wl,--exclude-libs,ALL,--start-group $(SHL4STDLIBS) -Wl,--end-group \
1941		$(SHL4STDSHL) $(STDSHL4) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
1942		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_4.cmd
1943  .IF "$(VERBOSE)" == "TRUE"
1944	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_4.cmd
1945  .ENDIF
1946	@+source $(MISC)/$(TARGET).$(@:b)_4.cmd
1947.ELSE
1948.IF "$(linkinc)"==""
1949.IF "$(SHL4USE_EXPORTS)"!="name"
1950.IF "$(USE_DEFFILE)"!=""
1951	$(COMMAND_ECHO)$(SHL4LINKER) @$(mktmp \
1952		$(SHL4LINKFLAGS) \
1953		$(LINKFLAGSSHL) \
1954		$(SHL4STACK) $(SHL4BASEX)	\
1955		-out:$@ \
1956		-map:$(MISC)/$(@:b).map \
1957		-def:$(SHL4DEF) \
1958		$(USE_4IMPLIB) \
1959		$(STDOBJ) \
1960		$(SHL4VERSIONOBJ) $(SHL4OBJS) \
1961		$(SHL4LIBS) \
1962		$(SHL4STDLIBS) \
1963		$(SHL4STDSHL) $(STDSHL4) \
1964		$(SHL4LINKRES) \
1965	)
1966# double check if target was really written... still making sense?
1967    @@$(LS) $@
1968	@echo linking $@.manifest ...
1969.IF "$(VISTA_MANIFEST)"!=""
1970	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1971	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
1972.ELSE
1973	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
1974.ENDIF # "$(VISTA_MANIFEST)"!=""
1975	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1976	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1977.ELSE			# "$(USE_DEFFILE)"!=""
1978	$(COMMAND_ECHO)$(SHL4LINKER) @$(mktmp	$(SHL4LINKFLAGS)			\
1979		$(LINKFLAGSSHL) $(SHL4BASEX)		\
1980		$(SHL4STACK) -out:$(SHL4TARGETN)	\
1981		-map:$(MISC)/$(@:B).map				\
1982		$(LB)/$(SHL4IMPLIB).exp				\
1983		$(STDOBJ)							\
1984		$(SHL4OBJS) $(SHL4VERSIONOBJ) \
1985		$(SHL4LIBS)                         \
1986		$(SHL4STDLIBS)                      \
1987		$(SHL4STDSHL) $(STDSHL4)                           \
1988		$(SHL4LINKRES) \
1989	)
1990# double check if target was really written... still making sense?
1991    @@$(LS) $@
1992	@echo linking $@.manifest ...
1993.IF "$(VISTA_MANIFEST)"!=""
1994	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1995	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
1996.ELSE
1997	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
1998.ENDIF # "$(VISTA_MANIFEST)"!=""
1999	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2000	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2001.ENDIF			# "$(USE_DEFFILE)"!=""
2002.ELSE			# "$(SHL4USE_EXPORTS)"!="name"
2003	$(COMMAND_ECHO)$(SHL4LINKER) @$(mktmp	$(SHL4LINKFLAGS)			\
2004		$(LINKFLAGSSHL) $(SHL4BASEX)		\
2005		$(SHL4STACK) -out:$(SHL4TARGETN)	\
2006		-map:$(MISC)/$(@:B).map				\
2007		$(USE_4IMPLIB) \
2008		$(STDOBJ)							\
2009		$(SHL4OBJS) $(SHL4VERSIONOBJ))   \
2010		$(SHL4LINKLISTPARAM) \
2011		@$(mktmp $(SHL4STDLIBS)                      \
2012		$(SHL4STDSHL) $(STDSHL4)                           \
2013		$(SHL4LINKRES) \
2014	)
2015	@echo linking $@.manifest ...
2016.IF "$(VISTA_MANIFEST)"!=""
2017	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2018	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
2019.ELSE
2020	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
2021.ENDIF # "$(VISTA_MANIFEST)"!=""
2022	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2023	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2024.ENDIF			# "$(SHL4USE_EXPORTS)"!="name"
2025.ELSE			# "$(linkinc)"==""
2026		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL4TARGET).lnk
2027		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL4TARGET).lst
2028		$(COMMAND_ECHO)$(TYPE) $(mktmp \
2029		$(SHL4LINKFLAGS) \
2030		$(LINKFLAGSSHL) $(SHL4BASEX) \
2031		$(SHL4STACK) $(MAPFILE) \
2032		-out:$@ \
2033		$(LB)/$(SHL4IMPLIB).exp \
2034		$(STDOBJ) \
2035		$(SHL4OBJS) \
2036		$(SHL4STDLIBS) \
2037		$(SHL4STDSHL) $(STDSHL4) \
2038		$(SHL4LINKRES) \
2039		) >> $(MISC)/$(SHL4TARGET).lnk
2040		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL4TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL4TARGET).lnk
2041		$(COMMAND_ECHO)$(SHL4LINKER) @$(MISC)/$(SHL4TARGET).lnk
2042		@echo linking $@.manifest ...
2043.IF "$(VISTA_MANIFEST)"!=""
2044		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2045		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
2046.ELSE
2047		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
2048.ENDIF # "$(VISTA_MANIFEST)"!=""
2049		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2050		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2051.ENDIF			# "$(linkinc)"==""
2052.ENDIF			# "$(COM)"=="GCC"
2053.ENDIF			# "$(GUI)" == "WNT"
2054.IF "$(GUI)"=="UNX"
2055.IF "$(OS)"=="MACOSX"
2056	@-$(RM) $(MISC)/$(@:b).list
2057	@-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
2058	@echo $(STDSLO) $(SHL4OBJS:s/.obj/.o/) \
2059	$(SHL4VERSIONOBJ) \
2060	`cat /dev/null $(SHL4LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
2061	@echo -n $(SHL4LINKER) $(SHL4LINKFLAGS) $(SHL4VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
2062	$(SHL4STDLIBS) $(SHL4ARCHIVES) $(SHL4STDSHL) $(STDSHL4) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_4.cmd
2063    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
2064        `cat $(MISC)/$(TARGET).$(@:b)_4.cmd` \
2065        >> $(MISC)/$(TARGET).$(@:b)_4.cmd
2066  .IF "$(VERBOSE)" == "TRUE"
2067	@cat $(MISC)/$(TARGET).$(@:b)_4.cmd
2068  .ENDIF
2069	@+source $(MISC)/$(TARGET).$(@:b)_4.cmd
2070    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
2071        shl $(SHL4RPATH) $@
2072.IF "$(SHL4CREATEJNILIB)"!=""
2073	@echo "Making:   " $(@:f).jnilib
2074	@macosx-create-bundle $@
2075.ENDIF          # "$(SHL4CREATEJNILIB)"!=""
2076.IF "$(UPDATER)"=="YES"
2077.IF "$(SHL4NOCHECK)"==""
2078	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN)
2079.ENDIF				# "$(SHL4NOCHECK)"!=""
2080.ENDIF
2081.ELSE			# "$(OS)"=="MACOSX"
2082	@-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
2083	@echo $(SHL4LINKER) $(SHL4LINKFLAGS) $(SHL4SONAME) $(LINKFLAGSSHL) $(SHL4VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL4OBJS:s/.obj/.o/) \
2084	$(SHL4VERSIONOBJ) -o $@ \
2085	`cat /dev/null $(SHL4LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
2086	$(SHL4STDLIBS) $(SHL4ARCHIVES) $(SHL4STDSHL) $(STDSHL4) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_4.cmd
2087  .IF "$(VERBOSE)" == "TRUE"
2088	@cat $(MISC)/$(TARGET).$(@:b)_4.cmd
2089  .ENDIF
2090	@+source $(MISC)/$(TARGET).$(@:b)_4.cmd
2091.IF "$(UPDATER)"=="YES"
2092.IF "$(SHL4NOCHECK)"==""
2093	$(COMMAND_ECHO)-$(RM) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
2094	$(COMMAND_ECHO)$(RENAME) $(SHL4TARGETN) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
2095.IF "$(VERBOSE)"=="TRUE"
2096	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
2097.ELSE
2098	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) -- -s $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
2099.ENDIF
2100.ENDIF				# "$(SHL4NOCHECK)"!=""
2101.ENDIF			# "$(UPDATER)"=="YES"
2102.ENDIF			# "$(OS)"=="MACOSX"
2103.IF "$(UNIXVERSIONNAMES)"!=""
2104	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL4TARGETN:b)
2105	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL4TARGETN:f) $(SHL4TARGETN:b)
2106.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
2107.IF "$(VERBOSE)" == "TRUE"
2108	@ls -l $@
2109.ENDIF
2110.ENDIF			# "$(GUI)" == "UNX"
2111
2112.IF "$(GUI)" == "OS2"
2113
2114.IF "$(SHL4DEFAULTRES)"!=""
2115	@+-$(RM) $(MISC)/$(SHL4DEFAULTRES:b).rc >& $(NULLDEV)
2116.IF "$(SHL4ICON)" != ""
2117	@-+echo 1 ICON $(SHL4ICON) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
2118.ENDIF
2119.IF "$(use_shl_versions)" != ""
2120.IF "$(SHL4ADD_VERINFO)"!=""
2121	@-+echo $(EMQ)#include $(EMQ)"$(SHL4ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL4DEFAULTRES:b).rc
2122.ENDIF			# "$(SHL4ADD_VERINFO)"!=""
2123	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL4DEFAULTRES:b).rc
2124#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
2125.ENDIF			# "$(use_shl_versions)" != ""
2126# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
2127	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL4DEFAULTRES:b).rc
2128.ENDIF			# "$(SHL4DEFAULTRES)"!=""
2129
2130.IF "$(SHL4ALLRES)"!=""
2131	$(COMMAND_ECHO)+$(TYPE) $(SHL4ALLRES) > $(SHL4LINKRES)
2132.ENDIF			# "$(SHL4ALLRES)"!=""
2133
2134.IF "$(USE_DEFFILE)"!=""
2135
2136	$(COMMAND_ECHO)$(SHL4LINKER) $(SHL4LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
2137		$(SHL4DEF) \
2138		$(STDOBJ) \
2139		-L$(LB) \
2140		-L$(SOLARVERSION)/$(INPATH)/lib \
2141		$(SHL4OBJS) $(SHL4VERSIONOBJ) \
2142		$(SHL4LIBS) \
2143		$(SHL4STDLIBS:^"-l") \
2144		$(SHL4LINKRES) \
2145		$(SHL4STDSHL:^"-l") $(STDSHL4:^"-l")
2146
2147.ELSE			# "$(USE_DEFFILE)"!=""
2148
2149	$(COMMAND_ECHO)$(SHL4LINKER) -v 	$(SHL4LINKFLAGS)			\
2150		$(LINKFLAGSSHL) $(SHL4BASEX)		\
2151		$(SHL4STACK) -o $(SHL4TARGETN)	\
2152		$(SHL4DEF) \
2153		$(STDOBJ)							\
2154		-L$(LB) \
2155		-L$(SOLARVERSION)/$(INPATH)/lib \
2156		$(SHL4OBJS) $(SHL4VERSIONOBJ) \
2157		$(SHL4LIBS) \
2158		$(SHL4STDLIBS:^"-l") \
2159		$(SHL4LINKRES) \
2160		$(SHL4STDSHL:^"-l") $(STDSHL4:^"-l")                           \
2161	@$(LS) $@ >& $(NULLDEV)
2162
2163.ENDIF			# "$(USE_DEFFILE)"!=""
2164
2165.IF "$(SHL4TARGET8)" != "$(SHL4TARGET)"
2166	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL4TARGET8).dll
2167.ENDIF
2168
2169.ENDIF			# "$(GUI)" == "OS2"
2170
2171.ENDIF			# "$(SHL4TARGETN)"!=""
2172
2173# unroll begin
2174
2175.IF "$(SHL5TARGETN)"!=""
2176
2177.IF "$(OS)"=="AIX"
2178SHL5STDLIBS=
2179.ENDIF
2180
2181.IF "$(SHLLINKARCONLY)" != ""
2182SHL5STDLIBS=
2183STDSHL=
2184.ELSE
2185SHL5ARCHIVES=
2186.ENDIF
2187
2188# decide how to link
2189.IF "$(SHL5CODETYPE)"=="C"
2190SHL5LINKER=$(LINKC)
2191SHL5STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
2192SHL5LINKFLAGS+=$(LINKCFLAGS)
2193.ELSE			# "$(SHL5CODETYPE)"=="C"
2194SHL5LINKER=$(LINK)
2195SHL5STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
2196SHL5LINKFLAGS+=$(LINKFLAGS)
2197.ENDIF			# "$(SHL5CODETYPE)"=="C"
2198
2199SHL5RPATH*=OOO
2200LINKFLAGSRUNPATH_$(SHL5RPATH)*=/ERROR:/Bad_SHL5RPATH_value
2201SHL5LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL5RPATH))
2202
2203.IF "$(SHL5USE_EXPORTS)"==""
2204SHL5DEF*=$(MISC)/$(SHL5TARGET).def
2205.ENDIF			# "$(SHL5USE_EXPORTS)"==""
2206
2207EXTRALIBPATHS5=$(EXTRALIBPATHS)
2208.IF "$(UPDATER)"=="YES"
2209.IF "$(SHL5NOCHECK)"==""
2210.IF "$(SOLAR_STLLIBPATH)"!=""
2211EXTRALIBPATHS5+=-L$(SOLAR_STLLIBPATH)
2212.ENDIF
2213.ENDIF				# "$(SHL5NOCHECK)"!=""
2214.ENDIF
2215#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2216#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
2217#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2218
2219.IF "$(L10N_framework)"==""
2220.IF "$(VERSIONOBJ)"!=""
2221SHL5VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL5TARGET))}$(VERSIONOBJ:f)
2222USE_VERSIONH:=$(INCCOM)/$(SHL5VERSIONOBJ:b).h
2223.IF "$(GUI)" == "UNX"
2224SHL5VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL5TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
2225.ELSE           # "$(GUI)" == "UNX"
2226SHL5VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL5TARGET))}$(VERSIONOBJ:f)
2227.ENDIF          # "$(GUI)" == "UNX"
2228$(MISC)/$(SHL5VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL5VERSIONOBJ:b).h
2229#    $(COPY) $(SOLARENV)/src/version.c $@
2230	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL5VERSIONOBJ:b).h/ > $@
2231
2232.INIT : $(SHL5VERSIONOBJDEP)
2233.ENDIF			# "$(VERSIONOBJ)"!=""
2234.ENDIF
2235
2236.IF "$(GUI)" != "UNX"
2237.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
2238.IF "$(SHL5IMPLIB)" == ""
2239SHL5IMPLIB=i$(TARGET)_t5
2240.ENDIF			# "$(SHL5IMPLIB)" == ""
2241.IF "$(COM)" != "GCC"
2242USE_5IMPLIB=-implib:$(LB)/$(SHL5IMPLIB).lib
2243.ENDIF			# "$(COM)" != "GCC"
2244SHL5IMPLIBN=$(LB)/$(SHL5IMPLIB).lib
2245ALLTAR : $(SHL5IMPLIBN)
2246
2247.IF "$(USE_DEFFILE)"==""
2248USE_5IMPLIB_DEPS=$(LB)/$(SHL5IMPLIB).lib
2249.ENDIF			# "$(USE_DEFFILE)"==""
2250.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
2251USE_SHL5DEF=$(SHL5DEF)
2252.ELSE			# "$(GUI)" != "UNX"
2253USE_SHL5DEF=
2254SHL5DEPN+:=$(SHL5DEPNU)
2255
2256.IF "$(SHL5VERSIONMAP)"==""
2257# to activate vmaps remove "#"
2258USE_SHL5VERSIONMAP=$(MISC)/$(SHL5TARGET).vmap
2259.ENDIF			# "$(SHL5VERSIONMAP)"==""
2260
2261.IF "$(USE_SHL5VERSIONMAP)"!=""
2262
2263.IF "$(SHL5FILTERFILE)"!=""
2264.IF "$(SHL5VERSIONMAP)"!=""
2265#eine von beiden ist zuviel
2266USE_SHL5VERSIONMAP=$(MISC)/$(SHL5TARGET).vmap
2267$(USE_SHL5VERSIONMAP) .PHONY:
2268	@echo -----------------------------
2269	@echo you should only use versionmap OR exportfile
2270	@echo -----------------------------
2271#	force_dmake_to_error
2272
2273.ENDIF			# "$(SHL5VERSIONMAP)"!=""
2274
2275SHL5VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL5VERSIONMAP)
2276
2277$(USE_SHL5VERSIONMAP): \
2278					$(SHL5OBJS)\
2279					$(SHL5LIBS)\
2280					$(SHL5FILTERFILE)
2281	@$(RM) $@.dump
2282.IF "$(SHL5OBJS)"!=""
2283# dump remaining objects on the fly
2284.IF "$(OS)"=="MACOSX"
2285	@-nm $(SHL5OBJS:s/.obj/.o/) > $@.dump
2286.ELSE
2287	@nm $(SHL5OBJS:s/.obj/.o/) > $@.dump
2288.ENDIF
2289.ENDIF			# "$(SHL5OBJS)!"=""
2290	@$(TYPE) /dev/null $(SHL5LIBS:s/.lib/.dump/) >> $@.dump
2291	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL5INTERFACE) -f $(SHL5FILTERFILE) -m $@
2292
2293.ELSE			# "$(SHL5FILTERFILE)"!=""
2294USE_SHL5VERSIONMAP=$(MISC)/$(SHL5TARGET).vmap
2295$(USE_SHL5VERSIONMAP) :
2296.IF "$(VERBOSE)" == "TRUE"
2297	@echo -----------------------------
2298	@echo SHL5FILTERFILE not set!
2299	@echo -----------------------------
2300	@$(TOUCH) $@
2301	@echo dummy file to keep the dependencies for later use.
2302.ELSE
2303	@$(TOUCH) $@
2304.ENDIF
2305#	force_dmake_to_error
2306.ENDIF			# "$(SHL5FILTERFILE)"!=""
2307.ELSE			# "$(USE_SHL5VERSIONMAP)"!=""
2308
2309#and now for the plain non-generic way...
2310.IF "$(SHL5VERSIONMAP)"!=""
2311USE_SHL5VERSIONMAP=$(MISC)/$(SHL5VERSIONMAP:b)_$(SHL5TARGET)$(SHL5VERSIONMAP:e)
2312SHL5VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL5VERSIONMAP)
2313
2314.IF "$(OS)"=="MACOSX"
2315$(USE_SHL5VERSIONMAP): $(SHL5OBJS) $(SHL5LIBS)
2316.ENDIF
2317
2318# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
2319# even if the $(AWK) part fails:
2320$(USE_SHL5VERSIONMAP) .ERRREMOVE: $(SHL5VERSIONMAP)
2321	@@-$(RM) -f $@
2322# The following files will only be generated and needed on Mac OS X as temporary files
2323# in order to generate exported symbols list out of Linux/Solaris map files
2324.IF "$(OS)"=="MACOSX"
2325	@-$(RM) -f $@.symregexp >& $(NULLDEV)
2326	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
2327.ENDIF
2328# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
2329# happens if somebody will change it in the future
2330.IF "$(COMID)"=="gcc3"
2331	$(COMMAND_ECHO) tr -d "\015" < $(SHL5VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
2332.ELIF "$(COMNAME)"=="sunpro5"
2333	$(COMMAND_ECHO) tr -d "\015" < $(SHL5VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
2334.ELSE           # "$(COMID)"=="gcc3"
2335	$(COMMAND_ECHO) tr -d "\015" < $(SHL5VERSIONMAP) > $@
2336.ENDIF          # "$(COMID)"=="gcc3"
2337	@chmod a+w $@
2338# Mac OS X post-processing generate an exported symbols list from the generated map file
2339# for details on exported symbols list see man ld on Mac OS X
2340.IF "$(OS)"=="MACOSX"
2341	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
2342	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
2343# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
2344# Extract RTTI symbols from all the objects that will be used to build a shared library
2345.IF "$(SHL5OBJS)"!=""
2346	-echo $(foreach,i,$(SHL5OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
2347.ENDIF
2348.IF "$(SHL5LIBS)"!=""
2349	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL5LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
2350.ENDIF
2351# overwrite the map file generate into the local output tree with the generated
2352# exported symbols list
2353	cp $@.exported-symbols $@
2354.ENDIF # .IF "$(OS)"=="MACOSX"
2355.ENDIF			# "$(SHL5VERSIONMAP)"!=""
2356.ENDIF			# "$(USE_SHL5VERSIONMAP)"!=""
2357.ENDIF			# "$(GUI)" != "UNX"
2358
2359.IF "$(UNIXVERSIONNAMES)"!=""
2360.IF "$(OS)"!="MACOSX"
2361.IF "$(GUI)"=="UNX"
2362SHL5SONAME=\"$(SONAME_SWITCH)$(SHL5TARGETN:f)\"
2363.ENDIF			# "$(GUI)"!="UNX"
2364.ENDIF			# "$(OS)"!="MACOSX"
2365.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
2366
2367.IF "$(SHL5RES)"!=""
2368SHL5ALLRES+=$(SHL5RES)
2369SHL5LINKRES*=$(MISC)/$(SHL5TARGET).res
2370SHL5LINKRESO*=$(MISC)/$(SHL5TARGET)_res.o
2371.ENDIF			# "$(SHL5RES)"!=""
2372
2373.IF "$(SHL5DEFAULTRES)$(use_shl_versions)"!=""
2374SHL5DEFAULTRES*=$(MISC)/$(SHL5TARGET)_def.res
2375SHL5ALLRES+=$(SHL5DEFAULTRES)
2376SHL5LINKRES*=$(MISC)/$(SHL5TARGET).res
2377SHL5LINKRESO*=$(MISC)/$(SHL5TARGET)_res.o
2378.ENDIF			# "$(SHL5DEFAULTRES)$(use_shl_versions)"!=""
2379
2380#.IF "$(SHL5TARGETN)"!=""
2381
2382.IF "$(linkinc)"!=""
2383.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
2384.IF "$(SHL5LIBS)"!=""
2385$(MISC)/$(SHL5TARGET)_linkinc.ls .PHONY:
2386	@@-$(RM) $@
2387	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL5LIBS) $(i:s/.lib/.lin/)) >> $@
2388.ENDIF          # "$(SHL5LIBS)"!=""
2389.ENDIF
2390
2391LINKINCTARGETS+=$(MISC)/$(SHL5TARGETN:b)_linkinc.ls
2392$(SHL5TARGETN) : $(LINKINCTARGETS)
2393
2394.ELSE
2395.IF "$(SHL5USE_EXPORTS)"=="name"
2396.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
2397.IF "$(COM)"!="GCC"
2398.IF "$(SHL5LIBS)"!=""
2399SHL5LINKLIST=$(MISC)/$(SHL5TARGET)_link.lst
2400SHL5LINKLISTPARAM=@$(SHL5LINKLIST)
2401$(SHL5LINKLIST) : $(SHL5LIBS)
2402    @@-$(RM) $@
2403	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL5LIBS) $(i:s/.lib/.lin/)) >> $@
2404.ENDIF          # "$(SHL5LIBS)"!=""
2405.ENDIF          # "$(COM)"!="GCC"
2406.ENDIF
2407.ENDIF			# "$(SHL5USE_EXPORTS)"=="name"
2408
2409$(MISC)/%linkinc.ls:
2410	@echo . > $@
2411.ENDIF          # "$(linkinc)"!=""
2412
2413.IF "$(GUI)" == "OS2"
2414#21/02/2006 YD dll names must be 8.3, invoke fix script
2415#check osl/os2/module.c/osl_loadModule()
2416SHL5TARGET8=$(shell @fix_shl $(SHL5TARGET))
2417.ENDIF
2418
2419.IF "$(GUI)" == "OS2"
2420_SHL5IMP_ORD = $(SHL5STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL5STDLIBS:^"$(LB)/")
2421SHL5IMP_ORD = $(foreach,i,$(_SHL5IMP_ORD) $(shell @-ls $i))
2422.ELSE
2423SHL5IMP_ORD =
2424.ENDIF
2425
2426
2427$(SHL5TARGETN) : \
2428					$(SHL5OBJS)\
2429					$(SHL5LIBS)\
2430					$(USE_5IMPLIB_DEPS)\
2431					$(USE_SHL5DEF)\
2432					$(USE_SHL5VERSIONMAP)\
2433					$(SHL5RES)\
2434					$(SHL5DEPN) \
2435					$(SHL5IMP_ORD) \
2436					$(SHL5LINKLIST)
2437	@echo "Making:   " $(@:f)
2438.IF "$(GUI)" == "WNT"
2439.IF "$(SHL5DEFAULTRES)"!=""
2440	@@-$(RM) $(MISC)/$(SHL5DEFAULTRES:b).rc
2441.IF "$(SHL5ICON)" != ""
2442	@echo 1 ICON $(SHL5ICON) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2443.ENDIF
2444.IF "$(use_shl_versions)" != ""
2445.IF "$(SHL5ADD_VERINFO)"!=""
2446	@echo $(EMQ)#include $(EMQ)"$(SHL5ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2447.ELSE			# "$(SHL5ADD_VERINFO)"!=""
2448	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2449	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2450	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2451.ENDIF			# "$(SHL5ADD_VERINFO)"!=""
2452	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2453	@echo $(EMQ)#define ORG_NAME	$(SHL5TARGET)$(DLLPOST) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2454	@echo $(EMQ)#define INTERNAL_NAME $(SHL5TARGET:b) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2455	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2456.ENDIF			# "$(use_shl_versions)" != ""
2457	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL5DEFAULTRES:b).rc
2458.ENDIF			# "$(SHL5DEFAULTRES)"!=""
2459.IF "$(SHL5ALLRES)"!=""
2460	$(COMMAND_ECHO)$(TYPE) $(SHL5ALLRES) > $(SHL5LINKRES)
2461.IF "$(COM)"=="GCC"
2462	windres $(SHL5LINKRES) $(SHL5LINKRESO)
2463.ENDIF			# "$(COM)"=="GCC"
2464.ENDIF			# "$(SHL5ALLRES)"!=""
2465.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
2466	@echo dlltool --dllname $(SHL5TARGET)$(DLLPOST) \
2467		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_5.cmd
2468	@noop $(assign ALL5OBJLIST:=$(STDOBJ) $(SHL5OBJS) $(SHL5LINKRESO) $(shell $(TYPE) /dev/null $(SHL5LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
2469.IF "$(DEFLIB5NAME)"!=""	# do not have to include objs
2470	@noop $(assign DEF5OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
2471	@noop $(foreach,i,$(DEF5OBJLIST) $(assign ALL5OBJLIST:=$(ALL5OBJLIST:s?$i??)))
2472.ENDIF			# "$(DEFLIB5NAME)"!=""
2473	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
2474.IF "$(SHL5DEF)"!=""
2475	@echo	--input-def $(SHL5DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
2476.ELSE
2477	@echo	$(SHL5VERSIONOBJ) $(SHL5DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
2478.ENDIF
2479	@echo	$(ALL5OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_5.cmd
2480	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
2481		$(STDOBJ) $(SHL5VERSIONOBJ) $(SHL5DESCRIPTIONOBJ) $(SHL5OBJS) $(SHL5LINKRESO) \
2482		`$(TYPE) /dev/null $(SHL5LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
2483		-Wl,--exclude-libs,ALL,--start-group $(SHL5STDLIBS) -Wl,--end-group \
2484		$(SHL5STDSHL) $(STDSHL5) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
2485		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_5.cmd
2486  .IF "$(VERBOSE)" == "TRUE"
2487	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_5.cmd
2488  .ENDIF
2489	@+source $(MISC)/$(TARGET).$(@:b)_5.cmd
2490.ELSE
2491.IF "$(linkinc)"==""
2492.IF "$(SHL5USE_EXPORTS)"!="name"
2493.IF "$(USE_DEFFILE)"!=""
2494	$(COMMAND_ECHO)$(SHL5LINKER) @$(mktmp \
2495		$(SHL5LINKFLAGS) \
2496		$(LINKFLAGSSHL) \
2497		$(SHL5STACK) $(SHL5BASEX)	\
2498		-out:$@ \
2499		-map:$(MISC)/$(@:b).map \
2500		-def:$(SHL5DEF) \
2501		$(USE_5IMPLIB) \
2502		$(STDOBJ) \
2503		$(SHL5VERSIONOBJ) $(SHL5OBJS) \
2504		$(SHL5LIBS) \
2505		$(SHL5STDLIBS) \
2506		$(SHL5STDSHL) $(STDSHL5) \
2507		$(SHL5LINKRES) \
2508	)
2509# double check if target was really written... still making sense?
2510    @@$(LS) $@
2511	@echo linking $@.manifest ...
2512.IF "$(VISTA_MANIFEST)"!=""
2513	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2514	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
2515.ELSE
2516	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
2517.ENDIF # "$(VISTA_MANIFEST)"!=""
2518	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2519	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2520.ELSE			# "$(USE_DEFFILE)"!=""
2521	$(COMMAND_ECHO)$(SHL5LINKER) @$(mktmp	$(SHL5LINKFLAGS)			\
2522		$(LINKFLAGSSHL) $(SHL5BASEX)		\
2523		$(SHL5STACK) -out:$(SHL5TARGETN)	\
2524		-map:$(MISC)/$(@:B).map				\
2525		$(LB)/$(SHL5IMPLIB).exp				\
2526		$(STDOBJ)							\
2527		$(SHL5OBJS) $(SHL5VERSIONOBJ) \
2528		$(SHL5LIBS)                         \
2529		$(SHL5STDLIBS)                      \
2530		$(SHL5STDSHL) $(STDSHL5)                           \
2531		$(SHL5LINKRES) \
2532	)
2533# double check if target was really written... still making sense?
2534    @@$(LS) $@
2535	@echo linking $@.manifest ...
2536.IF "$(VISTA_MANIFEST)"!=""
2537	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2538	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
2539.ELSE
2540	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
2541.ENDIF # "$(VISTA_MANIFEST)"!=""
2542	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2543	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2544.ENDIF			# "$(USE_DEFFILE)"!=""
2545.ELSE			# "$(SHL5USE_EXPORTS)"!="name"
2546	$(COMMAND_ECHO)$(SHL5LINKER) @$(mktmp	$(SHL5LINKFLAGS)			\
2547		$(LINKFLAGSSHL) $(SHL5BASEX)		\
2548		$(SHL5STACK) -out:$(SHL5TARGETN)	\
2549		-map:$(MISC)/$(@:B).map				\
2550		$(USE_5IMPLIB) \
2551		$(STDOBJ)							\
2552		$(SHL5OBJS) $(SHL5VERSIONOBJ))   \
2553		$(SHL5LINKLISTPARAM) \
2554		@$(mktmp $(SHL5STDLIBS)                      \
2555		$(SHL5STDSHL) $(STDSHL5)                           \
2556		$(SHL5LINKRES) \
2557	)
2558	@echo linking $@.manifest ...
2559.IF "$(VISTA_MANIFEST)"!=""
2560	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2561	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
2562.ELSE
2563	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
2564.ENDIF # "$(VISTA_MANIFEST)"!=""
2565	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2566	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2567.ENDIF			# "$(SHL5USE_EXPORTS)"!="name"
2568.ELSE			# "$(linkinc)"==""
2569		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL5TARGET).lnk
2570		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL5TARGET).lst
2571		$(COMMAND_ECHO)$(TYPE) $(mktmp \
2572		$(SHL5LINKFLAGS) \
2573		$(LINKFLAGSSHL) $(SHL5BASEX) \
2574		$(SHL5STACK) $(MAPFILE) \
2575		-out:$@ \
2576		$(LB)/$(SHL5IMPLIB).exp \
2577		$(STDOBJ) \
2578		$(SHL5OBJS) \
2579		$(SHL5STDLIBS) \
2580		$(SHL5STDSHL) $(STDSHL5) \
2581		$(SHL5LINKRES) \
2582		) >> $(MISC)/$(SHL5TARGET).lnk
2583		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL5TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL5TARGET).lnk
2584		$(COMMAND_ECHO)$(SHL5LINKER) @$(MISC)/$(SHL5TARGET).lnk
2585		@echo linking $@.manifest ...
2586.IF "$(VISTA_MANIFEST)"!=""
2587		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2588		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
2589.ELSE
2590		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
2591.ENDIF # "$(VISTA_MANIFEST)"!=""
2592		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2593		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2594.ENDIF			# "$(linkinc)"==""
2595.ENDIF			# "$(COM)"=="GCC"
2596.ENDIF			# "$(GUI)" == "WNT"
2597.IF "$(GUI)"=="UNX"
2598.IF "$(OS)"=="MACOSX"
2599	@-$(RM) $(MISC)/$(@:b).list
2600	@-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
2601	@echo $(STDSLO) $(SHL5OBJS:s/.obj/.o/) \
2602	$(SHL5VERSIONOBJ) \
2603	`cat /dev/null $(SHL5LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
2604	@echo -n $(SHL5LINKER) $(SHL5LINKFLAGS) $(SHL5VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
2605	$(SHL5STDLIBS) $(SHL5ARCHIVES) $(SHL5STDSHL) $(STDSHL5) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_5.cmd
2606    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
2607        `cat $(MISC)/$(TARGET).$(@:b)_5.cmd` \
2608        >> $(MISC)/$(TARGET).$(@:b)_5.cmd
2609  .IF "$(VERBOSE)" == "TRUE"
2610	@cat $(MISC)/$(TARGET).$(@:b)_5.cmd
2611  .ENDIF
2612	@+source $(MISC)/$(TARGET).$(@:b)_5.cmd
2613    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
2614        shl $(SHL5RPATH) $@
2615.IF "$(SHL5CREATEJNILIB)"!=""
2616	@echo "Making:   " $(@:f).jnilib
2617	@macosx-create-bundle $@
2618.ENDIF          # "$(SHL5CREATEJNILIB)"!=""
2619.IF "$(UPDATER)"=="YES"
2620.IF "$(SHL5NOCHECK)"==""
2621	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN)
2622.ENDIF				# "$(SHL5NOCHECK)"!=""
2623.ENDIF
2624.ELSE			# "$(OS)"=="MACOSX"
2625	@-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
2626	@echo $(SHL5LINKER) $(SHL5LINKFLAGS) $(SHL5SONAME) $(LINKFLAGSSHL) $(SHL5VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL5OBJS:s/.obj/.o/) \
2627	$(SHL5VERSIONOBJ) -o $@ \
2628	`cat /dev/null $(SHL5LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
2629	$(SHL5STDLIBS) $(SHL5ARCHIVES) $(SHL5STDSHL) $(STDSHL5) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_5.cmd
2630  .IF "$(VERBOSE)" == "TRUE"
2631	@cat $(MISC)/$(TARGET).$(@:b)_5.cmd
2632  .ENDIF
2633	@+source $(MISC)/$(TARGET).$(@:b)_5.cmd
2634.IF "$(UPDATER)"=="YES"
2635.IF "$(SHL5NOCHECK)"==""
2636	$(COMMAND_ECHO)-$(RM) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
2637	$(COMMAND_ECHO)$(RENAME) $(SHL5TARGETN) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
2638.IF "$(VERBOSE)"=="TRUE"
2639	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
2640.ELSE
2641	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) -- -s $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
2642.ENDIF
2643.ENDIF				# "$(SHL5NOCHECK)"!=""
2644.ENDIF			# "$(UPDATER)"=="YES"
2645.ENDIF			# "$(OS)"=="MACOSX"
2646.IF "$(UNIXVERSIONNAMES)"!=""
2647	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL5TARGETN:b)
2648	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL5TARGETN:f) $(SHL5TARGETN:b)
2649.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
2650.IF "$(VERBOSE)" == "TRUE"
2651	@ls -l $@
2652.ENDIF
2653.ENDIF			# "$(GUI)" == "UNX"
2654
2655.IF "$(GUI)" == "OS2"
2656
2657.IF "$(SHL5DEFAULTRES)"!=""
2658	@+-$(RM) $(MISC)/$(SHL5DEFAULTRES:b).rc >& $(NULLDEV)
2659.IF "$(SHL5ICON)" != ""
2660	@-+echo 1 ICON $(SHL5ICON) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2661.ENDIF
2662.IF "$(use_shl_versions)" != ""
2663.IF "$(SHL5ADD_VERINFO)"!=""
2664	@-+echo $(EMQ)#include $(EMQ)"$(SHL5ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2665.ENDIF			# "$(SHL5ADD_VERINFO)"!=""
2666	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2667#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
2668.ENDIF			# "$(use_shl_versions)" != ""
2669# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
2670	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL5DEFAULTRES:b).rc
2671.ENDIF			# "$(SHL5DEFAULTRES)"!=""
2672
2673.IF "$(SHL5ALLRES)"!=""
2674	$(COMMAND_ECHO)+$(TYPE) $(SHL5ALLRES) > $(SHL5LINKRES)
2675.ENDIF			# "$(SHL5ALLRES)"!=""
2676
2677.IF "$(USE_DEFFILE)"!=""
2678
2679	$(COMMAND_ECHO)$(SHL5LINKER) $(SHL5LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
2680		$(SHL5DEF) \
2681		$(STDOBJ) \
2682		-L$(LB) \
2683		-L$(SOLARVERSION)/$(INPATH)/lib \
2684		$(SHL5OBJS) $(SHL5VERSIONOBJ) \
2685		$(SHL5LIBS) \
2686		$(SHL5STDLIBS:^"-l") \
2687		$(SHL5LINKRES) \
2688		$(SHL5STDSHL:^"-l") $(STDSHL5:^"-l")
2689
2690.ELSE			# "$(USE_DEFFILE)"!=""
2691
2692	$(COMMAND_ECHO)$(SHL5LINKER) -v 	$(SHL5LINKFLAGS)			\
2693		$(LINKFLAGSSHL) $(SHL5BASEX)		\
2694		$(SHL5STACK) -o $(SHL5TARGETN)	\
2695		$(SHL5DEF) \
2696		$(STDOBJ)							\
2697		-L$(LB) \
2698		-L$(SOLARVERSION)/$(INPATH)/lib \
2699		$(SHL5OBJS) $(SHL5VERSIONOBJ) \
2700		$(SHL5LIBS) \
2701		$(SHL5STDLIBS:^"-l") \
2702		$(SHL5LINKRES) \
2703		$(SHL5STDSHL:^"-l") $(STDSHL5:^"-l")                           \
2704	@$(LS) $@ >& $(NULLDEV)
2705
2706.ENDIF			# "$(USE_DEFFILE)"!=""
2707
2708.IF "$(SHL5TARGET8)" != "$(SHL5TARGET)"
2709	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL5TARGET8).dll
2710.ENDIF
2711
2712.ENDIF			# "$(GUI)" == "OS2"
2713
2714.ENDIF			# "$(SHL5TARGETN)"!=""
2715
2716# unroll begin
2717
2718.IF "$(SHL6TARGETN)"!=""
2719
2720.IF "$(OS)"=="AIX"
2721SHL6STDLIBS=
2722.ENDIF
2723
2724.IF "$(SHLLINKARCONLY)" != ""
2725SHL6STDLIBS=
2726STDSHL=
2727.ELSE
2728SHL6ARCHIVES=
2729.ENDIF
2730
2731# decide how to link
2732.IF "$(SHL6CODETYPE)"=="C"
2733SHL6LINKER=$(LINKC)
2734SHL6STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
2735SHL6LINKFLAGS+=$(LINKCFLAGS)
2736.ELSE			# "$(SHL6CODETYPE)"=="C"
2737SHL6LINKER=$(LINK)
2738SHL6STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
2739SHL6LINKFLAGS+=$(LINKFLAGS)
2740.ENDIF			# "$(SHL6CODETYPE)"=="C"
2741
2742SHL6RPATH*=OOO
2743LINKFLAGSRUNPATH_$(SHL6RPATH)*=/ERROR:/Bad_SHL6RPATH_value
2744SHL6LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL6RPATH))
2745
2746.IF "$(SHL6USE_EXPORTS)"==""
2747SHL6DEF*=$(MISC)/$(SHL6TARGET).def
2748.ENDIF			# "$(SHL6USE_EXPORTS)"==""
2749
2750EXTRALIBPATHS6=$(EXTRALIBPATHS)
2751.IF "$(UPDATER)"=="YES"
2752.IF "$(SHL6NOCHECK)"==""
2753.IF "$(SOLAR_STLLIBPATH)"!=""
2754EXTRALIBPATHS6+=-L$(SOLAR_STLLIBPATH)
2755.ENDIF
2756.ENDIF				# "$(SHL6NOCHECK)"!=""
2757.ENDIF
2758#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2759#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
2760#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2761
2762.IF "$(L10N_framework)"==""
2763.IF "$(VERSIONOBJ)"!=""
2764SHL6VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL6TARGET))}$(VERSIONOBJ:f)
2765USE_VERSIONH:=$(INCCOM)/$(SHL6VERSIONOBJ:b).h
2766.IF "$(GUI)" == "UNX"
2767SHL6VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL6TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
2768.ELSE           # "$(GUI)" == "UNX"
2769SHL6VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL6TARGET))}$(VERSIONOBJ:f)
2770.ENDIF          # "$(GUI)" == "UNX"
2771$(MISC)/$(SHL6VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL6VERSIONOBJ:b).h
2772#    $(COPY) $(SOLARENV)/src/version.c $@
2773	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL6VERSIONOBJ:b).h/ > $@
2774
2775.INIT : $(SHL6VERSIONOBJDEP)
2776.ENDIF			# "$(VERSIONOBJ)"!=""
2777.ENDIF
2778
2779.IF "$(GUI)" != "UNX"
2780.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
2781.IF "$(SHL6IMPLIB)" == ""
2782SHL6IMPLIB=i$(TARGET)_t6
2783.ENDIF			# "$(SHL6IMPLIB)" == ""
2784.IF "$(COM)" != "GCC"
2785USE_6IMPLIB=-implib:$(LB)/$(SHL6IMPLIB).lib
2786.ENDIF			# "$(COM)" != "GCC"
2787SHL6IMPLIBN=$(LB)/$(SHL6IMPLIB).lib
2788ALLTAR : $(SHL6IMPLIBN)
2789
2790.IF "$(USE_DEFFILE)"==""
2791USE_6IMPLIB_DEPS=$(LB)/$(SHL6IMPLIB).lib
2792.ENDIF			# "$(USE_DEFFILE)"==""
2793.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
2794USE_SHL6DEF=$(SHL6DEF)
2795.ELSE			# "$(GUI)" != "UNX"
2796USE_SHL6DEF=
2797SHL6DEPN+:=$(SHL6DEPNU)
2798
2799.IF "$(SHL6VERSIONMAP)"==""
2800# to activate vmaps remove "#"
2801USE_SHL6VERSIONMAP=$(MISC)/$(SHL6TARGET).vmap
2802.ENDIF			# "$(SHL6VERSIONMAP)"==""
2803
2804.IF "$(USE_SHL6VERSIONMAP)"!=""
2805
2806.IF "$(SHL6FILTERFILE)"!=""
2807.IF "$(SHL6VERSIONMAP)"!=""
2808#eine von beiden ist zuviel
2809USE_SHL6VERSIONMAP=$(MISC)/$(SHL6TARGET).vmap
2810$(USE_SHL6VERSIONMAP) .PHONY:
2811	@echo -----------------------------
2812	@echo you should only use versionmap OR exportfile
2813	@echo -----------------------------
2814#	force_dmake_to_error
2815
2816.ENDIF			# "$(SHL6VERSIONMAP)"!=""
2817
2818SHL6VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL6VERSIONMAP)
2819
2820$(USE_SHL6VERSIONMAP): \
2821					$(SHL6OBJS)\
2822					$(SHL6LIBS)\
2823					$(SHL6FILTERFILE)
2824	@$(RM) $@.dump
2825.IF "$(SHL6OBJS)"!=""
2826# dump remaining objects on the fly
2827.IF "$(OS)"=="MACOSX"
2828	@-nm $(SHL6OBJS:s/.obj/.o/) > $@.dump
2829.ELSE
2830	@nm $(SHL6OBJS:s/.obj/.o/) > $@.dump
2831.ENDIF
2832.ENDIF			# "$(SHL6OBJS)!"=""
2833	@$(TYPE) /dev/null $(SHL6LIBS:s/.lib/.dump/) >> $@.dump
2834	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL6INTERFACE) -f $(SHL6FILTERFILE) -m $@
2835
2836.ELSE			# "$(SHL6FILTERFILE)"!=""
2837USE_SHL6VERSIONMAP=$(MISC)/$(SHL6TARGET).vmap
2838$(USE_SHL6VERSIONMAP) :
2839.IF "$(VERBOSE)" == "TRUE"
2840	@echo -----------------------------
2841	@echo SHL6FILTERFILE not set!
2842	@echo -----------------------------
2843	@$(TOUCH) $@
2844	@echo dummy file to keep the dependencies for later use.
2845.ELSE
2846	@$(TOUCH) $@
2847.ENDIF
2848#	force_dmake_to_error
2849.ENDIF			# "$(SHL6FILTERFILE)"!=""
2850.ELSE			# "$(USE_SHL6VERSIONMAP)"!=""
2851
2852#and now for the plain non-generic way...
2853.IF "$(SHL6VERSIONMAP)"!=""
2854USE_SHL6VERSIONMAP=$(MISC)/$(SHL6VERSIONMAP:b)_$(SHL6TARGET)$(SHL6VERSIONMAP:e)
2855SHL6VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL6VERSIONMAP)
2856
2857.IF "$(OS)"=="MACOSX"
2858$(USE_SHL6VERSIONMAP): $(SHL6OBJS) $(SHL6LIBS)
2859.ENDIF
2860
2861# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
2862# even if the $(AWK) part fails:
2863$(USE_SHL6VERSIONMAP) .ERRREMOVE: $(SHL6VERSIONMAP)
2864	@@-$(RM) -f $@
2865# The following files will only be generated and needed on Mac OS X as temporary files
2866# in order to generate exported symbols list out of Linux/Solaris map files
2867.IF "$(OS)"=="MACOSX"
2868	@-$(RM) -f $@.symregexp >& $(NULLDEV)
2869	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
2870.ENDIF
2871# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
2872# happens if somebody will change it in the future
2873.IF "$(COMID)"=="gcc3"
2874	$(COMMAND_ECHO) tr -d "\015" < $(SHL6VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
2875.ELIF "$(COMNAME)"=="sunpro5"
2876	$(COMMAND_ECHO) tr -d "\015" < $(SHL6VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
2877.ELSE           # "$(COMID)"=="gcc3"
2878	$(COMMAND_ECHO) tr -d "\015" < $(SHL6VERSIONMAP) > $@
2879.ENDIF          # "$(COMID)"=="gcc3"
2880	@chmod a+w $@
2881# Mac OS X post-processing generate an exported symbols list from the generated map file
2882# for details on exported symbols list see man ld on Mac OS X
2883.IF "$(OS)"=="MACOSX"
2884	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
2885	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
2886# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
2887# Extract RTTI symbols from all the objects that will be used to build a shared library
2888.IF "$(SHL6OBJS)"!=""
2889	-echo $(foreach,i,$(SHL6OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
2890.ENDIF
2891.IF "$(SHL6LIBS)"!=""
2892	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL6LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
2893.ENDIF
2894# overwrite the map file generate into the local output tree with the generated
2895# exported symbols list
2896	cp $@.exported-symbols $@
2897.ENDIF # .IF "$(OS)"=="MACOSX"
2898.ENDIF			# "$(SHL6VERSIONMAP)"!=""
2899.ENDIF			# "$(USE_SHL6VERSIONMAP)"!=""
2900.ENDIF			# "$(GUI)" != "UNX"
2901
2902.IF "$(UNIXVERSIONNAMES)"!=""
2903.IF "$(OS)"!="MACOSX"
2904.IF "$(GUI)"=="UNX"
2905SHL6SONAME=\"$(SONAME_SWITCH)$(SHL6TARGETN:f)\"
2906.ENDIF			# "$(GUI)"!="UNX"
2907.ENDIF			# "$(OS)"!="MACOSX"
2908.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
2909
2910.IF "$(SHL6RES)"!=""
2911SHL6ALLRES+=$(SHL6RES)
2912SHL6LINKRES*=$(MISC)/$(SHL6TARGET).res
2913SHL6LINKRESO*=$(MISC)/$(SHL6TARGET)_res.o
2914.ENDIF			# "$(SHL6RES)"!=""
2915
2916.IF "$(SHL6DEFAULTRES)$(use_shl_versions)"!=""
2917SHL6DEFAULTRES*=$(MISC)/$(SHL6TARGET)_def.res
2918SHL6ALLRES+=$(SHL6DEFAULTRES)
2919SHL6LINKRES*=$(MISC)/$(SHL6TARGET).res
2920SHL6LINKRESO*=$(MISC)/$(SHL6TARGET)_res.o
2921.ENDIF			# "$(SHL6DEFAULTRES)$(use_shl_versions)"!=""
2922
2923#.IF "$(SHL6TARGETN)"!=""
2924
2925.IF "$(linkinc)"!=""
2926.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
2927.IF "$(SHL6LIBS)"!=""
2928$(MISC)/$(SHL6TARGET)_linkinc.ls .PHONY:
2929	@@-$(RM) $@
2930	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL6LIBS) $(i:s/.lib/.lin/)) >> $@
2931.ENDIF          # "$(SHL6LIBS)"!=""
2932.ENDIF
2933
2934LINKINCTARGETS+=$(MISC)/$(SHL6TARGETN:b)_linkinc.ls
2935$(SHL6TARGETN) : $(LINKINCTARGETS)
2936
2937.ELSE
2938.IF "$(SHL6USE_EXPORTS)"=="name"
2939.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
2940.IF "$(COM)"!="GCC"
2941.IF "$(SHL6LIBS)"!=""
2942SHL6LINKLIST=$(MISC)/$(SHL6TARGET)_link.lst
2943SHL6LINKLISTPARAM=@$(SHL6LINKLIST)
2944$(SHL6LINKLIST) : $(SHL6LIBS)
2945    @@-$(RM) $@
2946	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL6LIBS) $(i:s/.lib/.lin/)) >> $@
2947.ENDIF          # "$(SHL6LIBS)"!=""
2948.ENDIF          # "$(COM)"!="GCC"
2949.ENDIF
2950.ENDIF			# "$(SHL6USE_EXPORTS)"=="name"
2951
2952$(MISC)/%linkinc.ls:
2953	@echo . > $@
2954.ENDIF          # "$(linkinc)"!=""
2955
2956.IF "$(GUI)" == "OS2"
2957#21/02/2006 YD dll names must be 8.3, invoke fix script
2958#check osl/os2/module.c/osl_loadModule()
2959SHL6TARGET8=$(shell @fix_shl $(SHL6TARGET))
2960.ENDIF
2961
2962.IF "$(GUI)" == "OS2"
2963_SHL6IMP_ORD = $(SHL6STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL6STDLIBS:^"$(LB)/")
2964SHL6IMP_ORD = $(foreach,i,$(_SHL6IMP_ORD) $(shell @-ls $i))
2965.ELSE
2966SHL6IMP_ORD =
2967.ENDIF
2968
2969
2970$(SHL6TARGETN) : \
2971					$(SHL6OBJS)\
2972					$(SHL6LIBS)\
2973					$(USE_6IMPLIB_DEPS)\
2974					$(USE_SHL6DEF)\
2975					$(USE_SHL6VERSIONMAP)\
2976					$(SHL6RES)\
2977					$(SHL6DEPN) \
2978					$(SHL6IMP_ORD) \
2979					$(SHL6LINKLIST)
2980	@echo "Making:   " $(@:f)
2981.IF "$(GUI)" == "WNT"
2982.IF "$(SHL6DEFAULTRES)"!=""
2983	@@-$(RM) $(MISC)/$(SHL6DEFAULTRES:b).rc
2984.IF "$(SHL6ICON)" != ""
2985	@echo 1 ICON $(SHL6ICON) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2986.ENDIF
2987.IF "$(use_shl_versions)" != ""
2988.IF "$(SHL6ADD_VERINFO)"!=""
2989	@echo $(EMQ)#include $(EMQ)"$(SHL6ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2990.ELSE			# "$(SHL6ADD_VERINFO)"!=""
2991	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2992	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2993	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2994.ENDIF			# "$(SHL6ADD_VERINFO)"!=""
2995	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2996	@echo $(EMQ)#define ORG_NAME	$(SHL6TARGET)$(DLLPOST) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2997	@echo $(EMQ)#define INTERNAL_NAME $(SHL6TARGET:b) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2998	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL6DEFAULTRES:b).rc
2999.ENDIF			# "$(use_shl_versions)" != ""
3000	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL6DEFAULTRES:b).rc
3001.ENDIF			# "$(SHL6DEFAULTRES)"!=""
3002.IF "$(SHL6ALLRES)"!=""
3003	$(COMMAND_ECHO)$(TYPE) $(SHL6ALLRES) > $(SHL6LINKRES)
3004.IF "$(COM)"=="GCC"
3005	windres $(SHL6LINKRES) $(SHL6LINKRESO)
3006.ENDIF			# "$(COM)"=="GCC"
3007.ENDIF			# "$(SHL6ALLRES)"!=""
3008.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
3009	@echo dlltool --dllname $(SHL6TARGET)$(DLLPOST) \
3010		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_6.cmd
3011	@noop $(assign ALL6OBJLIST:=$(STDOBJ) $(SHL6OBJS) $(SHL6LINKRESO) $(shell $(TYPE) /dev/null $(SHL6LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
3012.IF "$(DEFLIB6NAME)"!=""	# do not have to include objs
3013	@noop $(assign DEF6OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
3014	@noop $(foreach,i,$(DEF6OBJLIST) $(assign ALL6OBJLIST:=$(ALL6OBJLIST:s?$i??)))
3015.ENDIF			# "$(DEFLIB6NAME)"!=""
3016	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
3017.IF "$(SHL6DEF)"!=""
3018	@echo	--input-def $(SHL6DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
3019.ELSE
3020	@echo	$(SHL6VERSIONOBJ) $(SHL6DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
3021.ENDIF
3022	@echo	$(ALL6OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_6.cmd
3023	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
3024		$(STDOBJ) $(SHL6VERSIONOBJ) $(SHL6DESCRIPTIONOBJ) $(SHL6OBJS) $(SHL6LINKRESO) \
3025		`$(TYPE) /dev/null $(SHL6LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
3026		-Wl,--exclude-libs,ALL,--start-group $(SHL6STDLIBS) -Wl,--end-group \
3027		$(SHL6STDSHL) $(STDSHL6) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
3028		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_6.cmd
3029  .IF "$(VERBOSE)" == "TRUE"
3030	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_6.cmd
3031  .ENDIF
3032	@+source $(MISC)/$(TARGET).$(@:b)_6.cmd
3033.ELSE
3034.IF "$(linkinc)"==""
3035.IF "$(SHL6USE_EXPORTS)"!="name"
3036.IF "$(USE_DEFFILE)"!=""
3037	$(COMMAND_ECHO)$(SHL6LINKER) @$(mktmp \
3038		$(SHL6LINKFLAGS) \
3039		$(LINKFLAGSSHL) \
3040		$(SHL6STACK) $(SHL6BASEX)	\
3041		-out:$@ \
3042		-map:$(MISC)/$(@:b).map \
3043		-def:$(SHL6DEF) \
3044		$(USE_6IMPLIB) \
3045		$(STDOBJ) \
3046		$(SHL6VERSIONOBJ) $(SHL6OBJS) \
3047		$(SHL6LIBS) \
3048		$(SHL6STDLIBS) \
3049		$(SHL6STDSHL) $(STDSHL6) \
3050		$(SHL6LINKRES) \
3051	)
3052# double check if target was really written... still making sense?
3053    @@$(LS) $@
3054	@echo linking $@.manifest ...
3055.IF "$(VISTA_MANIFEST)"!=""
3056	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3057	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3058.ELSE
3059	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3060.ENDIF # "$(VISTA_MANIFEST)"!=""
3061	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3062	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3063.ELSE			# "$(USE_DEFFILE)"!=""
3064	$(COMMAND_ECHO)$(SHL6LINKER) @$(mktmp	$(SHL6LINKFLAGS)			\
3065		$(LINKFLAGSSHL) $(SHL6BASEX)		\
3066		$(SHL6STACK) -out:$(SHL6TARGETN)	\
3067		-map:$(MISC)/$(@:B).map				\
3068		$(LB)/$(SHL6IMPLIB).exp				\
3069		$(STDOBJ)							\
3070		$(SHL6OBJS) $(SHL6VERSIONOBJ) \
3071		$(SHL6LIBS)                         \
3072		$(SHL6STDLIBS)                      \
3073		$(SHL6STDSHL) $(STDSHL6)                           \
3074		$(SHL6LINKRES) \
3075	)
3076# double check if target was really written... still making sense?
3077    @@$(LS) $@
3078	@echo linking $@.manifest ...
3079.IF "$(VISTA_MANIFEST)"!=""
3080	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3081	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3082.ELSE
3083	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3084.ENDIF # "$(VISTA_MANIFEST)"!=""
3085	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3086	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3087.ENDIF			# "$(USE_DEFFILE)"!=""
3088.ELSE			# "$(SHL6USE_EXPORTS)"!="name"
3089	$(COMMAND_ECHO)$(SHL6LINKER) @$(mktmp	$(SHL6LINKFLAGS)			\
3090		$(LINKFLAGSSHL) $(SHL6BASEX)		\
3091		$(SHL6STACK) -out:$(SHL6TARGETN)	\
3092		-map:$(MISC)/$(@:B).map				\
3093		$(USE_6IMPLIB) \
3094		$(STDOBJ)							\
3095		$(SHL6OBJS) $(SHL6VERSIONOBJ))   \
3096		$(SHL6LINKLISTPARAM) \
3097		@$(mktmp $(SHL6STDLIBS)                      \
3098		$(SHL6STDSHL) $(STDSHL6)                           \
3099		$(SHL6LINKRES) \
3100	)
3101	@echo linking $@.manifest ...
3102.IF "$(VISTA_MANIFEST)"!=""
3103	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3104	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3105.ELSE
3106	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3107.ENDIF # "$(VISTA_MANIFEST)"!=""
3108	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3109	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3110.ENDIF			# "$(SHL6USE_EXPORTS)"!="name"
3111.ELSE			# "$(linkinc)"==""
3112		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL6TARGET).lnk
3113		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL6TARGET).lst
3114		$(COMMAND_ECHO)$(TYPE) $(mktmp \
3115		$(SHL6LINKFLAGS) \
3116		$(LINKFLAGSSHL) $(SHL6BASEX) \
3117		$(SHL6STACK) $(MAPFILE) \
3118		-out:$@ \
3119		$(LB)/$(SHL6IMPLIB).exp \
3120		$(STDOBJ) \
3121		$(SHL6OBJS) \
3122		$(SHL6STDLIBS) \
3123		$(SHL6STDSHL) $(STDSHL6) \
3124		$(SHL6LINKRES) \
3125		) >> $(MISC)/$(SHL6TARGET).lnk
3126		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL6TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL6TARGET).lnk
3127		$(COMMAND_ECHO)$(SHL6LINKER) @$(MISC)/$(SHL6TARGET).lnk
3128		@echo linking $@.manifest ...
3129.IF "$(VISTA_MANIFEST)"!=""
3130		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3131		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3132.ELSE
3133		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3134.ENDIF # "$(VISTA_MANIFEST)"!=""
3135		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3136		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3137.ENDIF			# "$(linkinc)"==""
3138.ENDIF			# "$(COM)"=="GCC"
3139.ENDIF			# "$(GUI)" == "WNT"
3140.IF "$(GUI)"=="UNX"
3141.IF "$(OS)"=="MACOSX"
3142	@-$(RM) $(MISC)/$(@:b).list
3143	@-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
3144	@echo $(STDSLO) $(SHL6OBJS:s/.obj/.o/) \
3145	$(SHL6VERSIONOBJ) \
3146	`cat /dev/null $(SHL6LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
3147	@echo -n $(SHL6LINKER) $(SHL6LINKFLAGS) $(SHL6VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
3148	$(SHL6STDLIBS) $(SHL6ARCHIVES) $(SHL6STDSHL) $(STDSHL6) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_6.cmd
3149    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
3150        `cat $(MISC)/$(TARGET).$(@:b)_6.cmd` \
3151        >> $(MISC)/$(TARGET).$(@:b)_6.cmd
3152  .IF "$(VERBOSE)" == "TRUE"
3153	@cat $(MISC)/$(TARGET).$(@:b)_6.cmd
3154  .ENDIF
3155	@+source $(MISC)/$(TARGET).$(@:b)_6.cmd
3156    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
3157        shl $(SHL6RPATH) $@
3158.IF "$(SHL6CREATEJNILIB)"!=""
3159	@echo "Making:   " $(@:f).jnilib
3160	@macosx-create-bundle $@
3161.ENDIF          # "$(SHL6CREATEJNILIB)"!=""
3162.IF "$(UPDATER)"=="YES"
3163.IF "$(SHL6NOCHECK)"==""
3164	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN)
3165.ENDIF				# "$(SHL6NOCHECK)"!=""
3166.ENDIF
3167.ELSE			# "$(OS)"=="MACOSX"
3168	@-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
3169	@echo $(SHL6LINKER) $(SHL6LINKFLAGS) $(SHL6SONAME) $(LINKFLAGSSHL) $(SHL6VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL6OBJS:s/.obj/.o/) \
3170	$(SHL6VERSIONOBJ) -o $@ \
3171	`cat /dev/null $(SHL6LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
3172	$(SHL6STDLIBS) $(SHL6ARCHIVES) $(SHL6STDSHL) $(STDSHL6) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_6.cmd
3173  .IF "$(VERBOSE)" == "TRUE"
3174	@cat $(MISC)/$(TARGET).$(@:b)_6.cmd
3175  .ENDIF
3176	@+source $(MISC)/$(TARGET).$(@:b)_6.cmd
3177.IF "$(UPDATER)"=="YES"
3178.IF "$(SHL6NOCHECK)"==""
3179	$(COMMAND_ECHO)-$(RM) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
3180	$(COMMAND_ECHO)$(RENAME) $(SHL6TARGETN) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
3181.IF "$(VERBOSE)"=="TRUE"
3182	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
3183.ELSE
3184	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) -- -s $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
3185.ENDIF
3186.ENDIF				# "$(SHL6NOCHECK)"!=""
3187.ENDIF			# "$(UPDATER)"=="YES"
3188.ENDIF			# "$(OS)"=="MACOSX"
3189.IF "$(UNIXVERSIONNAMES)"!=""
3190	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL6TARGETN:b)
3191	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL6TARGETN:f) $(SHL6TARGETN:b)
3192.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
3193.IF "$(VERBOSE)" == "TRUE"
3194	@ls -l $@
3195.ENDIF
3196.ENDIF			# "$(GUI)" == "UNX"
3197
3198.IF "$(GUI)" == "OS2"
3199
3200.IF "$(SHL6DEFAULTRES)"!=""
3201	@+-$(RM) $(MISC)/$(SHL6DEFAULTRES:b).rc >& $(NULLDEV)
3202.IF "$(SHL6ICON)" != ""
3203	@-+echo 1 ICON $(SHL6ICON) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
3204.ENDIF
3205.IF "$(use_shl_versions)" != ""
3206.IF "$(SHL6ADD_VERINFO)"!=""
3207	@-+echo $(EMQ)#include $(EMQ)"$(SHL6ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL6DEFAULTRES:b).rc
3208.ENDIF			# "$(SHL6ADD_VERINFO)"!=""
3209	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL6DEFAULTRES:b).rc
3210#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
3211.ENDIF			# "$(use_shl_versions)" != ""
3212# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
3213	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL6DEFAULTRES:b).rc
3214.ENDIF			# "$(SHL6DEFAULTRES)"!=""
3215
3216.IF "$(SHL6ALLRES)"!=""
3217	$(COMMAND_ECHO)+$(TYPE) $(SHL6ALLRES) > $(SHL6LINKRES)
3218.ENDIF			# "$(SHL6ALLRES)"!=""
3219
3220.IF "$(USE_DEFFILE)"!=""
3221
3222	$(COMMAND_ECHO)$(SHL6LINKER) $(SHL6LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
3223		$(SHL6DEF) \
3224		$(STDOBJ) \
3225		-L$(LB) \
3226		-L$(SOLARVERSION)/$(INPATH)/lib \
3227		$(SHL6OBJS) $(SHL6VERSIONOBJ) \
3228		$(SHL6LIBS) \
3229		$(SHL6STDLIBS:^"-l") \
3230		$(SHL6LINKRES) \
3231		$(SHL6STDSHL:^"-l") $(STDSHL6:^"-l")
3232
3233.ELSE			# "$(USE_DEFFILE)"!=""
3234
3235	$(COMMAND_ECHO)$(SHL6LINKER) -v 	$(SHL6LINKFLAGS)			\
3236		$(LINKFLAGSSHL) $(SHL6BASEX)		\
3237		$(SHL6STACK) -o $(SHL6TARGETN)	\
3238		$(SHL6DEF) \
3239		$(STDOBJ)							\
3240		-L$(LB) \
3241		-L$(SOLARVERSION)/$(INPATH)/lib \
3242		$(SHL6OBJS) $(SHL6VERSIONOBJ) \
3243		$(SHL6LIBS) \
3244		$(SHL6STDLIBS:^"-l") \
3245		$(SHL6LINKRES) \
3246		$(SHL6STDSHL:^"-l") $(STDSHL6:^"-l")                           \
3247	@$(LS) $@ >& $(NULLDEV)
3248
3249.ENDIF			# "$(USE_DEFFILE)"!=""
3250
3251.IF "$(SHL6TARGET8)" != "$(SHL6TARGET)"
3252	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL6TARGET8).dll
3253.ENDIF
3254
3255.ENDIF			# "$(GUI)" == "OS2"
3256
3257.ENDIF			# "$(SHL6TARGETN)"!=""
3258
3259# unroll begin
3260
3261.IF "$(SHL7TARGETN)"!=""
3262
3263.IF "$(OS)"=="AIX"
3264SHL7STDLIBS=
3265.ENDIF
3266
3267.IF "$(SHLLINKARCONLY)" != ""
3268SHL7STDLIBS=
3269STDSHL=
3270.ELSE
3271SHL7ARCHIVES=
3272.ENDIF
3273
3274# decide how to link
3275.IF "$(SHL7CODETYPE)"=="C"
3276SHL7LINKER=$(LINKC)
3277SHL7STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
3278SHL7LINKFLAGS+=$(LINKCFLAGS)
3279.ELSE			# "$(SHL7CODETYPE)"=="C"
3280SHL7LINKER=$(LINK)
3281SHL7STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
3282SHL7LINKFLAGS+=$(LINKFLAGS)
3283.ENDIF			# "$(SHL7CODETYPE)"=="C"
3284
3285SHL7RPATH*=OOO
3286LINKFLAGSRUNPATH_$(SHL7RPATH)*=/ERROR:/Bad_SHL7RPATH_value
3287SHL7LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL7RPATH))
3288
3289.IF "$(SHL7USE_EXPORTS)"==""
3290SHL7DEF*=$(MISC)/$(SHL7TARGET).def
3291.ENDIF			# "$(SHL7USE_EXPORTS)"==""
3292
3293EXTRALIBPATHS7=$(EXTRALIBPATHS)
3294.IF "$(UPDATER)"=="YES"
3295.IF "$(SHL7NOCHECK)"==""
3296.IF "$(SOLAR_STLLIBPATH)"!=""
3297EXTRALIBPATHS7+=-L$(SOLAR_STLLIBPATH)
3298.ENDIF
3299.ENDIF				# "$(SHL7NOCHECK)"!=""
3300.ENDIF
3301#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3302#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
3303#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3304
3305.IF "$(L10N_framework)"==""
3306.IF "$(VERSIONOBJ)"!=""
3307SHL7VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL7TARGET))}$(VERSIONOBJ:f)
3308USE_VERSIONH:=$(INCCOM)/$(SHL7VERSIONOBJ:b).h
3309.IF "$(GUI)" == "UNX"
3310SHL7VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL7TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
3311.ELSE           # "$(GUI)" == "UNX"
3312SHL7VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL7TARGET))}$(VERSIONOBJ:f)
3313.ENDIF          # "$(GUI)" == "UNX"
3314$(MISC)/$(SHL7VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL7VERSIONOBJ:b).h
3315#    $(COPY) $(SOLARENV)/src/version.c $@
3316	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL7VERSIONOBJ:b).h/ > $@
3317
3318.INIT : $(SHL7VERSIONOBJDEP)
3319.ENDIF			# "$(VERSIONOBJ)"!=""
3320.ENDIF
3321
3322.IF "$(GUI)" != "UNX"
3323.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
3324.IF "$(SHL7IMPLIB)" == ""
3325SHL7IMPLIB=i$(TARGET)_t7
3326.ENDIF			# "$(SHL7IMPLIB)" == ""
3327.IF "$(COM)" != "GCC"
3328USE_7IMPLIB=-implib:$(LB)/$(SHL7IMPLIB).lib
3329.ENDIF			# "$(COM)" != "GCC"
3330SHL7IMPLIBN=$(LB)/$(SHL7IMPLIB).lib
3331ALLTAR : $(SHL7IMPLIBN)
3332
3333.IF "$(USE_DEFFILE)"==""
3334USE_7IMPLIB_DEPS=$(LB)/$(SHL7IMPLIB).lib
3335.ENDIF			# "$(USE_DEFFILE)"==""
3336.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
3337USE_SHL7DEF=$(SHL7DEF)
3338.ELSE			# "$(GUI)" != "UNX"
3339USE_SHL7DEF=
3340SHL7DEPN+:=$(SHL7DEPNU)
3341
3342.IF "$(SHL7VERSIONMAP)"==""
3343# to activate vmaps remove "#"
3344USE_SHL7VERSIONMAP=$(MISC)/$(SHL7TARGET).vmap
3345.ENDIF			# "$(SHL7VERSIONMAP)"==""
3346
3347.IF "$(USE_SHL7VERSIONMAP)"!=""
3348
3349.IF "$(SHL7FILTERFILE)"!=""
3350.IF "$(SHL7VERSIONMAP)"!=""
3351#eine von beiden ist zuviel
3352USE_SHL7VERSIONMAP=$(MISC)/$(SHL7TARGET).vmap
3353$(USE_SHL7VERSIONMAP) .PHONY:
3354	@echo -----------------------------
3355	@echo you should only use versionmap OR exportfile
3356	@echo -----------------------------
3357#	force_dmake_to_error
3358
3359.ENDIF			# "$(SHL7VERSIONMAP)"!=""
3360
3361SHL7VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL7VERSIONMAP)
3362
3363$(USE_SHL7VERSIONMAP): \
3364					$(SHL7OBJS)\
3365					$(SHL7LIBS)\
3366					$(SHL7FILTERFILE)
3367	@$(RM) $@.dump
3368.IF "$(SHL7OBJS)"!=""
3369# dump remaining objects on the fly
3370.IF "$(OS)"=="MACOSX"
3371	@-nm $(SHL7OBJS:s/.obj/.o/) > $@.dump
3372.ELSE
3373	@nm $(SHL7OBJS:s/.obj/.o/) > $@.dump
3374.ENDIF
3375.ENDIF			# "$(SHL7OBJS)!"=""
3376	@$(TYPE) /dev/null $(SHL7LIBS:s/.lib/.dump/) >> $@.dump
3377	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL7INTERFACE) -f $(SHL7FILTERFILE) -m $@
3378
3379.ELSE			# "$(SHL7FILTERFILE)"!=""
3380USE_SHL7VERSIONMAP=$(MISC)/$(SHL7TARGET).vmap
3381$(USE_SHL7VERSIONMAP) :
3382.IF "$(VERBOSE)" == "TRUE"
3383	@echo -----------------------------
3384	@echo SHL7FILTERFILE not set!
3385	@echo -----------------------------
3386	@$(TOUCH) $@
3387	@echo dummy file to keep the dependencies for later use.
3388.ELSE
3389	@$(TOUCH) $@
3390.ENDIF
3391#	force_dmake_to_error
3392.ENDIF			# "$(SHL7FILTERFILE)"!=""
3393.ELSE			# "$(USE_SHL7VERSIONMAP)"!=""
3394
3395#and now for the plain non-generic way...
3396.IF "$(SHL7VERSIONMAP)"!=""
3397USE_SHL7VERSIONMAP=$(MISC)/$(SHL7VERSIONMAP:b)_$(SHL7TARGET)$(SHL7VERSIONMAP:e)
3398SHL7VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL7VERSIONMAP)
3399
3400.IF "$(OS)"=="MACOSX"
3401$(USE_SHL7VERSIONMAP): $(SHL7OBJS) $(SHL7LIBS)
3402.ENDIF
3403
3404# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
3405# even if the $(AWK) part fails:
3406$(USE_SHL7VERSIONMAP) .ERRREMOVE: $(SHL7VERSIONMAP)
3407	@@-$(RM) -f $@
3408# The following files will only be generated and needed on Mac OS X as temporary files
3409# in order to generate exported symbols list out of Linux/Solaris map files
3410.IF "$(OS)"=="MACOSX"
3411	@-$(RM) -f $@.symregexp >& $(NULLDEV)
3412	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
3413.ENDIF
3414# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
3415# happens if somebody will change it in the future
3416.IF "$(COMID)"=="gcc3"
3417	$(COMMAND_ECHO) tr -d "\015" < $(SHL7VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
3418.ELIF "$(COMNAME)"=="sunpro5"
3419	$(COMMAND_ECHO) tr -d "\015" < $(SHL7VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
3420.ELSE           # "$(COMID)"=="gcc3"
3421	$(COMMAND_ECHO) tr -d "\015" < $(SHL7VERSIONMAP) > $@
3422.ENDIF          # "$(COMID)"=="gcc3"
3423	@chmod a+w $@
3424# Mac OS X post-processing generate an exported symbols list from the generated map file
3425# for details on exported symbols list see man ld on Mac OS X
3426.IF "$(OS)"=="MACOSX"
3427	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
3428	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
3429# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
3430# Extract RTTI symbols from all the objects that will be used to build a shared library
3431.IF "$(SHL7OBJS)"!=""
3432	-echo $(foreach,i,$(SHL7OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
3433.ENDIF
3434.IF "$(SHL7LIBS)"!=""
3435	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL7LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
3436.ENDIF
3437# overwrite the map file generate into the local output tree with the generated
3438# exported symbols list
3439	cp $@.exported-symbols $@
3440.ENDIF # .IF "$(OS)"=="MACOSX"
3441.ENDIF			# "$(SHL7VERSIONMAP)"!=""
3442.ENDIF			# "$(USE_SHL7VERSIONMAP)"!=""
3443.ENDIF			# "$(GUI)" != "UNX"
3444
3445.IF "$(UNIXVERSIONNAMES)"!=""
3446.IF "$(OS)"!="MACOSX"
3447.IF "$(GUI)"=="UNX"
3448SHL7SONAME=\"$(SONAME_SWITCH)$(SHL7TARGETN:f)\"
3449.ENDIF			# "$(GUI)"!="UNX"
3450.ENDIF			# "$(OS)"!="MACOSX"
3451.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
3452
3453.IF "$(SHL7RES)"!=""
3454SHL7ALLRES+=$(SHL7RES)
3455SHL7LINKRES*=$(MISC)/$(SHL7TARGET).res
3456SHL7LINKRESO*=$(MISC)/$(SHL7TARGET)_res.o
3457.ENDIF			# "$(SHL7RES)"!=""
3458
3459.IF "$(SHL7DEFAULTRES)$(use_shl_versions)"!=""
3460SHL7DEFAULTRES*=$(MISC)/$(SHL7TARGET)_def.res
3461SHL7ALLRES+=$(SHL7DEFAULTRES)
3462SHL7LINKRES*=$(MISC)/$(SHL7TARGET).res
3463SHL7LINKRESO*=$(MISC)/$(SHL7TARGET)_res.o
3464.ENDIF			# "$(SHL7DEFAULTRES)$(use_shl_versions)"!=""
3465
3466#.IF "$(SHL7TARGETN)"!=""
3467
3468.IF "$(linkinc)"!=""
3469.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
3470.IF "$(SHL7LIBS)"!=""
3471$(MISC)/$(SHL7TARGET)_linkinc.ls .PHONY:
3472	@@-$(RM) $@
3473	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL7LIBS) $(i:s/.lib/.lin/)) >> $@
3474.ENDIF          # "$(SHL7LIBS)"!=""
3475.ENDIF
3476
3477LINKINCTARGETS+=$(MISC)/$(SHL7TARGETN:b)_linkinc.ls
3478$(SHL7TARGETN) : $(LINKINCTARGETS)
3479
3480.ELSE
3481.IF "$(SHL7USE_EXPORTS)"=="name"
3482.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
3483.IF "$(COM)"!="GCC"
3484.IF "$(SHL7LIBS)"!=""
3485SHL7LINKLIST=$(MISC)/$(SHL7TARGET)_link.lst
3486SHL7LINKLISTPARAM=@$(SHL7LINKLIST)
3487$(SHL7LINKLIST) : $(SHL7LIBS)
3488    @@-$(RM) $@
3489	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL7LIBS) $(i:s/.lib/.lin/)) >> $@
3490.ENDIF          # "$(SHL7LIBS)"!=""
3491.ENDIF          # "$(COM)"!="GCC"
3492.ENDIF
3493.ENDIF			# "$(SHL7USE_EXPORTS)"=="name"
3494
3495$(MISC)/%linkinc.ls:
3496	@echo . > $@
3497.ENDIF          # "$(linkinc)"!=""
3498
3499.IF "$(GUI)" == "OS2"
3500#21/02/2006 YD dll names must be 8.3, invoke fix script
3501#check osl/os2/module.c/osl_loadModule()
3502SHL7TARGET8=$(shell @fix_shl $(SHL7TARGET))
3503.ENDIF
3504
3505.IF "$(GUI)" == "OS2"
3506_SHL7IMP_ORD = $(SHL7STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL7STDLIBS:^"$(LB)/")
3507SHL7IMP_ORD = $(foreach,i,$(_SHL7IMP_ORD) $(shell @-ls $i))
3508.ELSE
3509SHL7IMP_ORD =
3510.ENDIF
3511
3512
3513$(SHL7TARGETN) : \
3514					$(SHL7OBJS)\
3515					$(SHL7LIBS)\
3516					$(USE_7IMPLIB_DEPS)\
3517					$(USE_SHL7DEF)\
3518					$(USE_SHL7VERSIONMAP)\
3519					$(SHL7RES)\
3520					$(SHL7DEPN) \
3521					$(SHL7IMP_ORD) \
3522					$(SHL7LINKLIST)
3523	@echo "Making:   " $(@:f)
3524.IF "$(GUI)" == "WNT"
3525.IF "$(SHL7DEFAULTRES)"!=""
3526	@@-$(RM) $(MISC)/$(SHL7DEFAULTRES:b).rc
3527.IF "$(SHL7ICON)" != ""
3528	@echo 1 ICON $(SHL7ICON) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3529.ENDIF
3530.IF "$(use_shl_versions)" != ""
3531.IF "$(SHL7ADD_VERINFO)"!=""
3532	@echo $(EMQ)#include $(EMQ)"$(SHL7ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3533.ELSE			# "$(SHL7ADD_VERINFO)"!=""
3534	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3535	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3536	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3537.ENDIF			# "$(SHL7ADD_VERINFO)"!=""
3538	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3539	@echo $(EMQ)#define ORG_NAME	$(SHL7TARGET)$(DLLPOST) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3540	@echo $(EMQ)#define INTERNAL_NAME $(SHL7TARGET:b) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3541	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3542.ENDIF			# "$(use_shl_versions)" != ""
3543	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL7DEFAULTRES:b).rc
3544.ENDIF			# "$(SHL7DEFAULTRES)"!=""
3545.IF "$(SHL7ALLRES)"!=""
3546	$(COMMAND_ECHO)$(TYPE) $(SHL7ALLRES) > $(SHL7LINKRES)
3547.IF "$(COM)"=="GCC"
3548	windres $(SHL7LINKRES) $(SHL7LINKRESO)
3549.ENDIF			# "$(COM)"=="GCC"
3550.ENDIF			# "$(SHL7ALLRES)"!=""
3551.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
3552	@echo dlltool --dllname $(SHL7TARGET)$(DLLPOST) \
3553		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_7.cmd
3554	@noop $(assign ALL7OBJLIST:=$(STDOBJ) $(SHL7OBJS) $(SHL7LINKRESO) $(shell $(TYPE) /dev/null $(SHL7LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
3555.IF "$(DEFLIB7NAME)"!=""	# do not have to include objs
3556	@noop $(assign DEF7OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
3557	@noop $(foreach,i,$(DEF7OBJLIST) $(assign ALL7OBJLIST:=$(ALL7OBJLIST:s?$i??)))
3558.ENDIF			# "$(DEFLIB7NAME)"!=""
3559	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
3560.IF "$(SHL7DEF)"!=""
3561	@echo	--input-def $(SHL7DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
3562.ELSE
3563	@echo	$(SHL7VERSIONOBJ) $(SHL7DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
3564.ENDIF
3565	@echo	$(ALL7OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_7.cmd
3566	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
3567		$(STDOBJ) $(SHL7VERSIONOBJ) $(SHL7DESCRIPTIONOBJ) $(SHL7OBJS) $(SHL7LINKRESO) \
3568		`$(TYPE) /dev/null $(SHL7LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
3569		-Wl,--exclude-libs,ALL,--start-group $(SHL7STDLIBS) -Wl,--end-group \
3570		$(SHL7STDSHL) $(STDSHL7) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
3571		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_7.cmd
3572  .IF "$(VERBOSE)" == "TRUE"
3573	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_7.cmd
3574  .ENDIF
3575	@+source $(MISC)/$(TARGET).$(@:b)_7.cmd
3576.ELSE
3577.IF "$(linkinc)"==""
3578.IF "$(SHL7USE_EXPORTS)"!="name"
3579.IF "$(USE_DEFFILE)"!=""
3580	$(COMMAND_ECHO)$(SHL7LINKER) @$(mktmp \
3581		$(SHL7LINKFLAGS) \
3582		$(LINKFLAGSSHL) \
3583		$(SHL7STACK) $(SHL7BASEX)	\
3584		-out:$@ \
3585		-map:$(MISC)/$(@:b).map \
3586		-def:$(SHL7DEF) \
3587		$(USE_7IMPLIB) \
3588		$(STDOBJ) \
3589		$(SHL7VERSIONOBJ) $(SHL7OBJS) \
3590		$(SHL7LIBS) \
3591		$(SHL7STDLIBS) \
3592		$(SHL7STDSHL) $(STDSHL7) \
3593		$(SHL7LINKRES) \
3594	)
3595# double check if target was really written... still making sense?
3596    @@$(LS) $@
3597	@echo linking $@.manifest ...
3598.IF "$(VISTA_MANIFEST)"!=""
3599	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3600	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3601.ELSE
3602	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3603.ENDIF # "$(VISTA_MANIFEST)"!=""
3604	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3605	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3606.ELSE			# "$(USE_DEFFILE)"!=""
3607	$(COMMAND_ECHO)$(SHL7LINKER) @$(mktmp	$(SHL7LINKFLAGS)			\
3608		$(LINKFLAGSSHL) $(SHL7BASEX)		\
3609		$(SHL7STACK) -out:$(SHL7TARGETN)	\
3610		-map:$(MISC)/$(@:B).map				\
3611		$(LB)/$(SHL7IMPLIB).exp				\
3612		$(STDOBJ)							\
3613		$(SHL7OBJS) $(SHL7VERSIONOBJ) \
3614		$(SHL7LIBS)                         \
3615		$(SHL7STDLIBS)                      \
3616		$(SHL7STDSHL) $(STDSHL7)                           \
3617		$(SHL7LINKRES) \
3618	)
3619# double check if target was really written... still making sense?
3620    @@$(LS) $@
3621	@echo linking $@.manifest ...
3622.IF "$(VISTA_MANIFEST)"!=""
3623	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3624	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3625.ELSE
3626	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3627.ENDIF # "$(VISTA_MANIFEST)"!=""
3628	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3629	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3630.ENDIF			# "$(USE_DEFFILE)"!=""
3631.ELSE			# "$(SHL7USE_EXPORTS)"!="name"
3632	$(COMMAND_ECHO)$(SHL7LINKER) @$(mktmp	$(SHL7LINKFLAGS)			\
3633		$(LINKFLAGSSHL) $(SHL7BASEX)		\
3634		$(SHL7STACK) -out:$(SHL7TARGETN)	\
3635		-map:$(MISC)/$(@:B).map				\
3636		$(USE_7IMPLIB) \
3637		$(STDOBJ)							\
3638		$(SHL7OBJS) $(SHL7VERSIONOBJ))   \
3639		$(SHL7LINKLISTPARAM) \
3640		@$(mktmp $(SHL7STDLIBS)                      \
3641		$(SHL7STDSHL) $(STDSHL7)                           \
3642		$(SHL7LINKRES) \
3643	)
3644	@echo linking $@.manifest ...
3645.IF "$(VISTA_MANIFEST)"!=""
3646	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3647	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3648.ELSE
3649	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3650.ENDIF # "$(VISTA_MANIFEST)"!=""
3651	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3652	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3653.ENDIF			# "$(SHL7USE_EXPORTS)"!="name"
3654.ELSE			# "$(linkinc)"==""
3655		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL7TARGET).lnk
3656		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL7TARGET).lst
3657		$(COMMAND_ECHO)$(TYPE) $(mktmp \
3658		$(SHL7LINKFLAGS) \
3659		$(LINKFLAGSSHL) $(SHL7BASEX) \
3660		$(SHL7STACK) $(MAPFILE) \
3661		-out:$@ \
3662		$(LB)/$(SHL7IMPLIB).exp \
3663		$(STDOBJ) \
3664		$(SHL7OBJS) \
3665		$(SHL7STDLIBS) \
3666		$(SHL7STDSHL) $(STDSHL7) \
3667		$(SHL7LINKRES) \
3668		) >> $(MISC)/$(SHL7TARGET).lnk
3669		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL7TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL7TARGET).lnk
3670		$(COMMAND_ECHO)$(SHL7LINKER) @$(MISC)/$(SHL7TARGET).lnk
3671		@echo linking $@.manifest ...
3672.IF "$(VISTA_MANIFEST)"!=""
3673		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
3674		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
3675.ELSE
3676		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
3677.ENDIF # "$(VISTA_MANIFEST)"!=""
3678		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
3679		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
3680.ENDIF			# "$(linkinc)"==""
3681.ENDIF			# "$(COM)"=="GCC"
3682.ENDIF			# "$(GUI)" == "WNT"
3683.IF "$(GUI)"=="UNX"
3684.IF "$(OS)"=="MACOSX"
3685	@-$(RM) $(MISC)/$(@:b).list
3686	@-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
3687	@echo $(STDSLO) $(SHL7OBJS:s/.obj/.o/) \
3688	$(SHL7VERSIONOBJ) \
3689	`cat /dev/null $(SHL7LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
3690	@echo -n $(SHL7LINKER) $(SHL7LINKFLAGS) $(SHL7VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
3691	$(SHL7STDLIBS) $(SHL7ARCHIVES) $(SHL7STDSHL) $(STDSHL7) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_7.cmd
3692    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
3693        `cat $(MISC)/$(TARGET).$(@:b)_7.cmd` \
3694        >> $(MISC)/$(TARGET).$(@:b)_7.cmd
3695  .IF "$(VERBOSE)" == "TRUE"
3696	@cat $(MISC)/$(TARGET).$(@:b)_7.cmd
3697  .ENDIF
3698	@+source $(MISC)/$(TARGET).$(@:b)_7.cmd
3699    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
3700        shl $(SHL7RPATH) $@
3701.IF "$(SHL7CREATEJNILIB)"!=""
3702	@echo "Making:   " $(@:f).jnilib
3703	@macosx-create-bundle $@
3704.ENDIF          # "$(SHL7CREATEJNILIB)"!=""
3705.IF "$(UPDATER)"=="YES"
3706.IF "$(SHL7NOCHECK)"==""
3707	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN)
3708.ENDIF				# "$(SHL7NOCHECK)"!=""
3709.ENDIF
3710.ELSE			# "$(OS)"=="MACOSX"
3711	@-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
3712	@echo $(SHL7LINKER) $(SHL7LINKFLAGS) $(SHL7SONAME) $(LINKFLAGSSHL) $(SHL7VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL7OBJS:s/.obj/.o/) \
3713	$(SHL7VERSIONOBJ) -o $@ \
3714	`cat /dev/null $(SHL7LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
3715	$(SHL7STDLIBS) $(SHL7ARCHIVES) $(SHL7STDSHL) $(STDSHL7) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_7.cmd
3716  .IF "$(VERBOSE)" == "TRUE"
3717	@cat $(MISC)/$(TARGET).$(@:b)_7.cmd
3718  .ENDIF
3719	@+source $(MISC)/$(TARGET).$(@:b)_7.cmd
3720.IF "$(UPDATER)"=="YES"
3721.IF "$(SHL7NOCHECK)"==""
3722	$(COMMAND_ECHO)-$(RM) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
3723	$(COMMAND_ECHO)$(RENAME) $(SHL7TARGETN) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
3724.IF "$(VERBOSE)"=="TRUE"
3725	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
3726.ELSE
3727	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) -- -s $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
3728.ENDIF
3729.ENDIF				# "$(SHL7NOCHECK)"!=""
3730.ENDIF			# "$(UPDATER)"=="YES"
3731.ENDIF			# "$(OS)"=="MACOSX"
3732.IF "$(UNIXVERSIONNAMES)"!=""
3733	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL7TARGETN:b)
3734	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL7TARGETN:f) $(SHL7TARGETN:b)
3735.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
3736.IF "$(VERBOSE)" == "TRUE"
3737	@ls -l $@
3738.ENDIF
3739.ENDIF			# "$(GUI)" == "UNX"
3740
3741.IF "$(GUI)" == "OS2"
3742
3743.IF "$(SHL7DEFAULTRES)"!=""
3744	@+-$(RM) $(MISC)/$(SHL7DEFAULTRES:b).rc >& $(NULLDEV)
3745.IF "$(SHL7ICON)" != ""
3746	@-+echo 1 ICON $(SHL7ICON) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3747.ENDIF
3748.IF "$(use_shl_versions)" != ""
3749.IF "$(SHL7ADD_VERINFO)"!=""
3750	@-+echo $(EMQ)#include $(EMQ)"$(SHL7ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3751.ENDIF			# "$(SHL7ADD_VERINFO)"!=""
3752	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3753#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
3754.ENDIF			# "$(use_shl_versions)" != ""
3755# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
3756	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL7DEFAULTRES:b).rc
3757.ENDIF			# "$(SHL7DEFAULTRES)"!=""
3758
3759.IF "$(SHL7ALLRES)"!=""
3760	$(COMMAND_ECHO)+$(TYPE) $(SHL7ALLRES) > $(SHL7LINKRES)
3761.ENDIF			# "$(SHL7ALLRES)"!=""
3762
3763.IF "$(USE_DEFFILE)"!=""
3764
3765	$(COMMAND_ECHO)$(SHL7LINKER) $(SHL7LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
3766		$(SHL7DEF) \
3767		$(STDOBJ) \
3768		-L$(LB) \
3769		-L$(SOLARVERSION)/$(INPATH)/lib \
3770		$(SHL7OBJS) $(SHL7VERSIONOBJ) \
3771		$(SHL7LIBS) \
3772		$(SHL7STDLIBS:^"-l") \
3773		$(SHL7LINKRES) \
3774		$(SHL7STDSHL:^"-l") $(STDSHL7:^"-l")
3775
3776.ELSE			# "$(USE_DEFFILE)"!=""
3777
3778	$(COMMAND_ECHO)$(SHL7LINKER) -v 	$(SHL7LINKFLAGS)			\
3779		$(LINKFLAGSSHL) $(SHL7BASEX)		\
3780		$(SHL7STACK) -o $(SHL7TARGETN)	\
3781		$(SHL7DEF) \
3782		$(STDOBJ)							\
3783		-L$(LB) \
3784		-L$(SOLARVERSION)/$(INPATH)/lib \
3785		$(SHL7OBJS) $(SHL7VERSIONOBJ) \
3786		$(SHL7LIBS) \
3787		$(SHL7STDLIBS:^"-l") \
3788		$(SHL7LINKRES) \
3789		$(SHL7STDSHL:^"-l") $(STDSHL7:^"-l")                           \
3790	@$(LS) $@ >& $(NULLDEV)
3791
3792.ENDIF			# "$(USE_DEFFILE)"!=""
3793
3794.IF "$(SHL7TARGET8)" != "$(SHL7TARGET)"
3795	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL7TARGET8).dll
3796.ENDIF
3797
3798.ENDIF			# "$(GUI)" == "OS2"
3799
3800.ENDIF			# "$(SHL7TARGETN)"!=""
3801
3802# unroll begin
3803
3804.IF "$(SHL8TARGETN)"!=""
3805
3806.IF "$(OS)"=="AIX"
3807SHL8STDLIBS=
3808.ENDIF
3809
3810.IF "$(SHLLINKARCONLY)" != ""
3811SHL8STDLIBS=
3812STDSHL=
3813.ELSE
3814SHL8ARCHIVES=
3815.ENDIF
3816
3817# decide how to link
3818.IF "$(SHL8CODETYPE)"=="C"
3819SHL8LINKER=$(LINKC)
3820SHL8STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
3821SHL8LINKFLAGS+=$(LINKCFLAGS)
3822.ELSE			# "$(SHL8CODETYPE)"=="C"
3823SHL8LINKER=$(LINK)
3824SHL8STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
3825SHL8LINKFLAGS+=$(LINKFLAGS)
3826.ENDIF			# "$(SHL8CODETYPE)"=="C"
3827
3828SHL8RPATH*=OOO
3829LINKFLAGSRUNPATH_$(SHL8RPATH)*=/ERROR:/Bad_SHL8RPATH_value
3830SHL8LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL8RPATH))
3831
3832.IF "$(SHL8USE_EXPORTS)"==""
3833SHL8DEF*=$(MISC)/$(SHL8TARGET).def
3834.ENDIF			# "$(SHL8USE_EXPORTS)"==""
3835
3836EXTRALIBPATHS8=$(EXTRALIBPATHS)
3837.IF "$(UPDATER)"=="YES"
3838.IF "$(SHL8NOCHECK)"==""
3839.IF "$(SOLAR_STLLIBPATH)"!=""
3840EXTRALIBPATHS8+=-L$(SOLAR_STLLIBPATH)
3841.ENDIF
3842.ENDIF				# "$(SHL8NOCHECK)"!=""
3843.ENDIF
3844#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3845#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
3846#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3847
3848.IF "$(L10N_framework)"==""
3849.IF "$(VERSIONOBJ)"!=""
3850SHL8VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL8TARGET))}$(VERSIONOBJ:f)
3851USE_VERSIONH:=$(INCCOM)/$(SHL8VERSIONOBJ:b).h
3852.IF "$(GUI)" == "UNX"
3853SHL8VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL8TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
3854.ELSE           # "$(GUI)" == "UNX"
3855SHL8VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL8TARGET))}$(VERSIONOBJ:f)
3856.ENDIF          # "$(GUI)" == "UNX"
3857$(MISC)/$(SHL8VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL8VERSIONOBJ:b).h
3858#    $(COPY) $(SOLARENV)/src/version.c $@
3859	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL8VERSIONOBJ:b).h/ > $@
3860
3861.INIT : $(SHL8VERSIONOBJDEP)
3862.ENDIF			# "$(VERSIONOBJ)"!=""
3863.ENDIF
3864
3865.IF "$(GUI)" != "UNX"
3866.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
3867.IF "$(SHL8IMPLIB)" == ""
3868SHL8IMPLIB=i$(TARGET)_t8
3869.ENDIF			# "$(SHL8IMPLIB)" == ""
3870.IF "$(COM)" != "GCC"
3871USE_8IMPLIB=-implib:$(LB)/$(SHL8IMPLIB).lib
3872.ENDIF			# "$(COM)" != "GCC"
3873SHL8IMPLIBN=$(LB)/$(SHL8IMPLIB).lib
3874ALLTAR : $(SHL8IMPLIBN)
3875
3876.IF "$(USE_DEFFILE)"==""
3877USE_8IMPLIB_DEPS=$(LB)/$(SHL8IMPLIB).lib
3878.ENDIF			# "$(USE_DEFFILE)"==""
3879.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
3880USE_SHL8DEF=$(SHL8DEF)
3881.ELSE			# "$(GUI)" != "UNX"
3882USE_SHL8DEF=
3883SHL8DEPN+:=$(SHL8DEPNU)
3884
3885.IF "$(SHL8VERSIONMAP)"==""
3886# to activate vmaps remove "#"
3887USE_SHL8VERSIONMAP=$(MISC)/$(SHL8TARGET).vmap
3888.ENDIF			# "$(SHL8VERSIONMAP)"==""
3889
3890.IF "$(USE_SHL8VERSIONMAP)"!=""
3891
3892.IF "$(SHL8FILTERFILE)"!=""
3893.IF "$(SHL8VERSIONMAP)"!=""
3894#eine von beiden ist zuviel
3895USE_SHL8VERSIONMAP=$(MISC)/$(SHL8TARGET).vmap
3896$(USE_SHL8VERSIONMAP) .PHONY:
3897	@echo -----------------------------
3898	@echo you should only use versionmap OR exportfile
3899	@echo -----------------------------
3900#	force_dmake_to_error
3901
3902.ENDIF			# "$(SHL8VERSIONMAP)"!=""
3903
3904SHL8VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL8VERSIONMAP)
3905
3906$(USE_SHL8VERSIONMAP): \
3907					$(SHL8OBJS)\
3908					$(SHL8LIBS)\
3909					$(SHL8FILTERFILE)
3910	@$(RM) $@.dump
3911.IF "$(SHL8OBJS)"!=""
3912# dump remaining objects on the fly
3913.IF "$(OS)"=="MACOSX"
3914	@-nm $(SHL8OBJS:s/.obj/.o/) > $@.dump
3915.ELSE
3916	@nm $(SHL8OBJS:s/.obj/.o/) > $@.dump
3917.ENDIF
3918.ENDIF			# "$(SHL8OBJS)!"=""
3919	@$(TYPE) /dev/null $(SHL8LIBS:s/.lib/.dump/) >> $@.dump
3920	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL8INTERFACE) -f $(SHL8FILTERFILE) -m $@
3921
3922.ELSE			# "$(SHL8FILTERFILE)"!=""
3923USE_SHL8VERSIONMAP=$(MISC)/$(SHL8TARGET).vmap
3924$(USE_SHL8VERSIONMAP) :
3925.IF "$(VERBOSE)" == "TRUE"
3926	@echo -----------------------------
3927	@echo SHL8FILTERFILE not set!
3928	@echo -----------------------------
3929	@$(TOUCH) $@
3930	@echo dummy file to keep the dependencies for later use.
3931.ELSE
3932	@$(TOUCH) $@
3933.ENDIF
3934#	force_dmake_to_error
3935.ENDIF			# "$(SHL8FILTERFILE)"!=""
3936.ELSE			# "$(USE_SHL8VERSIONMAP)"!=""
3937
3938#and now for the plain non-generic way...
3939.IF "$(SHL8VERSIONMAP)"!=""
3940USE_SHL8VERSIONMAP=$(MISC)/$(SHL8VERSIONMAP:b)_$(SHL8TARGET)$(SHL8VERSIONMAP:e)
3941SHL8VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL8VERSIONMAP)
3942
3943.IF "$(OS)"=="MACOSX"
3944$(USE_SHL8VERSIONMAP): $(SHL8OBJS) $(SHL8LIBS)
3945.ENDIF
3946
3947# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
3948# even if the $(AWK) part fails:
3949$(USE_SHL8VERSIONMAP) .ERRREMOVE: $(SHL8VERSIONMAP)
3950	@@-$(RM) -f $@
3951# The following files will only be generated and needed on Mac OS X as temporary files
3952# in order to generate exported symbols list out of Linux/Solaris map files
3953.IF "$(OS)"=="MACOSX"
3954	@-$(RM) -f $@.symregexp >& $(NULLDEV)
3955	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
3956.ENDIF
3957# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
3958# happens if somebody will change it in the future
3959.IF "$(COMID)"=="gcc3"
3960	$(COMMAND_ECHO) tr -d "\015" < $(SHL8VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
3961.ELIF "$(COMNAME)"=="sunpro5"
3962	$(COMMAND_ECHO) tr -d "\015" < $(SHL8VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
3963.ELSE           # "$(COMID)"=="gcc3"
3964	$(COMMAND_ECHO) tr -d "\015" < $(SHL8VERSIONMAP) > $@
3965.ENDIF          # "$(COMID)"=="gcc3"
3966	@chmod a+w $@
3967# Mac OS X post-processing generate an exported symbols list from the generated map file
3968# for details on exported symbols list see man ld on Mac OS X
3969.IF "$(OS)"=="MACOSX"
3970	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
3971	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
3972# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
3973# Extract RTTI symbols from all the objects that will be used to build a shared library
3974.IF "$(SHL8OBJS)"!=""
3975	-echo $(foreach,i,$(SHL8OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
3976.ENDIF
3977.IF "$(SHL8LIBS)"!=""
3978	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL8LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
3979.ENDIF
3980# overwrite the map file generate into the local output tree with the generated
3981# exported symbols list
3982	cp $@.exported-symbols $@
3983.ENDIF # .IF "$(OS)"=="MACOSX"
3984.ENDIF			# "$(SHL8VERSIONMAP)"!=""
3985.ENDIF			# "$(USE_SHL8VERSIONMAP)"!=""
3986.ENDIF			# "$(GUI)" != "UNX"
3987
3988.IF "$(UNIXVERSIONNAMES)"!=""
3989.IF "$(OS)"!="MACOSX"
3990.IF "$(GUI)"=="UNX"
3991SHL8SONAME=\"$(SONAME_SWITCH)$(SHL8TARGETN:f)\"
3992.ENDIF			# "$(GUI)"!="UNX"
3993.ENDIF			# "$(OS)"!="MACOSX"
3994.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
3995
3996.IF "$(SHL8RES)"!=""
3997SHL8ALLRES+=$(SHL8RES)
3998SHL8LINKRES*=$(MISC)/$(SHL8TARGET).res
3999SHL8LINKRESO*=$(MISC)/$(SHL8TARGET)_res.o
4000.ENDIF			# "$(SHL8RES)"!=""
4001
4002.IF "$(SHL8DEFAULTRES)$(use_shl_versions)"!=""
4003SHL8DEFAULTRES*=$(MISC)/$(SHL8TARGET)_def.res
4004SHL8ALLRES+=$(SHL8DEFAULTRES)
4005SHL8LINKRES*=$(MISC)/$(SHL8TARGET).res
4006SHL8LINKRESO*=$(MISC)/$(SHL8TARGET)_res.o
4007.ENDIF			# "$(SHL8DEFAULTRES)$(use_shl_versions)"!=""
4008
4009#.IF "$(SHL8TARGETN)"!=""
4010
4011.IF "$(linkinc)"!=""
4012.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
4013.IF "$(SHL8LIBS)"!=""
4014$(MISC)/$(SHL8TARGET)_linkinc.ls .PHONY:
4015	@@-$(RM) $@
4016	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL8LIBS) $(i:s/.lib/.lin/)) >> $@
4017.ENDIF          # "$(SHL8LIBS)"!=""
4018.ENDIF
4019
4020LINKINCTARGETS+=$(MISC)/$(SHL8TARGETN:b)_linkinc.ls
4021$(SHL8TARGETN) : $(LINKINCTARGETS)
4022
4023.ELSE
4024.IF "$(SHL8USE_EXPORTS)"=="name"
4025.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
4026.IF "$(COM)"!="GCC"
4027.IF "$(SHL8LIBS)"!=""
4028SHL8LINKLIST=$(MISC)/$(SHL8TARGET)_link.lst
4029SHL8LINKLISTPARAM=@$(SHL8LINKLIST)
4030$(SHL8LINKLIST) : $(SHL8LIBS)
4031    @@-$(RM) $@
4032	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL8LIBS) $(i:s/.lib/.lin/)) >> $@
4033.ENDIF          # "$(SHL8LIBS)"!=""
4034.ENDIF          # "$(COM)"!="GCC"
4035.ENDIF
4036.ENDIF			# "$(SHL8USE_EXPORTS)"=="name"
4037
4038$(MISC)/%linkinc.ls:
4039	@echo . > $@
4040.ENDIF          # "$(linkinc)"!=""
4041
4042.IF "$(GUI)" == "OS2"
4043#21/02/2006 YD dll names must be 8.3, invoke fix script
4044#check osl/os2/module.c/osl_loadModule()
4045SHL8TARGET8=$(shell @fix_shl $(SHL8TARGET))
4046.ENDIF
4047
4048.IF "$(GUI)" == "OS2"
4049_SHL8IMP_ORD = $(SHL8STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL8STDLIBS:^"$(LB)/")
4050SHL8IMP_ORD = $(foreach,i,$(_SHL8IMP_ORD) $(shell @-ls $i))
4051.ELSE
4052SHL8IMP_ORD =
4053.ENDIF
4054
4055
4056$(SHL8TARGETN) : \
4057					$(SHL8OBJS)\
4058					$(SHL8LIBS)\
4059					$(USE_8IMPLIB_DEPS)\
4060					$(USE_SHL8DEF)\
4061					$(USE_SHL8VERSIONMAP)\
4062					$(SHL8RES)\
4063					$(SHL8DEPN) \
4064					$(SHL8IMP_ORD) \
4065					$(SHL8LINKLIST)
4066	@echo "Making:   " $(@:f)
4067.IF "$(GUI)" == "WNT"
4068.IF "$(SHL8DEFAULTRES)"!=""
4069	@@-$(RM) $(MISC)/$(SHL8DEFAULTRES:b).rc
4070.IF "$(SHL8ICON)" != ""
4071	@echo 1 ICON $(SHL8ICON) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4072.ENDIF
4073.IF "$(use_shl_versions)" != ""
4074.IF "$(SHL8ADD_VERINFO)"!=""
4075	@echo $(EMQ)#include $(EMQ)"$(SHL8ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4076.ELSE			# "$(SHL8ADD_VERINFO)"!=""
4077	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4078	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4079	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4080.ENDIF			# "$(SHL8ADD_VERINFO)"!=""
4081	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4082	@echo $(EMQ)#define ORG_NAME	$(SHL8TARGET)$(DLLPOST) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4083	@echo $(EMQ)#define INTERNAL_NAME $(SHL8TARGET:b) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4084	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4085.ENDIF			# "$(use_shl_versions)" != ""
4086	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL8DEFAULTRES:b).rc
4087.ENDIF			# "$(SHL8DEFAULTRES)"!=""
4088.IF "$(SHL8ALLRES)"!=""
4089	$(COMMAND_ECHO)$(TYPE) $(SHL8ALLRES) > $(SHL8LINKRES)
4090.IF "$(COM)"=="GCC"
4091	windres $(SHL8LINKRES) $(SHL8LINKRESO)
4092.ENDIF			# "$(COM)"=="GCC"
4093.ENDIF			# "$(SHL8ALLRES)"!=""
4094.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
4095	@echo dlltool --dllname $(SHL8TARGET)$(DLLPOST) \
4096		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_8.cmd
4097	@noop $(assign ALL8OBJLIST:=$(STDOBJ) $(SHL8OBJS) $(SHL8LINKRESO) $(shell $(TYPE) /dev/null $(SHL8LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
4098.IF "$(DEFLIB8NAME)"!=""	# do not have to include objs
4099	@noop $(assign DEF8OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
4100	@noop $(foreach,i,$(DEF8OBJLIST) $(assign ALL8OBJLIST:=$(ALL8OBJLIST:s?$i??)))
4101.ENDIF			# "$(DEFLIB8NAME)"!=""
4102	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
4103.IF "$(SHL8DEF)"!=""
4104	@echo	--input-def $(SHL8DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
4105.ELSE
4106	@echo	$(SHL8VERSIONOBJ) $(SHL8DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
4107.ENDIF
4108	@echo	$(ALL8OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_8.cmd
4109	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
4110		$(STDOBJ) $(SHL8VERSIONOBJ) $(SHL8DESCRIPTIONOBJ) $(SHL8OBJS) $(SHL8LINKRESO) \
4111		`$(TYPE) /dev/null $(SHL8LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
4112		-Wl,--exclude-libs,ALL,--start-group $(SHL8STDLIBS) -Wl,--end-group \
4113		$(SHL8STDSHL) $(STDSHL8) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
4114		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_8.cmd
4115  .IF "$(VERBOSE)" == "TRUE"
4116	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_8.cmd
4117  .ENDIF
4118	@+source $(MISC)/$(TARGET).$(@:b)_8.cmd
4119.ELSE
4120.IF "$(linkinc)"==""
4121.IF "$(SHL8USE_EXPORTS)"!="name"
4122.IF "$(USE_DEFFILE)"!=""
4123	$(COMMAND_ECHO)$(SHL8LINKER) @$(mktmp \
4124		$(SHL8LINKFLAGS) \
4125		$(LINKFLAGSSHL) \
4126		$(SHL8STACK) $(SHL8BASEX)	\
4127		-out:$@ \
4128		-map:$(MISC)/$(@:b).map \
4129		-def:$(SHL8DEF) \
4130		$(USE_8IMPLIB) \
4131		$(STDOBJ) \
4132		$(SHL8VERSIONOBJ) $(SHL8OBJS) \
4133		$(SHL8LIBS) \
4134		$(SHL8STDLIBS) \
4135		$(SHL8STDSHL) $(STDSHL8) \
4136		$(SHL8LINKRES) \
4137	)
4138# double check if target was really written... still making sense?
4139    @@$(LS) $@
4140	@echo linking $@.manifest ...
4141.IF "$(VISTA_MANIFEST)"!=""
4142	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4143	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4144.ELSE
4145	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4146.ENDIF # "$(VISTA_MANIFEST)"!=""
4147	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4148	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4149.ELSE			# "$(USE_DEFFILE)"!=""
4150	$(COMMAND_ECHO)$(SHL8LINKER) @$(mktmp	$(SHL8LINKFLAGS)			\
4151		$(LINKFLAGSSHL) $(SHL8BASEX)		\
4152		$(SHL8STACK) -out:$(SHL8TARGETN)	\
4153		-map:$(MISC)/$(@:B).map				\
4154		$(LB)/$(SHL8IMPLIB).exp				\
4155		$(STDOBJ)							\
4156		$(SHL8OBJS) $(SHL8VERSIONOBJ) \
4157		$(SHL8LIBS)                         \
4158		$(SHL8STDLIBS)                      \
4159		$(SHL8STDSHL) $(STDSHL8)                           \
4160		$(SHL8LINKRES) \
4161	)
4162# double check if target was really written... still making sense?
4163    @@$(LS) $@
4164	@echo linking $@.manifest ...
4165.IF "$(VISTA_MANIFEST)"!=""
4166	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4167	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4168.ELSE
4169	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4170.ENDIF # "$(VISTA_MANIFEST)"!=""
4171	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4172	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4173.ENDIF			# "$(USE_DEFFILE)"!=""
4174.ELSE			# "$(SHL8USE_EXPORTS)"!="name"
4175	$(COMMAND_ECHO)$(SHL8LINKER) @$(mktmp	$(SHL8LINKFLAGS)			\
4176		$(LINKFLAGSSHL) $(SHL8BASEX)		\
4177		$(SHL8STACK) -out:$(SHL8TARGETN)	\
4178		-map:$(MISC)/$(@:B).map				\
4179		$(USE_8IMPLIB) \
4180		$(STDOBJ)							\
4181		$(SHL8OBJS) $(SHL8VERSIONOBJ))   \
4182		$(SHL8LINKLISTPARAM) \
4183		@$(mktmp $(SHL8STDLIBS)                      \
4184		$(SHL8STDSHL) $(STDSHL8)                           \
4185		$(SHL8LINKRES) \
4186	)
4187	@echo linking $@.manifest ...
4188.IF "$(VISTA_MANIFEST)"!=""
4189	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4190	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4191.ELSE
4192	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4193.ENDIF # "$(VISTA_MANIFEST)"!=""
4194	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4195	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4196.ENDIF			# "$(SHL8USE_EXPORTS)"!="name"
4197.ELSE			# "$(linkinc)"==""
4198		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL8TARGET).lnk
4199		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL8TARGET).lst
4200		$(COMMAND_ECHO)$(TYPE) $(mktmp \
4201		$(SHL8LINKFLAGS) \
4202		$(LINKFLAGSSHL) $(SHL8BASEX) \
4203		$(SHL8STACK) $(MAPFILE) \
4204		-out:$@ \
4205		$(LB)/$(SHL8IMPLIB).exp \
4206		$(STDOBJ) \
4207		$(SHL8OBJS) \
4208		$(SHL8STDLIBS) \
4209		$(SHL8STDSHL) $(STDSHL8) \
4210		$(SHL8LINKRES) \
4211		) >> $(MISC)/$(SHL8TARGET).lnk
4212		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL8TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL8TARGET).lnk
4213		$(COMMAND_ECHO)$(SHL8LINKER) @$(MISC)/$(SHL8TARGET).lnk
4214		@echo linking $@.manifest ...
4215.IF "$(VISTA_MANIFEST)"!=""
4216		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4217		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4218.ELSE
4219		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4220.ENDIF # "$(VISTA_MANIFEST)"!=""
4221		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4222		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4223.ENDIF			# "$(linkinc)"==""
4224.ENDIF			# "$(COM)"=="GCC"
4225.ENDIF			# "$(GUI)" == "WNT"
4226.IF "$(GUI)"=="UNX"
4227.IF "$(OS)"=="MACOSX"
4228	@-$(RM) $(MISC)/$(@:b).list
4229	@-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
4230	@echo $(STDSLO) $(SHL8OBJS:s/.obj/.o/) \
4231	$(SHL8VERSIONOBJ) \
4232	`cat /dev/null $(SHL8LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
4233	@echo -n $(SHL8LINKER) $(SHL8LINKFLAGS) $(SHL8VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
4234	$(SHL8STDLIBS) $(SHL8ARCHIVES) $(SHL8STDSHL) $(STDSHL8) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_8.cmd
4235    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
4236        `cat $(MISC)/$(TARGET).$(@:b)_8.cmd` \
4237        >> $(MISC)/$(TARGET).$(@:b)_8.cmd
4238  .IF "$(VERBOSE)" == "TRUE"
4239	@cat $(MISC)/$(TARGET).$(@:b)_8.cmd
4240  .ENDIF
4241	@+source $(MISC)/$(TARGET).$(@:b)_8.cmd
4242    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
4243        shl $(SHL8RPATH) $@
4244.IF "$(SHL8CREATEJNILIB)"!=""
4245	@echo "Making:   " $(@:f).jnilib
4246	@macosx-create-bundle $@
4247.ENDIF          # "$(SHL8CREATEJNILIB)"!=""
4248.IF "$(UPDATER)"=="YES"
4249.IF "$(SHL8NOCHECK)"==""
4250	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN)
4251.ENDIF				# "$(SHL8NOCHECK)"!=""
4252.ENDIF
4253.ELSE			# "$(OS)"=="MACOSX"
4254	@-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
4255	@echo $(SHL8LINKER) $(SHL8LINKFLAGS) $(SHL8SONAME) $(LINKFLAGSSHL) $(SHL8VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL8OBJS:s/.obj/.o/) \
4256	$(SHL8VERSIONOBJ) -o $@ \
4257	`cat /dev/null $(SHL8LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
4258	$(SHL8STDLIBS) $(SHL8ARCHIVES) $(SHL8STDSHL) $(STDSHL8) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_8.cmd
4259  .IF "$(VERBOSE)" == "TRUE"
4260	@cat $(MISC)/$(TARGET).$(@:b)_8.cmd
4261  .ENDIF
4262	@+source $(MISC)/$(TARGET).$(@:b)_8.cmd
4263.IF "$(UPDATER)"=="YES"
4264.IF "$(SHL8NOCHECK)"==""
4265	$(COMMAND_ECHO)-$(RM) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
4266	$(COMMAND_ECHO)$(RENAME) $(SHL8TARGETN) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
4267.IF "$(VERBOSE)"=="TRUE"
4268	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
4269.ELSE
4270	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) -- -s $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
4271.ENDIF
4272.ENDIF				# "$(SHL8NOCHECK)"!=""
4273.ENDIF			# "$(UPDATER)"=="YES"
4274.ENDIF			# "$(OS)"=="MACOSX"
4275.IF "$(UNIXVERSIONNAMES)"!=""
4276	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL8TARGETN:b)
4277	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL8TARGETN:f) $(SHL8TARGETN:b)
4278.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
4279.IF "$(VERBOSE)" == "TRUE"
4280	@ls -l $@
4281.ENDIF
4282.ENDIF			# "$(GUI)" == "UNX"
4283
4284.IF "$(GUI)" == "OS2"
4285
4286.IF "$(SHL8DEFAULTRES)"!=""
4287	@+-$(RM) $(MISC)/$(SHL8DEFAULTRES:b).rc >& $(NULLDEV)
4288.IF "$(SHL8ICON)" != ""
4289	@-+echo 1 ICON $(SHL8ICON) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4290.ENDIF
4291.IF "$(use_shl_versions)" != ""
4292.IF "$(SHL8ADD_VERINFO)"!=""
4293	@-+echo $(EMQ)#include $(EMQ)"$(SHL8ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4294.ENDIF			# "$(SHL8ADD_VERINFO)"!=""
4295	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4296#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
4297.ENDIF			# "$(use_shl_versions)" != ""
4298# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
4299	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL8DEFAULTRES:b).rc
4300.ENDIF			# "$(SHL8DEFAULTRES)"!=""
4301
4302.IF "$(SHL8ALLRES)"!=""
4303	$(COMMAND_ECHO)+$(TYPE) $(SHL8ALLRES) > $(SHL8LINKRES)
4304.ENDIF			# "$(SHL8ALLRES)"!=""
4305
4306.IF "$(USE_DEFFILE)"!=""
4307
4308	$(COMMAND_ECHO)$(SHL8LINKER) $(SHL8LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
4309		$(SHL8DEF) \
4310		$(STDOBJ) \
4311		-L$(LB) \
4312		-L$(SOLARVERSION)/$(INPATH)/lib \
4313		$(SHL8OBJS) $(SHL8VERSIONOBJ) \
4314		$(SHL8LIBS) \
4315		$(SHL8STDLIBS:^"-l") \
4316		$(SHL8LINKRES) \
4317		$(SHL8STDSHL:^"-l") $(STDSHL8:^"-l")
4318
4319.ELSE			# "$(USE_DEFFILE)"!=""
4320
4321	$(COMMAND_ECHO)$(SHL8LINKER) -v 	$(SHL8LINKFLAGS)			\
4322		$(LINKFLAGSSHL) $(SHL8BASEX)		\
4323		$(SHL8STACK) -o $(SHL8TARGETN)	\
4324		$(SHL8DEF) \
4325		$(STDOBJ)							\
4326		-L$(LB) \
4327		-L$(SOLARVERSION)/$(INPATH)/lib \
4328		$(SHL8OBJS) $(SHL8VERSIONOBJ) \
4329		$(SHL8LIBS) \
4330		$(SHL8STDLIBS:^"-l") \
4331		$(SHL8LINKRES) \
4332		$(SHL8STDSHL:^"-l") $(STDSHL8:^"-l")                           \
4333	@$(LS) $@ >& $(NULLDEV)
4334
4335.ENDIF			# "$(USE_DEFFILE)"!=""
4336
4337.IF "$(SHL8TARGET8)" != "$(SHL8TARGET)"
4338	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL8TARGET8).dll
4339.ENDIF
4340
4341.ENDIF			# "$(GUI)" == "OS2"
4342
4343.ENDIF			# "$(SHL8TARGETN)"!=""
4344
4345# unroll begin
4346
4347.IF "$(SHL9TARGETN)"!=""
4348
4349.IF "$(OS)"=="AIX"
4350SHL9STDLIBS=
4351.ENDIF
4352
4353.IF "$(SHLLINKARCONLY)" != ""
4354SHL9STDLIBS=
4355STDSHL=
4356.ELSE
4357SHL9ARCHIVES=
4358.ENDIF
4359
4360# decide how to link
4361.IF "$(SHL9CODETYPE)"=="C"
4362SHL9LINKER=$(LINKC)
4363SHL9STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
4364SHL9LINKFLAGS+=$(LINKCFLAGS)
4365.ELSE			# "$(SHL9CODETYPE)"=="C"
4366SHL9LINKER=$(LINK)
4367SHL9STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
4368SHL9LINKFLAGS+=$(LINKFLAGS)
4369.ENDIF			# "$(SHL9CODETYPE)"=="C"
4370
4371SHL9RPATH*=OOO
4372LINKFLAGSRUNPATH_$(SHL9RPATH)*=/ERROR:/Bad_SHL9RPATH_value
4373SHL9LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL9RPATH))
4374
4375.IF "$(SHL9USE_EXPORTS)"==""
4376SHL9DEF*=$(MISC)/$(SHL9TARGET).def
4377.ENDIF			# "$(SHL9USE_EXPORTS)"==""
4378
4379EXTRALIBPATHS9=$(EXTRALIBPATHS)
4380.IF "$(UPDATER)"=="YES"
4381.IF "$(SHL9NOCHECK)"==""
4382.IF "$(SOLAR_STLLIBPATH)"!=""
4383EXTRALIBPATHS9+=-L$(SOLAR_STLLIBPATH)
4384.ENDIF
4385.ENDIF				# "$(SHL9NOCHECK)"!=""
4386.ENDIF
4387#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4388#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
4389#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4390
4391.IF "$(L10N_framework)"==""
4392.IF "$(VERSIONOBJ)"!=""
4393SHL9VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL9TARGET))}$(VERSIONOBJ:f)
4394USE_VERSIONH:=$(INCCOM)/$(SHL9VERSIONOBJ:b).h
4395.IF "$(GUI)" == "UNX"
4396SHL9VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL9TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
4397.ELSE           # "$(GUI)" == "UNX"
4398SHL9VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL9TARGET))}$(VERSIONOBJ:f)
4399.ENDIF          # "$(GUI)" == "UNX"
4400$(MISC)/$(SHL9VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL9VERSIONOBJ:b).h
4401#    $(COPY) $(SOLARENV)/src/version.c $@
4402	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL9VERSIONOBJ:b).h/ > $@
4403
4404.INIT : $(SHL9VERSIONOBJDEP)
4405.ENDIF			# "$(VERSIONOBJ)"!=""
4406.ENDIF
4407
4408.IF "$(GUI)" != "UNX"
4409.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
4410.IF "$(SHL9IMPLIB)" == ""
4411SHL9IMPLIB=i$(TARGET)_t9
4412.ENDIF			# "$(SHL9IMPLIB)" == ""
4413.IF "$(COM)" != "GCC"
4414USE_9IMPLIB=-implib:$(LB)/$(SHL9IMPLIB).lib
4415.ENDIF			# "$(COM)" != "GCC"
4416SHL9IMPLIBN=$(LB)/$(SHL9IMPLIB).lib
4417ALLTAR : $(SHL9IMPLIBN)
4418
4419.IF "$(USE_DEFFILE)"==""
4420USE_9IMPLIB_DEPS=$(LB)/$(SHL9IMPLIB).lib
4421.ENDIF			# "$(USE_DEFFILE)"==""
4422.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
4423USE_SHL9DEF=$(SHL9DEF)
4424.ELSE			# "$(GUI)" != "UNX"
4425USE_SHL9DEF=
4426SHL9DEPN+:=$(SHL9DEPNU)
4427
4428.IF "$(SHL9VERSIONMAP)"==""
4429# to activate vmaps remove "#"
4430USE_SHL9VERSIONMAP=$(MISC)/$(SHL9TARGET).vmap
4431.ENDIF			# "$(SHL9VERSIONMAP)"==""
4432
4433.IF "$(USE_SHL9VERSIONMAP)"!=""
4434
4435.IF "$(SHL9FILTERFILE)"!=""
4436.IF "$(SHL9VERSIONMAP)"!=""
4437#eine von beiden ist zuviel
4438USE_SHL9VERSIONMAP=$(MISC)/$(SHL9TARGET).vmap
4439$(USE_SHL9VERSIONMAP) .PHONY:
4440	@echo -----------------------------
4441	@echo you should only use versionmap OR exportfile
4442	@echo -----------------------------
4443#	force_dmake_to_error
4444
4445.ENDIF			# "$(SHL9VERSIONMAP)"!=""
4446
4447SHL9VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL9VERSIONMAP)
4448
4449$(USE_SHL9VERSIONMAP): \
4450					$(SHL9OBJS)\
4451					$(SHL9LIBS)\
4452					$(SHL9FILTERFILE)
4453	@$(RM) $@.dump
4454.IF "$(SHL9OBJS)"!=""
4455# dump remaining objects on the fly
4456.IF "$(OS)"=="MACOSX"
4457	@-nm $(SHL9OBJS:s/.obj/.o/) > $@.dump
4458.ELSE
4459	@nm $(SHL9OBJS:s/.obj/.o/) > $@.dump
4460.ENDIF
4461.ENDIF			# "$(SHL9OBJS)!"=""
4462	@$(TYPE) /dev/null $(SHL9LIBS:s/.lib/.dump/) >> $@.dump
4463	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL9INTERFACE) -f $(SHL9FILTERFILE) -m $@
4464
4465.ELSE			# "$(SHL9FILTERFILE)"!=""
4466USE_SHL9VERSIONMAP=$(MISC)/$(SHL9TARGET).vmap
4467$(USE_SHL9VERSIONMAP) :
4468.IF "$(VERBOSE)" == "TRUE"
4469	@echo -----------------------------
4470	@echo SHL9FILTERFILE not set!
4471	@echo -----------------------------
4472	@$(TOUCH) $@
4473	@echo dummy file to keep the dependencies for later use.
4474.ELSE
4475	@$(TOUCH) $@
4476.ENDIF
4477#	force_dmake_to_error
4478.ENDIF			# "$(SHL9FILTERFILE)"!=""
4479.ELSE			# "$(USE_SHL9VERSIONMAP)"!=""
4480
4481#and now for the plain non-generic way...
4482.IF "$(SHL9VERSIONMAP)"!=""
4483USE_SHL9VERSIONMAP=$(MISC)/$(SHL9VERSIONMAP:b)_$(SHL9TARGET)$(SHL9VERSIONMAP:e)
4484SHL9VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL9VERSIONMAP)
4485
4486.IF "$(OS)"=="MACOSX"
4487$(USE_SHL9VERSIONMAP): $(SHL9OBJS) $(SHL9LIBS)
4488.ENDIF
4489
4490# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
4491# even if the $(AWK) part fails:
4492$(USE_SHL9VERSIONMAP) .ERRREMOVE: $(SHL9VERSIONMAP)
4493	@@-$(RM) -f $@
4494# The following files will only be generated and needed on Mac OS X as temporary files
4495# in order to generate exported symbols list out of Linux/Solaris map files
4496.IF "$(OS)"=="MACOSX"
4497	@-$(RM) -f $@.symregexp >& $(NULLDEV)
4498	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
4499.ENDIF
4500# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
4501# happens if somebody will change it in the future
4502.IF "$(COMID)"=="gcc3"
4503	$(COMMAND_ECHO) tr -d "\015" < $(SHL9VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
4504.ELIF "$(COMNAME)"=="sunpro5"
4505	$(COMMAND_ECHO) tr -d "\015" < $(SHL9VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
4506.ELSE           # "$(COMID)"=="gcc3"
4507	$(COMMAND_ECHO) tr -d "\015" < $(SHL9VERSIONMAP) > $@
4508.ENDIF          # "$(COMID)"=="gcc3"
4509	@chmod a+w $@
4510# Mac OS X post-processing generate an exported symbols list from the generated map file
4511# for details on exported symbols list see man ld on Mac OS X
4512.IF "$(OS)"=="MACOSX"
4513	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
4514	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
4515# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
4516# Extract RTTI symbols from all the objects that will be used to build a shared library
4517.IF "$(SHL9OBJS)"!=""
4518	-echo $(foreach,i,$(SHL9OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
4519.ENDIF
4520.IF "$(SHL9LIBS)"!=""
4521	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL9LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
4522.ENDIF
4523# overwrite the map file generate into the local output tree with the generated
4524# exported symbols list
4525	cp $@.exported-symbols $@
4526.ENDIF # .IF "$(OS)"=="MACOSX"
4527.ENDIF			# "$(SHL9VERSIONMAP)"!=""
4528.ENDIF			# "$(USE_SHL9VERSIONMAP)"!=""
4529.ENDIF			# "$(GUI)" != "UNX"
4530
4531.IF "$(UNIXVERSIONNAMES)"!=""
4532.IF "$(OS)"!="MACOSX"
4533.IF "$(GUI)"=="UNX"
4534SHL9SONAME=\"$(SONAME_SWITCH)$(SHL9TARGETN:f)\"
4535.ENDIF			# "$(GUI)"!="UNX"
4536.ENDIF			# "$(OS)"!="MACOSX"
4537.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
4538
4539.IF "$(SHL9RES)"!=""
4540SHL9ALLRES+=$(SHL9RES)
4541SHL9LINKRES*=$(MISC)/$(SHL9TARGET).res
4542SHL9LINKRESO*=$(MISC)/$(SHL9TARGET)_res.o
4543.ENDIF			# "$(SHL9RES)"!=""
4544
4545.IF "$(SHL9DEFAULTRES)$(use_shl_versions)"!=""
4546SHL9DEFAULTRES*=$(MISC)/$(SHL9TARGET)_def.res
4547SHL9ALLRES+=$(SHL9DEFAULTRES)
4548SHL9LINKRES*=$(MISC)/$(SHL9TARGET).res
4549SHL9LINKRESO*=$(MISC)/$(SHL9TARGET)_res.o
4550.ENDIF			# "$(SHL9DEFAULTRES)$(use_shl_versions)"!=""
4551
4552#.IF "$(SHL9TARGETN)"!=""
4553
4554.IF "$(linkinc)"!=""
4555.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
4556.IF "$(SHL9LIBS)"!=""
4557$(MISC)/$(SHL9TARGET)_linkinc.ls .PHONY:
4558	@@-$(RM) $@
4559	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL9LIBS) $(i:s/.lib/.lin/)) >> $@
4560.ENDIF          # "$(SHL9LIBS)"!=""
4561.ENDIF
4562
4563LINKINCTARGETS+=$(MISC)/$(SHL9TARGETN:b)_linkinc.ls
4564$(SHL9TARGETN) : $(LINKINCTARGETS)
4565
4566.ELSE
4567.IF "$(SHL9USE_EXPORTS)"=="name"
4568.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
4569.IF "$(COM)"!="GCC"
4570.IF "$(SHL9LIBS)"!=""
4571SHL9LINKLIST=$(MISC)/$(SHL9TARGET)_link.lst
4572SHL9LINKLISTPARAM=@$(SHL9LINKLIST)
4573$(SHL9LINKLIST) : $(SHL9LIBS)
4574    @@-$(RM) $@
4575	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL9LIBS) $(i:s/.lib/.lin/)) >> $@
4576.ENDIF          # "$(SHL9LIBS)"!=""
4577.ENDIF          # "$(COM)"!="GCC"
4578.ENDIF
4579.ENDIF			# "$(SHL9USE_EXPORTS)"=="name"
4580
4581$(MISC)/%linkinc.ls:
4582	@echo . > $@
4583.ENDIF          # "$(linkinc)"!=""
4584
4585.IF "$(GUI)" == "OS2"
4586#21/02/2006 YD dll names must be 8.3, invoke fix script
4587#check osl/os2/module.c/osl_loadModule()
4588SHL9TARGET8=$(shell @fix_shl $(SHL9TARGET))
4589.ENDIF
4590
4591.IF "$(GUI)" == "OS2"
4592_SHL9IMP_ORD = $(SHL9STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL9STDLIBS:^"$(LB)/")
4593SHL9IMP_ORD = $(foreach,i,$(_SHL9IMP_ORD) $(shell @-ls $i))
4594.ELSE
4595SHL9IMP_ORD =
4596.ENDIF
4597
4598
4599$(SHL9TARGETN) : \
4600					$(SHL9OBJS)\
4601					$(SHL9LIBS)\
4602					$(USE_9IMPLIB_DEPS)\
4603					$(USE_SHL9DEF)\
4604					$(USE_SHL9VERSIONMAP)\
4605					$(SHL9RES)\
4606					$(SHL9DEPN) \
4607					$(SHL9IMP_ORD) \
4608					$(SHL9LINKLIST)
4609	@echo "Making:   " $(@:f)
4610.IF "$(GUI)" == "WNT"
4611.IF "$(SHL9DEFAULTRES)"!=""
4612	@@-$(RM) $(MISC)/$(SHL9DEFAULTRES:b).rc
4613.IF "$(SHL9ICON)" != ""
4614	@echo 1 ICON $(SHL9ICON) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4615.ENDIF
4616.IF "$(use_shl_versions)" != ""
4617.IF "$(SHL9ADD_VERINFO)"!=""
4618	@echo $(EMQ)#include $(EMQ)"$(SHL9ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4619.ELSE			# "$(SHL9ADD_VERINFO)"!=""
4620	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4621	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4622	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4623.ENDIF			# "$(SHL9ADD_VERINFO)"!=""
4624	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4625	@echo $(EMQ)#define ORG_NAME	$(SHL9TARGET)$(DLLPOST) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4626	@echo $(EMQ)#define INTERNAL_NAME $(SHL9TARGET:b) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4627	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4628.ENDIF			# "$(use_shl_versions)" != ""
4629	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL9DEFAULTRES:b).rc
4630.ENDIF			# "$(SHL9DEFAULTRES)"!=""
4631.IF "$(SHL9ALLRES)"!=""
4632	$(COMMAND_ECHO)$(TYPE) $(SHL9ALLRES) > $(SHL9LINKRES)
4633.IF "$(COM)"=="GCC"
4634	windres $(SHL9LINKRES) $(SHL9LINKRESO)
4635.ENDIF			# "$(COM)"=="GCC"
4636.ENDIF			# "$(SHL9ALLRES)"!=""
4637.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
4638	@echo dlltool --dllname $(SHL9TARGET)$(DLLPOST) \
4639		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_9.cmd
4640	@noop $(assign ALL9OBJLIST:=$(STDOBJ) $(SHL9OBJS) $(SHL9LINKRESO) $(shell $(TYPE) /dev/null $(SHL9LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
4641.IF "$(DEFLIB9NAME)"!=""	# do not have to include objs
4642	@noop $(assign DEF9OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
4643	@noop $(foreach,i,$(DEF9OBJLIST) $(assign ALL9OBJLIST:=$(ALL9OBJLIST:s?$i??)))
4644.ENDIF			# "$(DEFLIB9NAME)"!=""
4645	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
4646.IF "$(SHL9DEF)"!=""
4647	@echo	--input-def $(SHL9DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
4648.ELSE
4649	@echo	$(SHL9VERSIONOBJ) $(SHL9DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
4650.ENDIF
4651	@echo	$(ALL9OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_9.cmd
4652	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
4653		$(STDOBJ) $(SHL9VERSIONOBJ) $(SHL9DESCRIPTIONOBJ) $(SHL9OBJS) $(SHL9LINKRESO) \
4654		`$(TYPE) /dev/null $(SHL9LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
4655		-Wl,--exclude-libs,ALL,--start-group $(SHL9STDLIBS) -Wl,--end-group \
4656		$(SHL9STDSHL) $(STDSHL9) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
4657		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_9.cmd
4658  .IF "$(VERBOSE)" == "TRUE"
4659	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_9.cmd
4660  .ENDIF
4661	@+source $(MISC)/$(TARGET).$(@:b)_9.cmd
4662.ELSE
4663.IF "$(linkinc)"==""
4664.IF "$(SHL9USE_EXPORTS)"!="name"
4665.IF "$(USE_DEFFILE)"!=""
4666	$(COMMAND_ECHO)$(SHL9LINKER) @$(mktmp \
4667		$(SHL9LINKFLAGS) \
4668		$(LINKFLAGSSHL) \
4669		$(SHL9STACK) $(SHL9BASEX)	\
4670		-out:$@ \
4671		-map:$(MISC)/$(@:b).map \
4672		-def:$(SHL9DEF) \
4673		$(USE_9IMPLIB) \
4674		$(STDOBJ) \
4675		$(SHL9VERSIONOBJ) $(SHL9OBJS) \
4676		$(SHL9LIBS) \
4677		$(SHL9STDLIBS) \
4678		$(SHL9STDSHL) $(STDSHL9) \
4679		$(SHL9LINKRES) \
4680	)
4681# double check if target was really written... still making sense?
4682    @@$(LS) $@
4683	@echo linking $@.manifest ...
4684.IF "$(VISTA_MANIFEST)"!=""
4685	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4686	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4687.ELSE
4688	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4689.ENDIF # "$(VISTA_MANIFEST)"!=""
4690	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4691	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4692.ELSE			# "$(USE_DEFFILE)"!=""
4693	$(COMMAND_ECHO)$(SHL9LINKER) @$(mktmp	$(SHL9LINKFLAGS)			\
4694		$(LINKFLAGSSHL) $(SHL9BASEX)		\
4695		$(SHL9STACK) -out:$(SHL9TARGETN)	\
4696		-map:$(MISC)/$(@:B).map				\
4697		$(LB)/$(SHL9IMPLIB).exp				\
4698		$(STDOBJ)							\
4699		$(SHL9OBJS) $(SHL9VERSIONOBJ) \
4700		$(SHL9LIBS)                         \
4701		$(SHL9STDLIBS)                      \
4702		$(SHL9STDSHL) $(STDSHL9)                           \
4703		$(SHL9LINKRES) \
4704	)
4705# double check if target was really written... still making sense?
4706    @@$(LS) $@
4707	@echo linking $@.manifest ...
4708.IF "$(VISTA_MANIFEST)"!=""
4709	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4710	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4711.ELSE
4712	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4713.ENDIF # "$(VISTA_MANIFEST)"!=""
4714	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4715	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4716.ENDIF			# "$(USE_DEFFILE)"!=""
4717.ELSE			# "$(SHL9USE_EXPORTS)"!="name"
4718	$(COMMAND_ECHO)$(SHL9LINKER) @$(mktmp	$(SHL9LINKFLAGS)			\
4719		$(LINKFLAGSSHL) $(SHL9BASEX)		\
4720		$(SHL9STACK) -out:$(SHL9TARGETN)	\
4721		-map:$(MISC)/$(@:B).map				\
4722		$(USE_9IMPLIB) \
4723		$(STDOBJ)							\
4724		$(SHL9OBJS) $(SHL9VERSIONOBJ))   \
4725		$(SHL9LINKLISTPARAM) \
4726		@$(mktmp $(SHL9STDLIBS)                      \
4727		$(SHL9STDSHL) $(STDSHL9)                           \
4728		$(SHL9LINKRES) \
4729	)
4730	@echo linking $@.manifest ...
4731.IF "$(VISTA_MANIFEST)"!=""
4732	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4733	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4734.ELSE
4735	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4736.ENDIF # "$(VISTA_MANIFEST)"!=""
4737	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4738	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4739.ENDIF			# "$(SHL9USE_EXPORTS)"!="name"
4740.ELSE			# "$(linkinc)"==""
4741		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL9TARGET).lnk
4742		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL9TARGET).lst
4743		$(COMMAND_ECHO)$(TYPE) $(mktmp \
4744		$(SHL9LINKFLAGS) \
4745		$(LINKFLAGSSHL) $(SHL9BASEX) \
4746		$(SHL9STACK) $(MAPFILE) \
4747		-out:$@ \
4748		$(LB)/$(SHL9IMPLIB).exp \
4749		$(STDOBJ) \
4750		$(SHL9OBJS) \
4751		$(SHL9STDLIBS) \
4752		$(SHL9STDSHL) $(STDSHL9) \
4753		$(SHL9LINKRES) \
4754		) >> $(MISC)/$(SHL9TARGET).lnk
4755		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL9TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL9TARGET).lnk
4756		$(COMMAND_ECHO)$(SHL9LINKER) @$(MISC)/$(SHL9TARGET).lnk
4757		@echo linking $@.manifest ...
4758.IF "$(VISTA_MANIFEST)"!=""
4759		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
4760		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
4761.ELSE
4762		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
4763.ENDIF # "$(VISTA_MANIFEST)"!=""
4764		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
4765		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
4766.ENDIF			# "$(linkinc)"==""
4767.ENDIF			# "$(COM)"=="GCC"
4768.ENDIF			# "$(GUI)" == "WNT"
4769.IF "$(GUI)"=="UNX"
4770.IF "$(OS)"=="MACOSX"
4771	@-$(RM) $(MISC)/$(@:b).list
4772	@-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
4773	@echo $(STDSLO) $(SHL9OBJS:s/.obj/.o/) \
4774	$(SHL9VERSIONOBJ) \
4775	`cat /dev/null $(SHL9LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
4776	@echo -n $(SHL9LINKER) $(SHL9LINKFLAGS) $(SHL9VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
4777	$(SHL9STDLIBS) $(SHL9ARCHIVES) $(SHL9STDSHL) $(STDSHL9) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_9.cmd
4778    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
4779        `cat $(MISC)/$(TARGET).$(@:b)_9.cmd` \
4780        >> $(MISC)/$(TARGET).$(@:b)_9.cmd
4781  .IF "$(VERBOSE)" == "TRUE"
4782	@cat $(MISC)/$(TARGET).$(@:b)_9.cmd
4783  .ENDIF
4784	@+source $(MISC)/$(TARGET).$(@:b)_9.cmd
4785    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
4786        shl $(SHL9RPATH) $@
4787.IF "$(SHL9CREATEJNILIB)"!=""
4788	@echo "Making:   " $(@:f).jnilib
4789	@macosx-create-bundle $@
4790.ENDIF          # "$(SHL9CREATEJNILIB)"!=""
4791.IF "$(UPDATER)"=="YES"
4792.IF "$(SHL9NOCHECK)"==""
4793	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN)
4794.ENDIF				# "$(SHL9NOCHECK)"!=""
4795.ENDIF
4796.ELSE			# "$(OS)"=="MACOSX"
4797	@-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
4798	@echo $(SHL9LINKER) $(SHL9LINKFLAGS) $(SHL9SONAME) $(LINKFLAGSSHL) $(SHL9VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL9OBJS:s/.obj/.o/) \
4799	$(SHL9VERSIONOBJ) -o $@ \
4800	`cat /dev/null $(SHL9LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
4801	$(SHL9STDLIBS) $(SHL9ARCHIVES) $(SHL9STDSHL) $(STDSHL9) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_9.cmd
4802  .IF "$(VERBOSE)" == "TRUE"
4803	@cat $(MISC)/$(TARGET).$(@:b)_9.cmd
4804  .ENDIF
4805	@+source $(MISC)/$(TARGET).$(@:b)_9.cmd
4806.IF "$(UPDATER)"=="YES"
4807.IF "$(SHL9NOCHECK)"==""
4808	$(COMMAND_ECHO)-$(RM) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
4809	$(COMMAND_ECHO)$(RENAME) $(SHL9TARGETN) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
4810.IF "$(VERBOSE)"=="TRUE"
4811	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
4812.ELSE
4813	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) -- -s $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
4814.ENDIF
4815.ENDIF				# "$(SHL9NOCHECK)"!=""
4816.ENDIF			# "$(UPDATER)"=="YES"
4817.ENDIF			# "$(OS)"=="MACOSX"
4818.IF "$(UNIXVERSIONNAMES)"!=""
4819	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL9TARGETN:b)
4820	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL9TARGETN:f) $(SHL9TARGETN:b)
4821.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
4822.IF "$(VERBOSE)" == "TRUE"
4823	@ls -l $@
4824.ENDIF
4825.ENDIF			# "$(GUI)" == "UNX"
4826
4827.IF "$(GUI)" == "OS2"
4828
4829.IF "$(SHL9DEFAULTRES)"!=""
4830	@+-$(RM) $(MISC)/$(SHL9DEFAULTRES:b).rc >& $(NULLDEV)
4831.IF "$(SHL9ICON)" != ""
4832	@-+echo 1 ICON $(SHL9ICON) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4833.ENDIF
4834.IF "$(use_shl_versions)" != ""
4835.IF "$(SHL9ADD_VERINFO)"!=""
4836	@-+echo $(EMQ)#include $(EMQ)"$(SHL9ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4837.ENDIF			# "$(SHL9ADD_VERINFO)"!=""
4838	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4839#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
4840.ENDIF			# "$(use_shl_versions)" != ""
4841# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
4842	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL9DEFAULTRES:b).rc
4843.ENDIF			# "$(SHL9DEFAULTRES)"!=""
4844
4845.IF "$(SHL9ALLRES)"!=""
4846	$(COMMAND_ECHO)+$(TYPE) $(SHL9ALLRES) > $(SHL9LINKRES)
4847.ENDIF			# "$(SHL9ALLRES)"!=""
4848
4849.IF "$(USE_DEFFILE)"!=""
4850
4851	$(COMMAND_ECHO)$(SHL9LINKER) $(SHL9LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
4852		$(SHL9DEF) \
4853		$(STDOBJ) \
4854		-L$(LB) \
4855		-L$(SOLARVERSION)/$(INPATH)/lib \
4856		$(SHL9OBJS) $(SHL9VERSIONOBJ) \
4857		$(SHL9LIBS) \
4858		$(SHL9STDLIBS:^"-l") \
4859		$(SHL9LINKRES) \
4860		$(SHL9STDSHL:^"-l") $(STDSHL9:^"-l")
4861
4862.ELSE			# "$(USE_DEFFILE)"!=""
4863
4864	$(COMMAND_ECHO)$(SHL9LINKER) -v 	$(SHL9LINKFLAGS)			\
4865		$(LINKFLAGSSHL) $(SHL9BASEX)		\
4866		$(SHL9STACK) -o $(SHL9TARGETN)	\
4867		$(SHL9DEF) \
4868		$(STDOBJ)							\
4869		-L$(LB) \
4870		-L$(SOLARVERSION)/$(INPATH)/lib \
4871		$(SHL9OBJS) $(SHL9VERSIONOBJ) \
4872		$(SHL9LIBS) \
4873		$(SHL9STDLIBS:^"-l") \
4874		$(SHL9LINKRES) \
4875		$(SHL9STDSHL:^"-l") $(STDSHL9:^"-l")                           \
4876	@$(LS) $@ >& $(NULLDEV)
4877
4878.ENDIF			# "$(USE_DEFFILE)"!=""
4879
4880.IF "$(SHL9TARGET8)" != "$(SHL9TARGET)"
4881	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL9TARGET8).dll
4882.ENDIF
4883
4884.ENDIF			# "$(GUI)" == "OS2"
4885
4886.ENDIF			# "$(SHL9TARGETN)"!=""
4887
4888# unroll begin
4889
4890.IF "$(SHL10TARGETN)"!=""
4891
4892.IF "$(OS)"=="AIX"
4893SHL10STDLIBS=
4894.ENDIF
4895
4896.IF "$(SHLLINKARCONLY)" != ""
4897SHL10STDLIBS=
4898STDSHL=
4899.ELSE
4900SHL10ARCHIVES=
4901.ENDIF
4902
4903# decide how to link
4904.IF "$(SHL10CODETYPE)"=="C"
4905SHL10LINKER=$(LINKC)
4906SHL10STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
4907SHL10LINKFLAGS+=$(LINKCFLAGS)
4908.ELSE			# "$(SHL10CODETYPE)"=="C"
4909SHL10LINKER=$(LINK)
4910SHL10STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
4911SHL10LINKFLAGS+=$(LINKFLAGS)
4912.ENDIF			# "$(SHL10CODETYPE)"=="C"
4913
4914SHL10RPATH*=OOO
4915LINKFLAGSRUNPATH_$(SHL10RPATH)*=/ERROR:/Bad_SHL10RPATH_value
4916SHL10LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL10RPATH))
4917
4918.IF "$(SHL10USE_EXPORTS)"==""
4919SHL10DEF*=$(MISC)/$(SHL10TARGET).def
4920.ENDIF			# "$(SHL10USE_EXPORTS)"==""
4921
4922EXTRALIBPATHS10=$(EXTRALIBPATHS)
4923.IF "$(UPDATER)"=="YES"
4924.IF "$(SHL10NOCHECK)"==""
4925.IF "$(SOLAR_STLLIBPATH)"!=""
4926EXTRALIBPATHS10+=-L$(SOLAR_STLLIBPATH)
4927.ENDIF
4928.ENDIF				# "$(SHL10NOCHECK)"!=""
4929.ENDIF
4930#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4931#+++++++++++    version object      ++++++++++++++++++++++++++++++++++++++++
4932#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4933
4934.IF "$(L10N_framework)"==""
4935.IF "$(VERSIONOBJ)"!=""
4936SHL10VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL10TARGET))}$(VERSIONOBJ:f)
4937USE_VERSIONH:=$(INCCOM)/$(SHL10VERSIONOBJ:b).h
4938.IF "$(GUI)" == "UNX"
4939SHL10VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL10TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
4940.ELSE           # "$(GUI)" == "UNX"
4941SHL10VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL10TARGET))}$(VERSIONOBJ:f)
4942.ENDIF          # "$(GUI)" == "UNX"
4943$(MISC)/$(SHL10VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL10VERSIONOBJ:b).h
4944#    $(COPY) $(SOLARENV)/src/version.c $@
4945	$(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL10VERSIONOBJ:b).h/ > $@
4946
4947.INIT : $(SHL10VERSIONOBJDEP)
4948.ENDIF			# "$(VERSIONOBJ)"!=""
4949.ENDIF
4950
4951.IF "$(GUI)" != "UNX"
4952.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
4953.IF "$(SHL10IMPLIB)" == ""
4954SHL10IMPLIB=i$(TARGET)_t10
4955.ENDIF			# "$(SHL10IMPLIB)" == ""
4956.IF "$(COM)" != "GCC"
4957USE_10IMPLIB=-implib:$(LB)/$(SHL10IMPLIB).lib
4958.ENDIF			# "$(COM)" != "GCC"
4959SHL10IMPLIBN=$(LB)/$(SHL10IMPLIB).lib
4960ALLTAR : $(SHL10IMPLIBN)
4961
4962.IF "$(USE_DEFFILE)"==""
4963USE_10IMPLIB_DEPS=$(LB)/$(SHL10IMPLIB).lib
4964.ENDIF			# "$(USE_DEFFILE)"==""
4965.ENDIF			# "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
4966USE_SHL10DEF=$(SHL10DEF)
4967.ELSE			# "$(GUI)" != "UNX"
4968USE_SHL10DEF=
4969SHL10DEPN+:=$(SHL10DEPNU)
4970
4971.IF "$(SHL10VERSIONMAP)"==""
4972# to activate vmaps remove "#"
4973USE_SHL10VERSIONMAP=$(MISC)/$(SHL10TARGET).vmap
4974.ENDIF			# "$(SHL10VERSIONMAP)"==""
4975
4976.IF "$(USE_SHL10VERSIONMAP)"!=""
4977
4978.IF "$(SHL10FILTERFILE)"!=""
4979.IF "$(SHL10VERSIONMAP)"!=""
4980#eine von beiden ist zuviel
4981USE_SHL10VERSIONMAP=$(MISC)/$(SHL10TARGET).vmap
4982$(USE_SHL10VERSIONMAP) .PHONY:
4983	@echo -----------------------------
4984	@echo you should only use versionmap OR exportfile
4985	@echo -----------------------------
4986#	force_dmake_to_error
4987
4988.ENDIF			# "$(SHL10VERSIONMAP)"!=""
4989
4990SHL10VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL10VERSIONMAP)
4991
4992$(USE_SHL10VERSIONMAP): \
4993					$(SHL10OBJS)\
4994					$(SHL10LIBS)\
4995					$(SHL10FILTERFILE)
4996	@$(RM) $@.dump
4997.IF "$(SHL10OBJS)"!=""
4998# dump remaining objects on the fly
4999.IF "$(OS)"=="MACOSX"
5000	@-nm $(SHL10OBJS:s/.obj/.o/) > $@.dump
5001.ELSE
5002	@nm $(SHL10OBJS:s/.obj/.o/) > $@.dump
5003.ENDIF
5004.ENDIF			# "$(SHL10OBJS)!"=""
5005	@$(TYPE) /dev/null $(SHL10LIBS:s/.lib/.dump/) >> $@.dump
5006	$(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL10INTERFACE) -f $(SHL10FILTERFILE) -m $@
5007
5008.ELSE			# "$(SHL10FILTERFILE)"!=""
5009USE_SHL10VERSIONMAP=$(MISC)/$(SHL10TARGET).vmap
5010$(USE_SHL10VERSIONMAP) :
5011.IF "$(VERBOSE)" == "TRUE"
5012	@echo -----------------------------
5013	@echo SHL10FILTERFILE not set!
5014	@echo -----------------------------
5015	@$(TOUCH) $@
5016	@echo dummy file to keep the dependencies for later use.
5017.ELSE
5018	@$(TOUCH) $@
5019.ENDIF
5020#	force_dmake_to_error
5021.ENDIF			# "$(SHL10FILTERFILE)"!=""
5022.ELSE			# "$(USE_SHL10VERSIONMAP)"!=""
5023
5024#and now for the plain non-generic way...
5025.IF "$(SHL10VERSIONMAP)"!=""
5026USE_SHL10VERSIONMAP=$(MISC)/$(SHL10VERSIONMAP:b)_$(SHL10TARGET)$(SHL10VERSIONMAP:e)
5027SHL10VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL10VERSIONMAP)
5028
5029.IF "$(OS)"=="MACOSX"
5030$(USE_SHL10VERSIONMAP): $(SHL10OBJS) $(SHL10LIBS)
5031.ENDIF
5032
5033# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
5034# even if the $(AWK) part fails:
5035$(USE_SHL10VERSIONMAP) .ERRREMOVE: $(SHL10VERSIONMAP)
5036	@@-$(RM) -f $@
5037# The following files will only be generated and needed on Mac OS X as temporary files
5038# in order to generate exported symbols list out of Linux/Solaris map files
5039.IF "$(OS)"=="MACOSX"
5040	@-$(RM) -f $@.symregexp >& $(NULLDEV)
5041	@-$(RM) -f $@.expsymlist >& $(NULLDEV)
5042.ENDIF
5043# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
5044# happens if somebody will change it in the future
5045.IF "$(COMID)"=="gcc3"
5046	$(COMMAND_ECHO) tr -d "\015" < $(SHL10VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
5047.ELIF "$(COMNAME)"=="sunpro5"
5048	$(COMMAND_ECHO) tr -d "\015" < $(SHL10VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
5049.ELSE           # "$(COMID)"=="gcc3"
5050	$(COMMAND_ECHO) tr -d "\015" < $(SHL10VERSIONMAP) > $@
5051.ENDIF          # "$(COMID)"=="gcc3"
5052	@chmod a+w $@
5053# Mac OS X post-processing generate an exported symbols list from the generated map file
5054# for details on exported symbols list see man ld on Mac OS X
5055.IF "$(OS)"=="MACOSX"
5056	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
5057	@-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
5058# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
5059# Extract RTTI symbols from all the objects that will be used to build a shared library
5060.IF "$(SHL10OBJS)"!=""
5061	-echo $(foreach,i,$(SHL10OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
5062.ENDIF
5063.IF "$(SHL10LIBS)"!=""
5064	$(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL10LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
5065.ENDIF
5066# overwrite the map file generate into the local output tree with the generated
5067# exported symbols list
5068	cp $@.exported-symbols $@
5069.ENDIF # .IF "$(OS)"=="MACOSX"
5070.ENDIF			# "$(SHL10VERSIONMAP)"!=""
5071.ENDIF			# "$(USE_SHL10VERSIONMAP)"!=""
5072.ENDIF			# "$(GUI)" != "UNX"
5073
5074.IF "$(UNIXVERSIONNAMES)"!=""
5075.IF "$(OS)"!="MACOSX"
5076.IF "$(GUI)"=="UNX"
5077SHL10SONAME=\"$(SONAME_SWITCH)$(SHL10TARGETN:f)\"
5078.ENDIF			# "$(GUI)"!="UNX"
5079.ENDIF			# "$(OS)"!="MACOSX"
5080.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
5081
5082.IF "$(SHL10RES)"!=""
5083SHL10ALLRES+=$(SHL10RES)
5084SHL10LINKRES*=$(MISC)/$(SHL10TARGET).res
5085SHL10LINKRESO*=$(MISC)/$(SHL10TARGET)_res.o
5086.ENDIF			# "$(SHL10RES)"!=""
5087
5088.IF "$(SHL10DEFAULTRES)$(use_shl_versions)"!=""
5089SHL10DEFAULTRES*=$(MISC)/$(SHL10TARGET)_def.res
5090SHL10ALLRES+=$(SHL10DEFAULTRES)
5091SHL10LINKRES*=$(MISC)/$(SHL10TARGET).res
5092SHL10LINKRESO*=$(MISC)/$(SHL10TARGET)_res.o
5093.ENDIF			# "$(SHL10DEFAULTRES)$(use_shl_versions)"!=""
5094
5095#.IF "$(SHL10TARGETN)"!=""
5096
5097.IF "$(linkinc)"!=""
5098.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
5099.IF "$(SHL10LIBS)"!=""
5100$(MISC)/$(SHL10TARGET)_linkinc.ls .PHONY:
5101	@@-$(RM) $@
5102	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL10LIBS) $(i:s/.lib/.lin/)) >> $@
5103.ENDIF          # "$(SHL10LIBS)"!=""
5104.ENDIF
5105
5106LINKINCTARGETS+=$(MISC)/$(SHL10TARGETN:b)_linkinc.ls
5107$(SHL10TARGETN) : $(LINKINCTARGETS)
5108
5109.ELSE
5110.IF "$(SHL10USE_EXPORTS)"=="name"
5111.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
5112.IF "$(COM)"!="GCC"
5113.IF "$(SHL10LIBS)"!=""
5114SHL10LINKLIST=$(MISC)/$(SHL10TARGET)_link.lst
5115SHL10LINKLISTPARAM=@$(SHL10LINKLIST)
5116$(SHL10LINKLIST) : $(SHL10LIBS)
5117    @@-$(RM) $@
5118	$(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL10LIBS) $(i:s/.lib/.lin/)) >> $@
5119.ENDIF          # "$(SHL10LIBS)"!=""
5120.ENDIF          # "$(COM)"!="GCC"
5121.ENDIF
5122.ENDIF			# "$(SHL10USE_EXPORTS)"=="name"
5123
5124$(MISC)/%linkinc.ls:
5125	@echo . > $@
5126.ENDIF          # "$(linkinc)"!=""
5127
5128.IF "$(GUI)" == "OS2"
5129#21/02/2006 YD dll names must be 8.3, invoke fix script
5130#check osl/os2/module.c/osl_loadModule()
5131SHL10TARGET8=$(shell @fix_shl $(SHL10TARGET))
5132.ENDIF
5133
5134.IF "$(GUI)" == "OS2"
5135_SHL10IMP_ORD = $(SHL10STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL10STDLIBS:^"$(LB)/")
5136SHL10IMP_ORD = $(foreach,i,$(_SHL10IMP_ORD) $(shell @-ls $i))
5137.ELSE
5138SHL10IMP_ORD =
5139.ENDIF
5140
5141
5142$(SHL10TARGETN) : \
5143					$(SHL10OBJS)\
5144					$(SHL10LIBS)\
5145					$(USE_10IMPLIB_DEPS)\
5146					$(USE_SHL10DEF)\
5147					$(USE_SHL10VERSIONMAP)\
5148					$(SHL10RES)\
5149					$(SHL10DEPN) \
5150					$(SHL10IMP_ORD) \
5151					$(SHL10LINKLIST)
5152	@echo "Making:   " $(@:f)
5153.IF "$(GUI)" == "WNT"
5154.IF "$(SHL10DEFAULTRES)"!=""
5155	@@-$(RM) $(MISC)/$(SHL10DEFAULTRES:b).rc
5156.IF "$(SHL10ICON)" != ""
5157	@echo 1 ICON $(SHL10ICON) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5158.ENDIF
5159.IF "$(use_shl_versions)" != ""
5160.IF "$(SHL10ADD_VERINFO)"!=""
5161	@echo $(EMQ)#include $(EMQ)"$(SHL10ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5162.ELSE			# "$(SHL10ADD_VERINFO)"!=""
5163	@echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5164	@echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5165	@echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5166.ENDIF			# "$(SHL10ADD_VERINFO)"!=""
5167	@echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5168	@echo $(EMQ)#define ORG_NAME	$(SHL10TARGET)$(DLLPOST) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5169	@echo $(EMQ)#define INTERNAL_NAME $(SHL10TARGET:b) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5170	@echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5171.ENDIF			# "$(use_shl_versions)" != ""
5172	$(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL10DEFAULTRES:b).rc
5173.ENDIF			# "$(SHL10DEFAULTRES)"!=""
5174.IF "$(SHL10ALLRES)"!=""
5175	$(COMMAND_ECHO)$(TYPE) $(SHL10ALLRES) > $(SHL10LINKRES)
5176.IF "$(COM)"=="GCC"
5177	windres $(SHL10LINKRES) $(SHL10LINKRESO)
5178.ENDIF			# "$(COM)"=="GCC"
5179.ENDIF			# "$(SHL10ALLRES)"!=""
5180.IF "$(COM)"=="GCC"	# always have to call dlltool explicitly as ld cannot handle # comment in .def
5181	@echo dlltool --dllname $(SHL10TARGET)$(DLLPOST) \
5182		--kill-at \\ > $(MISC)/$(TARGET).$(@:b)_10.cmd
5183	@noop $(assign ALL10OBJLIST:=$(STDOBJ) $(SHL10OBJS) $(SHL10LINKRESO) $(shell $(TYPE) /dev/null $(SHL10LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
5184.IF "$(DEFLIB10NAME)"!=""	# do not have to include objs
5185	@noop $(assign DEF10OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
5186	@noop $(foreach,i,$(DEF10OBJLIST) $(assign ALL10OBJLIST:=$(ALL10OBJLIST:s?$i??)))
5187.ENDIF			# "$(DEFLIB10NAME)"!=""
5188	@echo	--output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
5189.IF "$(SHL10DEF)"!=""
5190	@echo	--input-def $(SHL10DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
5191.ELSE
5192	@echo	$(SHL10VERSIONOBJ) $(SHL10DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
5193.ENDIF
5194	@echo	$(ALL10OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_10.cmd
5195	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
5196		$(STDOBJ) $(SHL10VERSIONOBJ) $(SHL10DESCRIPTIONOBJ) $(SHL10OBJS) $(SHL10LINKRESO) \
5197		`$(TYPE) /dev/null $(SHL10LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
5198		-Wl,--exclude-libs,ALL,--start-group $(SHL10STDLIBS) -Wl,--end-group \
5199		$(SHL10STDSHL) $(STDSHL10) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
5200		-Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_10.cmd
5201  .IF "$(VERBOSE)" == "TRUE"
5202	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_10.cmd
5203  .ENDIF
5204	@+source $(MISC)/$(TARGET).$(@:b)_10.cmd
5205.ELSE
5206.IF "$(linkinc)"==""
5207.IF "$(SHL10USE_EXPORTS)"!="name"
5208.IF "$(USE_DEFFILE)"!=""
5209	$(COMMAND_ECHO)$(SHL10LINKER) @$(mktmp \
5210		$(SHL10LINKFLAGS) \
5211		$(LINKFLAGSSHL) \
5212		$(SHL10STACK) $(SHL10BASEX)	\
5213		-out:$@ \
5214		-map:$(MISC)/$(@:b).map \
5215		-def:$(SHL10DEF) \
5216		$(USE_10IMPLIB) \
5217		$(STDOBJ) \
5218		$(SHL10VERSIONOBJ) $(SHL10OBJS) \
5219		$(SHL10LIBS) \
5220		$(SHL10STDLIBS) \
5221		$(SHL10STDSHL) $(STDSHL10) \
5222		$(SHL10LINKRES) \
5223	)
5224# double check if target was really written... still making sense?
5225    @@$(LS) $@
5226	@echo linking $@.manifest ...
5227.IF "$(VISTA_MANIFEST)"!=""
5228	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
5229	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
5230.ELSE
5231	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
5232.ENDIF # "$(VISTA_MANIFEST)"!=""
5233	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
5234	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
5235.ELSE			# "$(USE_DEFFILE)"!=""
5236	$(COMMAND_ECHO)$(SHL10LINKER) @$(mktmp	$(SHL10LINKFLAGS)			\
5237		$(LINKFLAGSSHL) $(SHL10BASEX)		\
5238		$(SHL10STACK) -out:$(SHL10TARGETN)	\
5239		-map:$(MISC)/$(@:B).map				\
5240		$(LB)/$(SHL10IMPLIB).exp				\
5241		$(STDOBJ)							\
5242		$(SHL10OBJS) $(SHL10VERSIONOBJ) \
5243		$(SHL10LIBS)                         \
5244		$(SHL10STDLIBS)                      \
5245		$(SHL10STDSHL) $(STDSHL10)                           \
5246		$(SHL10LINKRES) \
5247	)
5248# double check if target was really written... still making sense?
5249    @@$(LS) $@
5250	@echo linking $@.manifest ...
5251.IF "$(VISTA_MANIFEST)"!=""
5252	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
5253	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
5254.ELSE
5255	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
5256.ENDIF # "$(VISTA_MANIFEST)"!=""
5257	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
5258	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
5259.ENDIF			# "$(USE_DEFFILE)"!=""
5260.ELSE			# "$(SHL10USE_EXPORTS)"!="name"
5261	$(COMMAND_ECHO)$(SHL10LINKER) @$(mktmp	$(SHL10LINKFLAGS)			\
5262		$(LINKFLAGSSHL) $(SHL10BASEX)		\
5263		$(SHL10STACK) -out:$(SHL10TARGETN)	\
5264		-map:$(MISC)/$(@:B).map				\
5265		$(USE_10IMPLIB) \
5266		$(STDOBJ)							\
5267		$(SHL10OBJS) $(SHL10VERSIONOBJ))   \
5268		$(SHL10LINKLISTPARAM) \
5269		@$(mktmp $(SHL10STDLIBS)                      \
5270		$(SHL10STDSHL) $(STDSHL10)                           \
5271		$(SHL10LINKRES) \
5272	)
5273	@echo linking $@.manifest ...
5274.IF "$(VISTA_MANIFEST)"!=""
5275	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
5276	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
5277.ELSE
5278	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
5279.ENDIF # "$(VISTA_MANIFEST)"!=""
5280	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
5281	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
5282.ENDIF			# "$(SHL10USE_EXPORTS)"!="name"
5283.ELSE			# "$(linkinc)"==""
5284		$(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL10TARGET).lnk
5285		$(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL10TARGET).lst
5286		$(COMMAND_ECHO)$(TYPE) $(mktmp \
5287		$(SHL10LINKFLAGS) \
5288		$(LINKFLAGSSHL) $(SHL10BASEX) \
5289		$(SHL10STACK) $(MAPFILE) \
5290		-out:$@ \
5291		$(LB)/$(SHL10IMPLIB).exp \
5292		$(STDOBJ) \
5293		$(SHL10OBJS) \
5294		$(SHL10STDLIBS) \
5295		$(SHL10STDSHL) $(STDSHL10) \
5296		$(SHL10LINKRES) \
5297		) >> $(MISC)/$(SHL10TARGET).lnk
5298		$(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL10TARGETN:b)_linkinc.ls  >> $(MISC)/$(SHL10TARGET).lnk
5299		$(COMMAND_ECHO)$(SHL10LINKER) @$(MISC)/$(SHL10TARGET).lnk
5300		@echo linking $@.manifest ...
5301.IF "$(VISTA_MANIFEST)"!=""
5302		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
5303		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
5304.ELSE
5305		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
5306.ENDIF # "$(VISTA_MANIFEST)"!=""
5307		$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
5308		$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
5309.ENDIF			# "$(linkinc)"==""
5310.ENDIF			# "$(COM)"=="GCC"
5311.ENDIF			# "$(GUI)" == "WNT"
5312.IF "$(GUI)"=="UNX"
5313.IF "$(OS)"=="MACOSX"
5314	@-$(RM) $(MISC)/$(@:b).list
5315	@-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
5316	@echo $(STDSLO) $(SHL10OBJS:s/.obj/.o/) \
5317	$(SHL10VERSIONOBJ) \
5318	`cat /dev/null $(SHL10LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
5319	@echo -n $(SHL10LINKER) $(SHL10LINKFLAGS) $(SHL10VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
5320	$(SHL10STDLIBS) $(SHL10ARCHIVES) $(SHL10STDSHL) $(STDSHL10) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_10.cmd
5321    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
5322        `cat $(MISC)/$(TARGET).$(@:b)_10.cmd` \
5323        >> $(MISC)/$(TARGET).$(@:b)_10.cmd
5324  .IF "$(VERBOSE)" == "TRUE"
5325	@cat $(MISC)/$(TARGET).$(@:b)_10.cmd
5326  .ENDIF
5327	@+source $(MISC)/$(TARGET).$(@:b)_10.cmd
5328    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
5329        shl $(SHL10RPATH) $@
5330.IF "$(SHL10CREATEJNILIB)"!=""
5331	@echo "Making:   " $(@:f).jnilib
5332	@macosx-create-bundle $@
5333.ENDIF          # "$(SHL10CREATEJNILIB)"!=""
5334.IF "$(UPDATER)"=="YES"
5335.IF "$(SHL10NOCHECK)"==""
5336	$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN)
5337.ENDIF				# "$(SHL10NOCHECK)"!=""
5338.ENDIF
5339.ELSE			# "$(OS)"=="MACOSX"
5340	@-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
5341	@echo $(SHL10LINKER) $(SHL10LINKFLAGS) $(SHL10SONAME) $(LINKFLAGSSHL) $(SHL10VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL10OBJS:s/.obj/.o/) \
5342	$(SHL10VERSIONOBJ) -o $@ \
5343	`cat /dev/null $(SHL10LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
5344	$(SHL10STDLIBS) $(SHL10ARCHIVES) $(SHL10STDSHL) $(STDSHL10) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_10.cmd
5345  .IF "$(VERBOSE)" == "TRUE"
5346	@cat $(MISC)/$(TARGET).$(@:b)_10.cmd
5347  .ENDIF
5348	@+source $(MISC)/$(TARGET).$(@:b)_10.cmd
5349.IF "$(UPDATER)"=="YES"
5350.IF "$(SHL10NOCHECK)"==""
5351	$(COMMAND_ECHO)-$(RM) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
5352	$(COMMAND_ECHO)$(RENAME) $(SHL10TARGETN) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
5353.IF "$(VERBOSE)"=="TRUE"
5354	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
5355.ELSE
5356	$(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) -- -s $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
5357.ENDIF
5358.ENDIF				# "$(SHL10NOCHECK)"!=""
5359.ENDIF			# "$(UPDATER)"=="YES"
5360.ENDIF			# "$(OS)"=="MACOSX"
5361.IF "$(UNIXVERSIONNAMES)"!=""
5362	$(COMMAND_ECHO)$(RM) $(LB)/$(SHL10TARGETN:b)
5363	$(COMMAND_ECHO)cd $(LB) && ln -s $(SHL10TARGETN:f) $(SHL10TARGETN:b)
5364.ENDIF			# "$(UNIXVERSIONNAMES)"!=""
5365.IF "$(VERBOSE)" == "TRUE"
5366	@ls -l $@
5367.ENDIF
5368.ENDIF			# "$(GUI)" == "UNX"
5369
5370.IF "$(GUI)" == "OS2"
5371
5372.IF "$(SHL10DEFAULTRES)"!=""
5373	@+-$(RM) $(MISC)/$(SHL10DEFAULTRES:b).rc >& $(NULLDEV)
5374.IF "$(SHL10ICON)" != ""
5375	@-+echo 1 ICON $(SHL10ICON) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5376.ENDIF
5377.IF "$(use_shl_versions)" != ""
5378.IF "$(SHL10ADD_VERINFO)"!=""
5379	@-+echo $(EMQ)#include $(EMQ)"$(SHL10ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5380.ENDIF			# "$(SHL10ADD_VERINFO)"!=""
5381	@-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5382#	@-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
5383.ENDIF			# "$(use_shl_versions)" != ""
5384# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
5385	$(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL10DEFAULTRES:b).rc
5386.ENDIF			# "$(SHL10DEFAULTRES)"!=""
5387
5388.IF "$(SHL10ALLRES)"!=""
5389	$(COMMAND_ECHO)+$(TYPE) $(SHL10ALLRES) > $(SHL10LINKRES)
5390.ENDIF			# "$(SHL10ALLRES)"!=""
5391
5392.IF "$(USE_DEFFILE)"!=""
5393
5394	$(COMMAND_ECHO)$(SHL10LINKER) $(SHL10LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
5395		$(SHL10DEF) \
5396		$(STDOBJ) \
5397		-L$(LB) \
5398		-L$(SOLARVERSION)/$(INPATH)/lib \
5399		$(SHL10OBJS) $(SHL10VERSIONOBJ) \
5400		$(SHL10LIBS) \
5401		$(SHL10STDLIBS:^"-l") \
5402		$(SHL10LINKRES) \
5403		$(SHL10STDSHL:^"-l") $(STDSHL10:^"-l")
5404
5405.ELSE			# "$(USE_DEFFILE)"!=""
5406
5407	$(COMMAND_ECHO)$(SHL10LINKER) -v 	$(SHL10LINKFLAGS)			\
5408		$(LINKFLAGSSHL) $(SHL10BASEX)		\
5409		$(SHL10STACK) -o $(SHL10TARGETN)	\
5410		$(SHL10DEF) \
5411		$(STDOBJ)							\
5412		-L$(LB) \
5413		-L$(SOLARVERSION)/$(INPATH)/lib \
5414		$(SHL10OBJS) $(SHL10VERSIONOBJ) \
5415		$(SHL10LIBS) \
5416		$(SHL10STDLIBS:^"-l") \
5417		$(SHL10LINKRES) \
5418		$(SHL10STDSHL:^"-l") $(STDSHL10:^"-l")                           \
5419	@$(LS) $@ >& $(NULLDEV)
5420
5421.ENDIF			# "$(USE_DEFFILE)"!=""
5422
5423.IF "$(SHL10TARGET8)" != "$(SHL10TARGET)"
5424	$(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL10TARGET8).dll
5425.ENDIF
5426
5427.ENDIF			# "$(GUI)" == "OS2"
5428
5429.ENDIF			# "$(SHL10TARGETN)"!=""
5430
5431# unroll begin
5432
5433.IF "$(SHL1IMPLIBN)" != ""
5434
5435.IF "$(UPDATER)"=="YES"
5436USELIB1DEPN+=$(SHL1LIBS)
5437.ELSE
5438.ENDIF
5439
5440.IF "$(USE_DEFFILE)"!=""
5441USE_SHL1TARGET=$(SHL1TARGETN)
5442.ENDIF
5443
5444.IF "$(GUI)" != "UNX"
5445$(SHL1IMPLIBN):	\
5446					$(SHL1DEF) \
5447					$(USE_SHL1TARGET) \
5448					$(USELIB1DEPN) \
5449					$(USELIBDEPN)
5450.ELSE
5451$(SHL1IMPLIBN):	\
5452					$(SHL1LIBS)
5453.ENDIF
5454	@echo "Making:   " $(@:f)
5455.IF "$(GUI)" == "WNT"
5456.IF "$(COM)"=="GCC"
5457	@echo no ImportLibs on mingw
5458	@-$(RM) $@
5459	@$(TOUCH) $@
5460.ELSE			# "$(COM)=="GCC"
5461# bei use_deffile implib von linker erstellt
5462.IF "$(USE_DEFFILE)"==""
5463	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL1IMPLIBN) \
5464	-def:$(SHL1DEF) )
5465.ELSE			# "$(USE_DEFFILE)==""
5466	@echo build of $(SHL1TARGETN) creates $@
5467	@$(TOUCH) $@
5468.ENDIF			# "$(USE_DEFFILE)==""
5469.ENDIF			# "$(COM)"=="GCC"
5470
5471.ELIF "$(GUI)" == "OS2"
5472
5473# touch creates an empty file, but this is not good for emxomfar, so
5474# create a dummy lib here
5475	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL1VERSIONOBJ)
5476	+@echo build of $(SHL1TARGETN) creates $@
5477
5478.ELSE
5479	@echo no ImportLibs on Mac and *ix
5480	@-$(RM) $@
5481	@$(TOUCH) $@
5482.ENDIF
5483.ENDIF
5484
5485# unroll begin
5486
5487.IF "$(SHL2IMPLIBN)" != ""
5488
5489.IF "$(UPDATER)"=="YES"
5490USELIB2DEPN+=$(SHL2LIBS)
5491.ELSE
5492.ENDIF
5493
5494.IF "$(USE_DEFFILE)"!=""
5495USE_SHL2TARGET=$(SHL2TARGETN)
5496.ENDIF
5497
5498.IF "$(GUI)" != "UNX"
5499$(SHL2IMPLIBN):	\
5500					$(SHL2DEF) \
5501					$(USE_SHL2TARGET) \
5502					$(USELIB2DEPN) \
5503					$(USELIBDEPN)
5504.ELSE
5505$(SHL2IMPLIBN):	\
5506					$(SHL2LIBS)
5507.ENDIF
5508	@echo "Making:   " $(@:f)
5509.IF "$(GUI)" == "WNT"
5510.IF "$(COM)"=="GCC"
5511	@echo no ImportLibs on mingw
5512	@-$(RM) $@
5513	@$(TOUCH) $@
5514.ELSE			# "$(COM)=="GCC"
5515# bei use_deffile implib von linker erstellt
5516.IF "$(USE_DEFFILE)"==""
5517	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL2IMPLIBN) \
5518	-def:$(SHL2DEF) )
5519.ELSE			# "$(USE_DEFFILE)==""
5520	@echo build of $(SHL2TARGETN) creates $@
5521	@$(TOUCH) $@
5522.ENDIF			# "$(USE_DEFFILE)==""
5523.ENDIF			# "$(COM)"=="GCC"
5524
5525.ELIF "$(GUI)" == "OS2"
5526
5527# touch creates an empty file, but this is not good for emxomfar, so
5528# create a dummy lib here
5529	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL2VERSIONOBJ)
5530	+@echo build of $(SHL2TARGETN) creates $@
5531
5532.ELSE
5533	@echo no ImportLibs on Mac and *ix
5534	@-$(RM) $@
5535	@$(TOUCH) $@
5536.ENDIF
5537.ENDIF
5538
5539# unroll begin
5540
5541.IF "$(SHL3IMPLIBN)" != ""
5542
5543.IF "$(UPDATER)"=="YES"
5544USELIB3DEPN+=$(SHL3LIBS)
5545.ELSE
5546.ENDIF
5547
5548.IF "$(USE_DEFFILE)"!=""
5549USE_SHL3TARGET=$(SHL3TARGETN)
5550.ENDIF
5551
5552.IF "$(GUI)" != "UNX"
5553$(SHL3IMPLIBN):	\
5554					$(SHL3DEF) \
5555					$(USE_SHL3TARGET) \
5556					$(USELIB3DEPN) \
5557					$(USELIBDEPN)
5558.ELSE
5559$(SHL3IMPLIBN):	\
5560					$(SHL3LIBS)
5561.ENDIF
5562	@echo "Making:   " $(@:f)
5563.IF "$(GUI)" == "WNT"
5564.IF "$(COM)"=="GCC"
5565	@echo no ImportLibs on mingw
5566	@-$(RM) $@
5567	@$(TOUCH) $@
5568.ELSE			# "$(COM)=="GCC"
5569# bei use_deffile implib von linker erstellt
5570.IF "$(USE_DEFFILE)"==""
5571	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL3IMPLIBN) \
5572	-def:$(SHL3DEF) )
5573.ELSE			# "$(USE_DEFFILE)==""
5574	@echo build of $(SHL3TARGETN) creates $@
5575	@$(TOUCH) $@
5576.ENDIF			# "$(USE_DEFFILE)==""
5577.ENDIF			# "$(COM)"=="GCC"
5578
5579.ELIF "$(GUI)" == "OS2"
5580
5581# touch creates an empty file, but this is not good for emxomfar, so
5582# create a dummy lib here
5583	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL3VERSIONOBJ)
5584	+@echo build of $(SHL3TARGETN) creates $@
5585
5586.ELSE
5587	@echo no ImportLibs on Mac and *ix
5588	@-$(RM) $@
5589	@$(TOUCH) $@
5590.ENDIF
5591.ENDIF
5592
5593# unroll begin
5594
5595.IF "$(SHL4IMPLIBN)" != ""
5596
5597.IF "$(UPDATER)"=="YES"
5598USELIB4DEPN+=$(SHL4LIBS)
5599.ELSE
5600.ENDIF
5601
5602.IF "$(USE_DEFFILE)"!=""
5603USE_SHL4TARGET=$(SHL4TARGETN)
5604.ENDIF
5605
5606.IF "$(GUI)" != "UNX"
5607$(SHL4IMPLIBN):	\
5608					$(SHL4DEF) \
5609					$(USE_SHL4TARGET) \
5610					$(USELIB4DEPN) \
5611					$(USELIBDEPN)
5612.ELSE
5613$(SHL4IMPLIBN):	\
5614					$(SHL4LIBS)
5615.ENDIF
5616	@echo "Making:   " $(@:f)
5617.IF "$(GUI)" == "WNT"
5618.IF "$(COM)"=="GCC"
5619	@echo no ImportLibs on mingw
5620	@-$(RM) $@
5621	@$(TOUCH) $@
5622.ELSE			# "$(COM)=="GCC"
5623# bei use_deffile implib von linker erstellt
5624.IF "$(USE_DEFFILE)"==""
5625	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL4IMPLIBN) \
5626	-def:$(SHL4DEF) )
5627.ELSE			# "$(USE_DEFFILE)==""
5628	@echo build of $(SHL4TARGETN) creates $@
5629	@$(TOUCH) $@
5630.ENDIF			# "$(USE_DEFFILE)==""
5631.ENDIF			# "$(COM)"=="GCC"
5632
5633.ELIF "$(GUI)" == "OS2"
5634
5635# touch creates an empty file, but this is not good for emxomfar, so
5636# create a dummy lib here
5637	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL4VERSIONOBJ)
5638	+@echo build of $(SHL4TARGETN) creates $@
5639
5640.ELSE
5641	@echo no ImportLibs on Mac and *ix
5642	@-$(RM) $@
5643	@$(TOUCH) $@
5644.ENDIF
5645.ENDIF
5646
5647# unroll begin
5648
5649.IF "$(SHL5IMPLIBN)" != ""
5650
5651.IF "$(UPDATER)"=="YES"
5652USELIB5DEPN+=$(SHL5LIBS)
5653.ELSE
5654.ENDIF
5655
5656.IF "$(USE_DEFFILE)"!=""
5657USE_SHL5TARGET=$(SHL5TARGETN)
5658.ENDIF
5659
5660.IF "$(GUI)" != "UNX"
5661$(SHL5IMPLIBN):	\
5662					$(SHL5DEF) \
5663					$(USE_SHL5TARGET) \
5664					$(USELIB5DEPN) \
5665					$(USELIBDEPN)
5666.ELSE
5667$(SHL5IMPLIBN):	\
5668					$(SHL5LIBS)
5669.ENDIF
5670	@echo "Making:   " $(@:f)
5671.IF "$(GUI)" == "WNT"
5672.IF "$(COM)"=="GCC"
5673	@echo no ImportLibs on mingw
5674	@-$(RM) $@
5675	@$(TOUCH) $@
5676.ELSE			# "$(COM)=="GCC"
5677# bei use_deffile implib von linker erstellt
5678.IF "$(USE_DEFFILE)"==""
5679	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL5IMPLIBN) \
5680	-def:$(SHL5DEF) )
5681.ELSE			# "$(USE_DEFFILE)==""
5682	@echo build of $(SHL5TARGETN) creates $@
5683	@$(TOUCH) $@
5684.ENDIF			# "$(USE_DEFFILE)==""
5685.ENDIF			# "$(COM)"=="GCC"
5686
5687.ELIF "$(GUI)" == "OS2"
5688
5689# touch creates an empty file, but this is not good for emxomfar, so
5690# create a dummy lib here
5691	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL5VERSIONOBJ)
5692	+@echo build of $(SHL5TARGETN) creates $@
5693
5694.ELSE
5695	@echo no ImportLibs on Mac and *ix
5696	@-$(RM) $@
5697	@$(TOUCH) $@
5698.ENDIF
5699.ENDIF
5700
5701# unroll begin
5702
5703.IF "$(SHL6IMPLIBN)" != ""
5704
5705.IF "$(UPDATER)"=="YES"
5706USELIB6DEPN+=$(SHL6LIBS)
5707.ELSE
5708.ENDIF
5709
5710.IF "$(USE_DEFFILE)"!=""
5711USE_SHL6TARGET=$(SHL6TARGETN)
5712.ENDIF
5713
5714.IF "$(GUI)" != "UNX"
5715$(SHL6IMPLIBN):	\
5716					$(SHL6DEF) \
5717					$(USE_SHL6TARGET) \
5718					$(USELIB6DEPN) \
5719					$(USELIBDEPN)
5720.ELSE
5721$(SHL6IMPLIBN):	\
5722					$(SHL6LIBS)
5723.ENDIF
5724	@echo "Making:   " $(@:f)
5725.IF "$(GUI)" == "WNT"
5726.IF "$(COM)"=="GCC"
5727	@echo no ImportLibs on mingw
5728	@-$(RM) $@
5729	@$(TOUCH) $@
5730.ELSE			# "$(COM)=="GCC"
5731# bei use_deffile implib von linker erstellt
5732.IF "$(USE_DEFFILE)"==""
5733	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL6IMPLIBN) \
5734	-def:$(SHL6DEF) )
5735.ELSE			# "$(USE_DEFFILE)==""
5736	@echo build of $(SHL6TARGETN) creates $@
5737	@$(TOUCH) $@
5738.ENDIF			# "$(USE_DEFFILE)==""
5739.ENDIF			# "$(COM)"=="GCC"
5740
5741.ELIF "$(GUI)" == "OS2"
5742
5743# touch creates an empty file, but this is not good for emxomfar, so
5744# create a dummy lib here
5745	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL6VERSIONOBJ)
5746	+@echo build of $(SHL6TARGETN) creates $@
5747
5748.ELSE
5749	@echo no ImportLibs on Mac and *ix
5750	@-$(RM) $@
5751	@$(TOUCH) $@
5752.ENDIF
5753.ENDIF
5754
5755# unroll begin
5756
5757.IF "$(SHL7IMPLIBN)" != ""
5758
5759.IF "$(UPDATER)"=="YES"
5760USELIB7DEPN+=$(SHL7LIBS)
5761.ELSE
5762.ENDIF
5763
5764.IF "$(USE_DEFFILE)"!=""
5765USE_SHL7TARGET=$(SHL7TARGETN)
5766.ENDIF
5767
5768.IF "$(GUI)" != "UNX"
5769$(SHL7IMPLIBN):	\
5770					$(SHL7DEF) \
5771					$(USE_SHL7TARGET) \
5772					$(USELIB7DEPN) \
5773					$(USELIBDEPN)
5774.ELSE
5775$(SHL7IMPLIBN):	\
5776					$(SHL7LIBS)
5777.ENDIF
5778	@echo "Making:   " $(@:f)
5779.IF "$(GUI)" == "WNT"
5780.IF "$(COM)"=="GCC"
5781	@echo no ImportLibs on mingw
5782	@-$(RM) $@
5783	@$(TOUCH) $@
5784.ELSE			# "$(COM)=="GCC"
5785# bei use_deffile implib von linker erstellt
5786.IF "$(USE_DEFFILE)"==""
5787	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL7IMPLIBN) \
5788	-def:$(SHL7DEF) )
5789.ELSE			# "$(USE_DEFFILE)==""
5790	@echo build of $(SHL7TARGETN) creates $@
5791	@$(TOUCH) $@
5792.ENDIF			# "$(USE_DEFFILE)==""
5793.ENDIF			# "$(COM)"=="GCC"
5794
5795.ELIF "$(GUI)" == "OS2"
5796
5797# touch creates an empty file, but this is not good for emxomfar, so
5798# create a dummy lib here
5799	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL7VERSIONOBJ)
5800	+@echo build of $(SHL7TARGETN) creates $@
5801
5802.ELSE
5803	@echo no ImportLibs on Mac and *ix
5804	@-$(RM) $@
5805	@$(TOUCH) $@
5806.ENDIF
5807.ENDIF
5808
5809# unroll begin
5810
5811.IF "$(SHL8IMPLIBN)" != ""
5812
5813.IF "$(UPDATER)"=="YES"
5814USELIB8DEPN+=$(SHL8LIBS)
5815.ELSE
5816.ENDIF
5817
5818.IF "$(USE_DEFFILE)"!=""
5819USE_SHL8TARGET=$(SHL8TARGETN)
5820.ENDIF
5821
5822.IF "$(GUI)" != "UNX"
5823$(SHL8IMPLIBN):	\
5824					$(SHL8DEF) \
5825					$(USE_SHL8TARGET) \
5826					$(USELIB8DEPN) \
5827					$(USELIBDEPN)
5828.ELSE
5829$(SHL8IMPLIBN):	\
5830					$(SHL8LIBS)
5831.ENDIF
5832	@echo "Making:   " $(@:f)
5833.IF "$(GUI)" == "WNT"
5834.IF "$(COM)"=="GCC"
5835	@echo no ImportLibs on mingw
5836	@-$(RM) $@
5837	@$(TOUCH) $@
5838.ELSE			# "$(COM)=="GCC"
5839# bei use_deffile implib von linker erstellt
5840.IF "$(USE_DEFFILE)"==""
5841	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL8IMPLIBN) \
5842	-def:$(SHL8DEF) )
5843.ELSE			# "$(USE_DEFFILE)==""
5844	@echo build of $(SHL8TARGETN) creates $@
5845	@$(TOUCH) $@
5846.ENDIF			# "$(USE_DEFFILE)==""
5847.ENDIF			# "$(COM)"=="GCC"
5848
5849.ELIF "$(GUI)" == "OS2"
5850
5851# touch creates an empty file, but this is not good for emxomfar, so
5852# create a dummy lib here
5853	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL8VERSIONOBJ)
5854	+@echo build of $(SHL8TARGETN) creates $@
5855
5856.ELSE
5857	@echo no ImportLibs on Mac and *ix
5858	@-$(RM) $@
5859	@$(TOUCH) $@
5860.ENDIF
5861.ENDIF
5862
5863# unroll begin
5864
5865.IF "$(SHL9IMPLIBN)" != ""
5866
5867.IF "$(UPDATER)"=="YES"
5868USELIB9DEPN+=$(SHL9LIBS)
5869.ELSE
5870.ENDIF
5871
5872.IF "$(USE_DEFFILE)"!=""
5873USE_SHL9TARGET=$(SHL9TARGETN)
5874.ENDIF
5875
5876.IF "$(GUI)" != "UNX"
5877$(SHL9IMPLIBN):	\
5878					$(SHL9DEF) \
5879					$(USE_SHL9TARGET) \
5880					$(USELIB9DEPN) \
5881					$(USELIBDEPN)
5882.ELSE
5883$(SHL9IMPLIBN):	\
5884					$(SHL9LIBS)
5885.ENDIF
5886	@echo "Making:   " $(@:f)
5887.IF "$(GUI)" == "WNT"
5888.IF "$(COM)"=="GCC"
5889	@echo no ImportLibs on mingw
5890	@-$(RM) $@
5891	@$(TOUCH) $@
5892.ELSE			# "$(COM)=="GCC"
5893# bei use_deffile implib von linker erstellt
5894.IF "$(USE_DEFFILE)"==""
5895	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL9IMPLIBN) \
5896	-def:$(SHL9DEF) )
5897.ELSE			# "$(USE_DEFFILE)==""
5898	@echo build of $(SHL9TARGETN) creates $@
5899	@$(TOUCH) $@
5900.ENDIF			# "$(USE_DEFFILE)==""
5901.ENDIF			# "$(COM)"=="GCC"
5902
5903.ELIF "$(GUI)" == "OS2"
5904
5905# touch creates an empty file, but this is not good for emxomfar, so
5906# create a dummy lib here
5907	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL9VERSIONOBJ)
5908	+@echo build of $(SHL9TARGETN) creates $@
5909
5910.ELSE
5911	@echo no ImportLibs on Mac and *ix
5912	@-$(RM) $@
5913	@$(TOUCH) $@
5914.ENDIF
5915.ENDIF
5916
5917# unroll begin
5918
5919.IF "$(SHL10IMPLIBN)" != ""
5920
5921.IF "$(UPDATER)"=="YES"
5922USELIB10DEPN+=$(SHL10LIBS)
5923.ELSE
5924.ENDIF
5925
5926.IF "$(USE_DEFFILE)"!=""
5927USE_SHL10TARGET=$(SHL10TARGETN)
5928.ENDIF
5929
5930.IF "$(GUI)" != "UNX"
5931$(SHL10IMPLIBN):	\
5932					$(SHL10DEF) \
5933					$(USE_SHL10TARGET) \
5934					$(USELIB10DEPN) \
5935					$(USELIBDEPN)
5936.ELSE
5937$(SHL10IMPLIBN):	\
5938					$(SHL10LIBS)
5939.ENDIF
5940	@echo "Making:   " $(@:f)
5941.IF "$(GUI)" == "WNT"
5942.IF "$(COM)"=="GCC"
5943	@echo no ImportLibs on mingw
5944	@-$(RM) $@
5945	@$(TOUCH) $@
5946.ELSE			# "$(COM)=="GCC"
5947# bei use_deffile implib von linker erstellt
5948.IF "$(USE_DEFFILE)"==""
5949	$(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL10IMPLIBN) \
5950	-def:$(SHL10DEF) )
5951.ELSE			# "$(USE_DEFFILE)==""
5952	@echo build of $(SHL10TARGETN) creates $@
5953	@$(TOUCH) $@
5954.ENDIF			# "$(USE_DEFFILE)==""
5955.ENDIF			# "$(COM)"=="GCC"
5956
5957.ELIF "$(GUI)" == "OS2"
5958
5959# touch creates an empty file, but this is not good for emxomfar, so
5960# create a dummy lib here
5961	$(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL10VERSIONOBJ)
5962	+@echo build of $(SHL10TARGETN) creates $@
5963
5964.ELSE
5965	@echo no ImportLibs on Mac and *ix
5966	@-$(RM) $@
5967	@$(TOUCH) $@
5968.ENDIF
5969.ENDIF
5970
5971