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