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