update dev300-m57
[ooovba.git] / solenv / inc / _tg_app.mk
blob30e7e62b6cfacf89cd7dfc73311a7fbfa3974a14
1 # unroll begin
3 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
4 APP1DEF = $(MISC)$/$(APP1TARGET).def
5 .ENDIF
7 .IF "$(APP1LINKTYPE)" != ""
8 #must be either STATIC or SHARED
9 APP1LINKTYPEFLAG=$(APPLINK$(APP1LINKTYPE))
10 .ENDIF
12 # decide how to link
13 .IF "$(APP1CODETYPE)"=="C"
14 APP1LINKER=$(LINKC)
15 APP1STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
16 APP1LINKFLAGS+=$(LINKCFLAGS)
17 .ELSE # "$(APP1CODETYPE)"=="C"
18 APP1LINKER=$(LINK)
19 APP1STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
20 APP1LINKFLAGS+=$(LINKFLAGS)
21 .ENDIF # "$(APP1CODETYPE)"=="C"
23 APP1RPATH*=OOO
24 LINKFLAGSRUNPATH_$(APP1RPATH)*=/ERROR:/Bad_APP1RPATH_value
25 .IF "$(OS)" != "MACOSX"
26 APP1LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP1RPATH))
27 .ENDIF
29 .IF "$(APP1STACK)" != ""
30 .IF "$(LINKFLAGSTACK)" != ""
31 APP1STACKN=$(LINKFLAGSTACK)$(APP1STACK)
32 .ENDIF
33 .ELSE
34 APP1STACKN=
35 .ENDIF
37 .IF "$(APP1NOSAL)"==""
38 .IF "$(TARGETTYPE)" == "GUI"
39 APP1OBJS+= $(STDOBJVCL)
40 .ENDIF
41 .ENDIF
43 .IF "$(GUI)$(COM)" == "WNTGCC"
44 APP1RESO=
45 .IF "$(APP1LINKRES)" != "" || "$(APP1RES)" != ""
46 APP1RESO=$(MISC)$/$(APP1TARGET:b)_res.o
47 .ENDIF
48 .ENDIF
50 .IF "$(GUI)" == "UNX"
51 APP1DEPN+:=$(APP1DEPNU)
52 USE_APP1DEF=
53 .ENDIF
55 .IF "$(APP1TARGETN)"!=""
57 .IF "$(APP1PRODUCTNAME)"!=""
58 APP1PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP1PRODUCTNAME)\"
59 .ENDIF # "$(APP1PRODUCTNAME)"!=""
61 .IF "$(linkinc)"!=""
62 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
63 .IF "$(APP1LIBS)"!=""
64 $(MISC)$/$(APP1TARGET)_linkinc.ls .PHONY:
65 @@-$(RM) $@
66 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP1LIBS) $(i:s/.lib/.lin/)) >> $@
67 .ENDIF #"$(APP1LIBS)"!=""
68 .ENDIF
70 LINKINCTARGETS+=$(MISC)$/$(APP1TARGETN:b)_linkinc.ls
71 $(APP1TARGETN) : $(LINKINCTARGETS)
72 .ENDIF # "$(linkinc)"!=""
74 # Allow for target specific LIBSALCPPRT override
75 APP1LIBSALCPPRT*=$(LIBSALCPPRT)
77 .IF "$(GUI)" == "OS2"
78 _APP1IMP_ORD = $(APP1STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP1STDLIBS:^"$(LB)$/")
79 APP1IMP_ORD = $(foreach,i,$(_APP1IMP_ORD) $(shell @-ls $i))
80 .ELSE
81 APP1IMP_ORD =
82 .ENDIF
84 $(APP1TARGETN): $(APP1OBJS) $(APP1LIBS) \
85 $(APP1RES) \
86 $(APP1IMP_ORD) \
87 $(APP1ICON) $(APP1DEPN) $(USE_APP1DEF)
88 @echo ------------------------------
89 @echo "Making: " $(@:f)
90 .IF "$(GUI)"=="UNX"
91 .IF "$(OS)"=="MACOSX"
92 @echo unx
93 @-$(RM) $(MISC)$/$(@:b).list
94 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_1.cmd
95 @-$(RM) $(MISC)$/$(@:b).strip
96 @echo $(STDSLO) $(APP1OBJS:s/.obj/.o/) \
97 `cat /dev/null $(APP1LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
98 @echo -n $(APP1LINKER) $(APP1LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
99 $(APP1LINKTYPEFLAG) $(APP1STDLIBS) $(APP1STDLIB) $(STDLIB1) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_1.cmd
100 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
101 `cat $(MISC)$/$(TARGET).$(@:b)_1.cmd` \
102 >> $(MISC)$/$(TARGET).$(@:b)_1.cmd
103 @cat $(MISC)$/$(TARGET).$(@:b)_1.cmd
104 @+source $(MISC)$/$(TARGET).$(@:b)_1.cmd
105 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
106 # libraries at runtime
107 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
108 @strip -i -R $(MISC)$/$(@:b).strip -X $@
109 @ls -l $@
110 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
111 app $(APP1RPATH) $@
112 .IF "$(TARGETTYPE)"=="GUI"
113 @echo "Making: " $(@:f).app
114 @macosx-create-bundle $@
115 .ENDIF # "$(TARGETTYPE)"=="GUI"
116 .ELSE # "$(OS)"=="MACOSX"
117 @echo unx
118 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_1.cmd
119 @echo $(APP1LINKER) $(APP1LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
120 $(APP1OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_1.cmd
121 @cat $(mktmp /dev/null $(APP1LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_1.cmd
122 @echo $(APP1LINKTYPEFLAG) $(APP1LIBSALCPPRT) $(APP1STDLIBS) $(APP1STDLIB) $(STDLIB1) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_1.cmd
123 cat $(MISC)$/$(TARGET).$(@:b)_1.cmd
124 @+source $(MISC)$/$(TARGET).$(@:b)_1.cmd
125 @ls -l $@
126 .ENDIF # "$(OS)"=="MACOSX"
127 .ENDIF
128 .IF "$(GUI)" == "WNT"
129 @@-$(MKDIR) $(@:d:d)
130 .IF "$(APP1LINKRES)" != ""
131 @@-$(RM) $(MISC)$/$(APP1LINKRES:b).rc
132 .IF "$(APP1ICON)" != ""
133 @-echo 1 ICON $(EMQ)"$(APP1ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP1LINKRES:b).rc
134 .ENDIF # "$(APP1ICON)" != ""
135 .IF "$(APP1VERINFO)" != ""
136 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP1LINKRES:b).rc
137 @-echo $(EMQ)#include $(EMQ)"$(APP1VERINFO)$(EMQ)" >> $(MISC)$/$(APP1LINKRES:b).rc
138 .ENDIF # "$(APP1VERINFO)" != ""
139 $(RC) -DWIN32 $(APP1PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP1LINKRES:b).rc
140 .ENDIF # "$(APP1LINKRES)" != ""
141 .IF "$(COM)" == "GCC"
142 @echo mingw
143 .IF "$(APP1LINKRES)" != "" || "$(APP1RES)" != ""
144 @cat $(APP1LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP1RES)) > $(MISC)$/$(@:b)_all.res
145 windres $(MISC)$/$(@:b)_all.res $(APP1RESO)
146 .ENDIF
147 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
148 $(APP1BASEX) $(APP1STACKN) -o $@ $(APP1OBJS) \
149 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP1RESO) \
150 `$(TYPE) /dev/null $(APP1LIBS) | sed s#$(ROUT)#$(OUT)#g` \
151 $(APP_LINKTYPE) $(APP1LIBSALCPPRT) \
152 -Wl,--start-group $(APP1STDLIBS) -Wl,--end-group $(APP1STDLIB) \
153 $(STDLIB1) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_1.cmd
154 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_1.cmd
155 @+source $(MISC)$/$(TARGET).$(@:b)_1.cmd
156 @ls -l $@
157 .ELSE # "$(COM)" == "GCC"
158 .IF "$(linkinc)" == ""
159 $(APP1LINKER) @$(mktmp \
160 $(APP1LINKFLAGS) \
161 $(LINKFLAGSAPP) $(APP1BASEX) \
162 $(APP1STACKN) \
163 -out:$@ \
164 -map:$(MISC)$/{$(subst,$/,_ $(APP1TARGET)).map} \
165 $(STDOBJ) \
166 $(APP1LINKRES) \
167 $(APP1RES) \
168 $(APP1OBJS) \
169 $(APP1LIBS) \
170 $(APP1STDLIBS) \
171 $(APP1STDLIB) $(STDLIB1) \
173 @-echo linking $@.manifest ...
174 .IF "$(VISTA_MANIFEST)"!=""
175 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
176 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
177 .ELSE
178 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
179 .ENDIF # "$(VISTA_MANIFEST)"!=""
180 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
181 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
182 .ELSE
183 -$(RM) $(MISC)\$(APP1TARGET).lnk
184 -$(RM) $(MISC)\$(APP1TARGET).lst
185 -$(RM) $(MISC)\linkobj.lst
186 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
187 type $(mktmp,$(MISC)\$(APP1TARGET).lst
188 $(APP1LINKFLAGS) \
189 $(LINKFLAGSAPP) $(APP1BASEX) \
190 $(APP1STACKN) \
191 -out:$@ \
192 $(STDOBJ) \
193 $(APP1LINKRES) \
194 $(APP1RES) \
195 $(APP1OBJS) \
196 $(APP1LIBS) \
197 $(APP1STDLIBS) \
198 $(APP1STDLIB) $(STDLIB1))
199 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP1TARGETN:b)_linkobj.lst >> $(MISC)\$(APP1TARGET).lst
200 $(IFEXIST) $(MISC)$/$(APP1TARGET).lst $(THEN) type $(MISC)$/$(APP1TARGET).lst >> $(MISC)$/$(APP1TARGET).lnk $(FI)
201 $(APP1LINKER) @$(MISC)\$(APP1TARGET).lnk
202 .ENDIF # "$(linkinc)" == ""
203 .ENDIF # "$(COM)" == "GCC"
204 .IF "$(APP1TARGET)" == "loader"
205 $(PERL) loader.pl $@
206 .IF "$(USE_SHELL)"=="4nt"
207 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
208 .ELSE # "$(USE_SHELL)"=="4nt"
209 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
210 .ENDIF # "$(USE_SHELL)"=="4nt"
211 $(RM) $@
212 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
213 .ENDIF # "$(TARGET)" == "setup"
215 .ENDIF # "$(GUI)" == "WNT"
217 .IF "$(GUI)" == "OS2"
218 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
219 .IF "$(APP1LINKRES)" != ""
220 @+-$(RM) $(MISC)$/$(APP1LINKRES:b).rc >& $(NULLDEV)
221 .IF "$(APP1ICON)" != ""
222 .IF "$(USE_SHELL)"=="4nt"
223 @-+echo ICON 1 "$(APP1ICON:s/\/\\/)" >> $(MISC)$/$(APP1LINKRES:b).rc
224 .ELSE # "$(USE_SHELL)"=="4nt"
225 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP1ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP1LINKRES:b).rc
226 .ENDIF # "$(USE_SHELL)"=="4nt"
227 .ENDIF # "$(APP1ICON)" != ""
228 .IF "$(APP1VERINFO)" != ""
229 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP1LINKRES:b).rc
230 @-+echo $(EMQ)#include $(EMQ)"$(APP1VERINFO)$(EMQ)" >> $(MISC)$/$(APP1LINKRES:b).rc
231 .ENDIF # "$(APP1VERINFO)" != ""
232 $(RC) -r -DOS2 $(APP1PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP1LINKRES:b).rc
233 .ENDIF # "$(APP1LINKRES)" != ""
235 .IF "$(TARGETTYPE)" == "GUI"
236 @echo NAME $(APP1TARGET) WINDOWAPI > $(MISC)$/$(APP1TARGET).def
237 .ENDIF
239 @+echo $(APP1LINKFLAGS) \
240 $(LINKFLAGSAPP) $(APP1BASEX) \
241 $(APP1STACKN) \
242 -o $@ \
243 -Zmap -L$(LB) \
244 -L$(SOLARVERSION)$/$(INPATH)$/lib \
245 $(STDOBJ) \
246 $(APP1LINKRES) \
247 $(APP1RES) \
248 $(APP1DEF) \
249 $(APP1OBJS) \
250 $(APP1LIBS) \
251 $(APP1STDLIBS:^"-l") \
252 $(APP1STDLIB:^"-l") $(STDLIB1:^"-l")
253 $(APP1LINKER) -v \
254 $(APP1LINKFLAGS) \
255 $(LINKFLAGSAPP) $(APP1BASEX) \
256 $(APP1STACKN) \
257 -o $@ \
258 -Zmap -L$(LB) \
259 -L$(SOLARVERSION)$/$(INPATH)$/lib \
260 $(STDOBJ) \
261 $(APP1LINKRES) \
262 $(APP1RES) \
263 $(APP1DEF) \
264 $(APP1OBJS) \
265 $(APP1LIBS) \
266 $(APP1STDLIBS:^"-l") \
267 $(APP1STDLIB:^"-l") $(STDLIB1:^"-l")
270 .IF "$(APP1TARGET)" == "loader"
271 +$(PERL) loader.pl $@
272 .IF "$(USE_SHELL)"=="4nt"
273 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
274 .ELSE # "$(USE_SHELL)"=="4nt"
275 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
276 .ENDIF # "$(USE_SHELL)"=="4nt"
277 +$(RM) $@
278 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
279 .ENDIF # "$(TARGET)" == "setup"
281 .ENDIF # "$(GUI)" == "OS2"
283 .ENDIF # "$(APP1TARGETN)"!=""
286 # Instruction for linking
287 # unroll begin
289 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
290 APP2DEF = $(MISC)$/$(APP2TARGET).def
291 .ENDIF
293 .IF "$(APP2LINKTYPE)" != ""
294 #must be either STATIC or SHARED
295 APP2LINKTYPEFLAG=$(APPLINK$(APP2LINKTYPE))
296 .ENDIF
298 # decide how to link
299 .IF "$(APP2CODETYPE)"=="C"
300 APP2LINKER=$(LINKC)
301 APP2STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
302 APP2LINKFLAGS+=$(LINKCFLAGS)
303 .ELSE # "$(APP2CODETYPE)"=="C"
304 APP2LINKER=$(LINK)
305 APP2STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
306 APP2LINKFLAGS+=$(LINKFLAGS)
307 .ENDIF # "$(APP2CODETYPE)"=="C"
309 APP2RPATH*=OOO
310 LINKFLAGSRUNPATH_$(APP2RPATH)*=/ERROR:/Bad_APP2RPATH_value
311 .IF "$(OS)" != "MACOSX"
312 APP2LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP2RPATH))
313 .ENDIF
315 .IF "$(APP2STACK)" != ""
316 .IF "$(LINKFLAGSTACK)" != ""
317 APP2STACKN=$(LINKFLAGSTACK)$(APP2STACK)
318 .ENDIF
319 .ELSE
320 APP2STACKN=
321 .ENDIF
323 .IF "$(APP2NOSAL)"==""
324 .IF "$(TARGETTYPE)" == "GUI"
325 APP2OBJS+= $(STDOBJVCL)
326 .ENDIF
327 .ENDIF
329 .IF "$(GUI)$(COM)" == "WNTGCC"
330 APP2RESO=
331 .IF "$(APP2LINKRES)" != "" || "$(APP2RES)" != ""
332 APP2RESO=$(MISC)$/$(APP2TARGET:b)_res.o
333 .ENDIF
334 .ENDIF
336 .IF "$(GUI)" == "UNX"
337 APP2DEPN+:=$(APP2DEPNU)
338 USE_APP2DEF=
339 .ENDIF
341 .IF "$(APP2TARGETN)"!=""
343 .IF "$(APP2PRODUCTNAME)"!=""
344 APP2PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP2PRODUCTNAME)\"
345 .ENDIF # "$(APP2PRODUCTNAME)"!=""
347 .IF "$(linkinc)"!=""
348 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
349 .IF "$(APP2LIBS)"!=""
350 $(MISC)$/$(APP2TARGET)_linkinc.ls .PHONY:
351 @@-$(RM) $@
352 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP2LIBS) $(i:s/.lib/.lin/)) >> $@
353 .ENDIF #"$(APP2LIBS)"!=""
354 .ENDIF
356 LINKINCTARGETS+=$(MISC)$/$(APP2TARGETN:b)_linkinc.ls
357 $(APP2TARGETN) : $(LINKINCTARGETS)
358 .ENDIF # "$(linkinc)"!=""
360 # Allow for target specific LIBSALCPPRT override
361 APP2LIBSALCPPRT*=$(LIBSALCPPRT)
363 .IF "$(GUI)" == "OS2"
364 _APP2IMP_ORD = $(APP2STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP2STDLIBS:^"$(LB)$/")
365 APP2IMP_ORD = $(foreach,i,$(_APP2IMP_ORD) $(shell @-ls $i))
366 .ELSE
367 APP2IMP_ORD =
368 .ENDIF
370 $(APP2TARGETN): $(APP2OBJS) $(APP2LIBS) \
371 $(APP2RES) \
372 $(APP2IMP_ORD) \
373 $(APP2ICON) $(APP2DEPN) $(USE_APP2DEF)
374 @echo ------------------------------
375 @echo "Making: " $(@:f)
376 .IF "$(GUI)"=="UNX"
377 .IF "$(OS)"=="MACOSX"
378 @echo unx
379 @-$(RM) $(MISC)$/$(@:b).list
380 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_2.cmd
381 @-$(RM) $(MISC)$/$(@:b).strip
382 @echo $(STDSLO) $(APP2OBJS:s/.obj/.o/) \
383 `cat /dev/null $(APP2LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
384 @echo -n $(APP2LINKER) $(APP2LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
385 $(APP2LINKTYPEFLAG) $(APP2STDLIBS) $(APP2STDLIB) $(STDLIB2) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_2.cmd
386 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
387 `cat $(MISC)$/$(TARGET).$(@:b)_2.cmd` \
388 >> $(MISC)$/$(TARGET).$(@:b)_2.cmd
389 @cat $(MISC)$/$(TARGET).$(@:b)_2.cmd
390 @+source $(MISC)$/$(TARGET).$(@:b)_2.cmd
391 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
392 # libraries at runtime
393 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
394 @strip -i -R $(MISC)$/$(@:b).strip -X $@
395 @ls -l $@
396 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
397 app $(APP2RPATH) $@
398 .IF "$(TARGETTYPE)"=="GUI"
399 @echo "Making: " $(@:f).app
400 @macosx-create-bundle $@
401 .ENDIF # "$(TARGETTYPE)"=="GUI"
402 .ELSE # "$(OS)"=="MACOSX"
403 @echo unx
404 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_2.cmd
405 @echo $(APP2LINKER) $(APP2LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
406 $(APP2OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_2.cmd
407 @cat $(mktmp /dev/null $(APP2LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_2.cmd
408 @echo $(APP2LINKTYPEFLAG) $(APP2LIBSALCPPRT) $(APP2STDLIBS) $(APP2STDLIB) $(STDLIB2) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_2.cmd
409 cat $(MISC)$/$(TARGET).$(@:b)_2.cmd
410 @+source $(MISC)$/$(TARGET).$(@:b)_2.cmd
411 @ls -l $@
412 .ENDIF # "$(OS)"=="MACOSX"
413 .ENDIF
414 .IF "$(GUI)" == "WNT"
415 @@-$(MKDIR) $(@:d:d)
416 .IF "$(APP2LINKRES)" != ""
417 @@-$(RM) $(MISC)$/$(APP2LINKRES:b).rc
418 .IF "$(APP2ICON)" != ""
419 @-echo 1 ICON $(EMQ)"$(APP2ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP2LINKRES:b).rc
420 .ENDIF # "$(APP2ICON)" != ""
421 .IF "$(APP2VERINFO)" != ""
422 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP2LINKRES:b).rc
423 @-echo $(EMQ)#include $(EMQ)"$(APP2VERINFO)$(EMQ)" >> $(MISC)$/$(APP2LINKRES:b).rc
424 .ENDIF # "$(APP2VERINFO)" != ""
425 $(RC) -DWIN32 $(APP2PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP2LINKRES:b).rc
426 .ENDIF # "$(APP2LINKRES)" != ""
427 .IF "$(COM)" == "GCC"
428 @echo mingw
429 .IF "$(APP2LINKRES)" != "" || "$(APP2RES)" != ""
430 @cat $(APP2LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP2RES)) > $(MISC)$/$(@:b)_all.res
431 windres $(MISC)$/$(@:b)_all.res $(APP2RESO)
432 .ENDIF
433 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
434 $(APP2BASEX) $(APP2STACKN) -o $@ $(APP2OBJS) \
435 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP2RESO) \
436 `$(TYPE) /dev/null $(APP2LIBS) | sed s#$(ROUT)#$(OUT)#g` \
437 $(APP_LINKTYPE) $(APP2LIBSALCPPRT) \
438 -Wl,--start-group $(APP2STDLIBS) -Wl,--end-group $(APP2STDLIB) \
439 $(STDLIB2) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_2.cmd
440 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_2.cmd
441 @+source $(MISC)$/$(TARGET).$(@:b)_2.cmd
442 @ls -l $@
443 .ELSE # "$(COM)" == "GCC"
444 .IF "$(linkinc)" == ""
445 $(APP2LINKER) @$(mktmp \
446 $(APP2LINKFLAGS) \
447 $(LINKFLAGSAPP) $(APP2BASEX) \
448 $(APP2STACKN) \
449 -out:$@ \
450 -map:$(MISC)$/{$(subst,$/,_ $(APP2TARGET)).map} \
451 $(STDOBJ) \
452 $(APP2LINKRES) \
453 $(APP2RES) \
454 $(APP2OBJS) \
455 $(APP2LIBS) \
456 $(APP2STDLIBS) \
457 $(APP2STDLIB) $(STDLIB2) \
459 @-echo linking $@.manifest ...
460 .IF "$(VISTA_MANIFEST)"!=""
461 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
462 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
463 .ELSE
464 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
465 .ENDIF # "$(VISTA_MANIFEST)"!=""
466 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
467 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
468 .ELSE
469 -$(RM) $(MISC)\$(APP2TARGET).lnk
470 -$(RM) $(MISC)\$(APP2TARGET).lst
471 -$(RM) $(MISC)\linkobj.lst
472 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
473 type $(mktmp,$(MISC)\$(APP2TARGET).lst
474 $(APP2LINKFLAGS) \
475 $(LINKFLAGSAPP) $(APP2BASEX) \
476 $(APP2STACKN) \
477 -out:$@ \
478 $(STDOBJ) \
479 $(APP2LINKRES) \
480 $(APP2RES) \
481 $(APP2OBJS) \
482 $(APP2LIBS) \
483 $(APP2STDLIBS) \
484 $(APP2STDLIB) $(STDLIB2))
485 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP2TARGETN:b)_linkobj.lst >> $(MISC)\$(APP2TARGET).lst
486 $(IFEXIST) $(MISC)$/$(APP2TARGET).lst $(THEN) type $(MISC)$/$(APP2TARGET).lst >> $(MISC)$/$(APP2TARGET).lnk $(FI)
487 $(APP2LINKER) @$(MISC)\$(APP2TARGET).lnk
488 .ENDIF # "$(linkinc)" == ""
489 .ENDIF # "$(COM)" == "GCC"
490 .IF "$(APP2TARGET)" == "loader"
491 $(PERL) loader.pl $@
492 .IF "$(USE_SHELL)"=="4nt"
493 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
494 .ELSE # "$(USE_SHELL)"=="4nt"
495 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
496 .ENDIF # "$(USE_SHELL)"=="4nt"
497 $(RM) $@
498 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
499 .ENDIF # "$(TARGET)" == "setup"
501 .ENDIF # "$(GUI)" == "WNT"
503 .IF "$(GUI)" == "OS2"
504 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
505 .IF "$(APP2LINKRES)" != ""
506 @+-$(RM) $(MISC)$/$(APP2LINKRES:b).rc >& $(NULLDEV)
507 .IF "$(APP2ICON)" != ""
508 .IF "$(USE_SHELL)"=="4nt"
509 @-+echo ICON 1 "$(APP2ICON:s/\/\\/)" >> $(MISC)$/$(APP2LINKRES:b).rc
510 .ELSE # "$(USE_SHELL)"=="4nt"
511 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP2ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP2LINKRES:b).rc
512 .ENDIF # "$(USE_SHELL)"=="4nt"
513 .ENDIF # "$(APP2ICON)" != ""
514 .IF "$(APP2VERINFO)" != ""
515 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP2LINKRES:b).rc
516 @-+echo $(EMQ)#include $(EMQ)"$(APP2VERINFO)$(EMQ)" >> $(MISC)$/$(APP2LINKRES:b).rc
517 .ENDIF # "$(APP2VERINFO)" != ""
518 $(RC) -r -DOS2 $(APP2PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP2LINKRES:b).rc
519 .ENDIF # "$(APP2LINKRES)" != ""
521 .IF "$(TARGETTYPE)" == "GUI"
522 @echo NAME $(APP2TARGET) WINDOWAPI > $(MISC)$/$(APP2TARGET).def
523 .ENDIF
525 @+echo $(APP2LINKFLAGS) \
526 $(LINKFLAGSAPP) $(APP2BASEX) \
527 $(APP2STACKN) \
528 -o $@ \
529 -Zmap -L$(LB) \
530 -L$(SOLARVERSION)$/$(INPATH)$/lib \
531 $(STDOBJ) \
532 $(APP2LINKRES) \
533 $(APP2RES) \
534 $(APP2DEF) \
535 $(APP2OBJS) \
536 $(APP2LIBS) \
537 $(APP2STDLIBS:^"-l") \
538 $(APP2STDLIB:^"-l") $(STDLIB2:^"-l")
539 $(APP2LINKER) -v \
540 $(APP2LINKFLAGS) \
541 $(LINKFLAGSAPP) $(APP2BASEX) \
542 $(APP2STACKN) \
543 -o $@ \
544 -Zmap -L$(LB) \
545 -L$(SOLARVERSION)$/$(INPATH)$/lib \
546 $(STDOBJ) \
547 $(APP2LINKRES) \
548 $(APP2RES) \
549 $(APP2DEF) \
550 $(APP2OBJS) \
551 $(APP2LIBS) \
552 $(APP2STDLIBS:^"-l") \
553 $(APP2STDLIB:^"-l") $(STDLIB2:^"-l")
556 .IF "$(APP2TARGET)" == "loader"
557 +$(PERL) loader.pl $@
558 .IF "$(USE_SHELL)"=="4nt"
559 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
560 .ELSE # "$(USE_SHELL)"=="4nt"
561 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
562 .ENDIF # "$(USE_SHELL)"=="4nt"
563 +$(RM) $@
564 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
565 .ENDIF # "$(TARGET)" == "setup"
567 .ENDIF # "$(GUI)" == "OS2"
569 .ENDIF # "$(APP2TARGETN)"!=""
572 # Instruction for linking
573 # unroll begin
575 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
576 APP3DEF = $(MISC)$/$(APP3TARGET).def
577 .ENDIF
579 .IF "$(APP3LINKTYPE)" != ""
580 #must be either STATIC or SHARED
581 APP3LINKTYPEFLAG=$(APPLINK$(APP3LINKTYPE))
582 .ENDIF
584 # decide how to link
585 .IF "$(APP3CODETYPE)"=="C"
586 APP3LINKER=$(LINKC)
587 APP3STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
588 APP3LINKFLAGS+=$(LINKCFLAGS)
589 .ELSE # "$(APP3CODETYPE)"=="C"
590 APP3LINKER=$(LINK)
591 APP3STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
592 APP3LINKFLAGS+=$(LINKFLAGS)
593 .ENDIF # "$(APP3CODETYPE)"=="C"
595 APP3RPATH*=OOO
596 LINKFLAGSRUNPATH_$(APP3RPATH)*=/ERROR:/Bad_APP3RPATH_value
597 .IF "$(OS)" != "MACOSX"
598 APP3LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP3RPATH))
599 .ENDIF
601 .IF "$(APP3STACK)" != ""
602 .IF "$(LINKFLAGSTACK)" != ""
603 APP3STACKN=$(LINKFLAGSTACK)$(APP3STACK)
604 .ENDIF
605 .ELSE
606 APP3STACKN=
607 .ENDIF
609 .IF "$(APP3NOSAL)"==""
610 .IF "$(TARGETTYPE)" == "GUI"
611 APP3OBJS+= $(STDOBJVCL)
612 .ENDIF
613 .ENDIF
615 .IF "$(GUI)$(COM)" == "WNTGCC"
616 APP3RESO=
617 .IF "$(APP3LINKRES)" != "" || "$(APP3RES)" != ""
618 APP3RESO=$(MISC)$/$(APP3TARGET:b)_res.o
619 .ENDIF
620 .ENDIF
622 .IF "$(GUI)" == "UNX"
623 APP3DEPN+:=$(APP3DEPNU)
624 USE_APP3DEF=
625 .ENDIF
627 .IF "$(APP3TARGETN)"!=""
629 .IF "$(APP3PRODUCTNAME)"!=""
630 APP3PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP3PRODUCTNAME)\"
631 .ENDIF # "$(APP3PRODUCTNAME)"!=""
633 .IF "$(linkinc)"!=""
634 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
635 .IF "$(APP3LIBS)"!=""
636 $(MISC)$/$(APP3TARGET)_linkinc.ls .PHONY:
637 @@-$(RM) $@
638 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP3LIBS) $(i:s/.lib/.lin/)) >> $@
639 .ENDIF #"$(APP3LIBS)"!=""
640 .ENDIF
642 LINKINCTARGETS+=$(MISC)$/$(APP3TARGETN:b)_linkinc.ls
643 $(APP3TARGETN) : $(LINKINCTARGETS)
644 .ENDIF # "$(linkinc)"!=""
646 # Allow for target specific LIBSALCPPRT override
647 APP3LIBSALCPPRT*=$(LIBSALCPPRT)
649 .IF "$(GUI)" == "OS2"
650 _APP3IMP_ORD = $(APP3STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP3STDLIBS:^"$(LB)$/")
651 APP3IMP_ORD = $(foreach,i,$(_APP3IMP_ORD) $(shell @-ls $i))
652 .ELSE
653 APP3IMP_ORD =
654 .ENDIF
656 $(APP3TARGETN): $(APP3OBJS) $(APP3LIBS) \
657 $(APP3RES) \
658 $(APP3IMP_ORD) \
659 $(APP3ICON) $(APP3DEPN) $(USE_APP3DEF)
660 @echo ------------------------------
661 @echo "Making: " $(@:f)
662 .IF "$(GUI)"=="UNX"
663 .IF "$(OS)"=="MACOSX"
664 @echo unx
665 @-$(RM) $(MISC)$/$(@:b).list
666 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_3.cmd
667 @-$(RM) $(MISC)$/$(@:b).strip
668 @echo $(STDSLO) $(APP3OBJS:s/.obj/.o/) \
669 `cat /dev/null $(APP3LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
670 @echo -n $(APP3LINKER) $(APP3LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
671 $(APP3LINKTYPEFLAG) $(APP3STDLIBS) $(APP3STDLIB) $(STDLIB3) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_3.cmd
672 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
673 `cat $(MISC)$/$(TARGET).$(@:b)_3.cmd` \
674 >> $(MISC)$/$(TARGET).$(@:b)_3.cmd
675 @cat $(MISC)$/$(TARGET).$(@:b)_3.cmd
676 @+source $(MISC)$/$(TARGET).$(@:b)_3.cmd
677 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
678 # libraries at runtime
679 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
680 @strip -i -R $(MISC)$/$(@:b).strip -X $@
681 @ls -l $@
682 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
683 app $(APP3RPATH) $@
684 .IF "$(TARGETTYPE)"=="GUI"
685 @echo "Making: " $(@:f).app
686 @macosx-create-bundle $@
687 .ENDIF # "$(TARGETTYPE)"=="GUI"
688 .ELSE # "$(OS)"=="MACOSX"
689 @echo unx
690 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_3.cmd
691 @echo $(APP3LINKER) $(APP3LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
692 $(APP3OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_3.cmd
693 @cat $(mktmp /dev/null $(APP3LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_3.cmd
694 @echo $(APP3LINKTYPEFLAG) $(APP3LIBSALCPPRT) $(APP3STDLIBS) $(APP3STDLIB) $(STDLIB3) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_3.cmd
695 cat $(MISC)$/$(TARGET).$(@:b)_3.cmd
696 @+source $(MISC)$/$(TARGET).$(@:b)_3.cmd
697 @ls -l $@
698 .ENDIF # "$(OS)"=="MACOSX"
699 .ENDIF
700 .IF "$(GUI)" == "WNT"
701 @@-$(MKDIR) $(@:d:d)
702 .IF "$(APP3LINKRES)" != ""
703 @@-$(RM) $(MISC)$/$(APP3LINKRES:b).rc
704 .IF "$(APP3ICON)" != ""
705 @-echo 1 ICON $(EMQ)"$(APP3ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP3LINKRES:b).rc
706 .ENDIF # "$(APP3ICON)" != ""
707 .IF "$(APP3VERINFO)" != ""
708 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP3LINKRES:b).rc
709 @-echo $(EMQ)#include $(EMQ)"$(APP3VERINFO)$(EMQ)" >> $(MISC)$/$(APP3LINKRES:b).rc
710 .ENDIF # "$(APP3VERINFO)" != ""
711 $(RC) -DWIN32 $(APP3PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP3LINKRES:b).rc
712 .ENDIF # "$(APP3LINKRES)" != ""
713 .IF "$(COM)" == "GCC"
714 @echo mingw
715 .IF "$(APP3LINKRES)" != "" || "$(APP3RES)" != ""
716 @cat $(APP3LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP3RES)) > $(MISC)$/$(@:b)_all.res
717 windres $(MISC)$/$(@:b)_all.res $(APP3RESO)
718 .ENDIF
719 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
720 $(APP3BASEX) $(APP3STACKN) -o $@ $(APP3OBJS) \
721 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP3RESO) \
722 `$(TYPE) /dev/null $(APP3LIBS) | sed s#$(ROUT)#$(OUT)#g` \
723 $(APP_LINKTYPE) $(APP3LIBSALCPPRT) \
724 -Wl,--start-group $(APP3STDLIBS) -Wl,--end-group $(APP3STDLIB) \
725 $(STDLIB3) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_3.cmd
726 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_3.cmd
727 @+source $(MISC)$/$(TARGET).$(@:b)_3.cmd
728 @ls -l $@
729 .ELSE # "$(COM)" == "GCC"
730 .IF "$(linkinc)" == ""
731 $(APP3LINKER) @$(mktmp \
732 $(APP3LINKFLAGS) \
733 $(LINKFLAGSAPP) $(APP3BASEX) \
734 $(APP3STACKN) \
735 -out:$@ \
736 -map:$(MISC)$/{$(subst,$/,_ $(APP3TARGET)).map} \
737 $(STDOBJ) \
738 $(APP3LINKRES) \
739 $(APP3RES) \
740 $(APP3OBJS) \
741 $(APP3LIBS) \
742 $(APP3STDLIBS) \
743 $(APP3STDLIB) $(STDLIB3) \
745 @-echo linking $@.manifest ...
746 .IF "$(VISTA_MANIFEST)"!=""
747 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
748 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
749 .ELSE
750 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
751 .ENDIF # "$(VISTA_MANIFEST)"!=""
752 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
753 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
754 .ELSE
755 -$(RM) $(MISC)\$(APP3TARGET).lnk
756 -$(RM) $(MISC)\$(APP3TARGET).lst
757 -$(RM) $(MISC)\linkobj.lst
758 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
759 type $(mktmp,$(MISC)\$(APP3TARGET).lst
760 $(APP3LINKFLAGS) \
761 $(LINKFLAGSAPP) $(APP3BASEX) \
762 $(APP3STACKN) \
763 -out:$@ \
764 $(STDOBJ) \
765 $(APP3LINKRES) \
766 $(APP3RES) \
767 $(APP3OBJS) \
768 $(APP3LIBS) \
769 $(APP3STDLIBS) \
770 $(APP3STDLIB) $(STDLIB3))
771 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP3TARGETN:b)_linkobj.lst >> $(MISC)\$(APP3TARGET).lst
772 $(IFEXIST) $(MISC)$/$(APP3TARGET).lst $(THEN) type $(MISC)$/$(APP3TARGET).lst >> $(MISC)$/$(APP3TARGET).lnk $(FI)
773 $(APP3LINKER) @$(MISC)\$(APP3TARGET).lnk
774 .ENDIF # "$(linkinc)" == ""
775 .ENDIF # "$(COM)" == "GCC"
776 .IF "$(APP3TARGET)" == "loader"
777 $(PERL) loader.pl $@
778 .IF "$(USE_SHELL)"=="4nt"
779 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
780 .ELSE # "$(USE_SHELL)"=="4nt"
781 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
782 .ENDIF # "$(USE_SHELL)"=="4nt"
783 $(RM) $@
784 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
785 .ENDIF # "$(TARGET)" == "setup"
787 .ENDIF # "$(GUI)" == "WNT"
789 .IF "$(GUI)" == "OS2"
790 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
791 .IF "$(APP3LINKRES)" != ""
792 @+-$(RM) $(MISC)$/$(APP3LINKRES:b).rc >& $(NULLDEV)
793 .IF "$(APP3ICON)" != ""
794 .IF "$(USE_SHELL)"=="4nt"
795 @-+echo ICON 1 "$(APP3ICON:s/\/\\/)" >> $(MISC)$/$(APP3LINKRES:b).rc
796 .ELSE # "$(USE_SHELL)"=="4nt"
797 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP3ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP3LINKRES:b).rc
798 .ENDIF # "$(USE_SHELL)"=="4nt"
799 .ENDIF # "$(APP3ICON)" != ""
800 .IF "$(APP3VERINFO)" != ""
801 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP3LINKRES:b).rc
802 @-+echo $(EMQ)#include $(EMQ)"$(APP3VERINFO)$(EMQ)" >> $(MISC)$/$(APP3LINKRES:b).rc
803 .ENDIF # "$(APP3VERINFO)" != ""
804 $(RC) -r -DOS2 $(APP3PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP3LINKRES:b).rc
805 .ENDIF # "$(APP3LINKRES)" != ""
807 .IF "$(TARGETTYPE)" == "GUI"
808 @echo NAME $(APP3TARGET) WINDOWAPI > $(MISC)$/$(APP3TARGET).def
809 .ENDIF
811 @+echo $(APP3LINKFLAGS) \
812 $(LINKFLAGSAPP) $(APP3BASEX) \
813 $(APP3STACKN) \
814 -o $@ \
815 -Zmap -L$(LB) \
816 -L$(SOLARVERSION)$/$(INPATH)$/lib \
817 $(STDOBJ) \
818 $(APP3LINKRES) \
819 $(APP3RES) \
820 $(APP3DEF) \
821 $(APP3OBJS) \
822 $(APP3LIBS) \
823 $(APP3STDLIBS:^"-l") \
824 $(APP3STDLIB:^"-l") $(STDLIB3:^"-l")
825 $(APP3LINKER) -v \
826 $(APP3LINKFLAGS) \
827 $(LINKFLAGSAPP) $(APP3BASEX) \
828 $(APP3STACKN) \
829 -o $@ \
830 -Zmap -L$(LB) \
831 -L$(SOLARVERSION)$/$(INPATH)$/lib \
832 $(STDOBJ) \
833 $(APP3LINKRES) \
834 $(APP3RES) \
835 $(APP3DEF) \
836 $(APP3OBJS) \
837 $(APP3LIBS) \
838 $(APP3STDLIBS:^"-l") \
839 $(APP3STDLIB:^"-l") $(STDLIB3:^"-l")
842 .IF "$(APP3TARGET)" == "loader"
843 +$(PERL) loader.pl $@
844 .IF "$(USE_SHELL)"=="4nt"
845 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
846 .ELSE # "$(USE_SHELL)"=="4nt"
847 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
848 .ENDIF # "$(USE_SHELL)"=="4nt"
849 +$(RM) $@
850 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
851 .ENDIF # "$(TARGET)" == "setup"
853 .ENDIF # "$(GUI)" == "OS2"
855 .ENDIF # "$(APP3TARGETN)"!=""
858 # Instruction for linking
859 # unroll begin
861 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
862 APP4DEF = $(MISC)$/$(APP4TARGET).def
863 .ENDIF
865 .IF "$(APP4LINKTYPE)" != ""
866 #must be either STATIC or SHARED
867 APP4LINKTYPEFLAG=$(APPLINK$(APP4LINKTYPE))
868 .ENDIF
870 # decide how to link
871 .IF "$(APP4CODETYPE)"=="C"
872 APP4LINKER=$(LINKC)
873 APP4STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
874 APP4LINKFLAGS+=$(LINKCFLAGS)
875 .ELSE # "$(APP4CODETYPE)"=="C"
876 APP4LINKER=$(LINK)
877 APP4STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
878 APP4LINKFLAGS+=$(LINKFLAGS)
879 .ENDIF # "$(APP4CODETYPE)"=="C"
881 APP4RPATH*=OOO
882 LINKFLAGSRUNPATH_$(APP4RPATH)*=/ERROR:/Bad_APP4RPATH_value
883 .IF "$(OS)" != "MACOSX"
884 APP4LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP4RPATH))
885 .ENDIF
887 .IF "$(APP4STACK)" != ""
888 .IF "$(LINKFLAGSTACK)" != ""
889 APP4STACKN=$(LINKFLAGSTACK)$(APP4STACK)
890 .ENDIF
891 .ELSE
892 APP4STACKN=
893 .ENDIF
895 .IF "$(APP4NOSAL)"==""
896 .IF "$(TARGETTYPE)" == "GUI"
897 APP4OBJS+= $(STDOBJVCL)
898 .ENDIF
899 .ENDIF
901 .IF "$(GUI)$(COM)" == "WNTGCC"
902 APP4RESO=
903 .IF "$(APP4LINKRES)" != "" || "$(APP4RES)" != ""
904 APP4RESO=$(MISC)$/$(APP4TARGET:b)_res.o
905 .ENDIF
906 .ENDIF
908 .IF "$(GUI)" == "UNX"
909 APP4DEPN+:=$(APP4DEPNU)
910 USE_APP4DEF=
911 .ENDIF
913 .IF "$(APP4TARGETN)"!=""
915 .IF "$(APP4PRODUCTNAME)"!=""
916 APP4PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP4PRODUCTNAME)\"
917 .ENDIF # "$(APP4PRODUCTNAME)"!=""
919 .IF "$(linkinc)"!=""
920 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
921 .IF "$(APP4LIBS)"!=""
922 $(MISC)$/$(APP4TARGET)_linkinc.ls .PHONY:
923 @@-$(RM) $@
924 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP4LIBS) $(i:s/.lib/.lin/)) >> $@
925 .ENDIF #"$(APP4LIBS)"!=""
926 .ENDIF
928 LINKINCTARGETS+=$(MISC)$/$(APP4TARGETN:b)_linkinc.ls
929 $(APP4TARGETN) : $(LINKINCTARGETS)
930 .ENDIF # "$(linkinc)"!=""
932 # Allow for target specific LIBSALCPPRT override
933 APP4LIBSALCPPRT*=$(LIBSALCPPRT)
935 .IF "$(GUI)" == "OS2"
936 _APP4IMP_ORD = $(APP4STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP4STDLIBS:^"$(LB)$/")
937 APP4IMP_ORD = $(foreach,i,$(_APP4IMP_ORD) $(shell @-ls $i))
938 .ELSE
939 APP4IMP_ORD =
940 .ENDIF
942 $(APP4TARGETN): $(APP4OBJS) $(APP4LIBS) \
943 $(APP4RES) \
944 $(APP4IMP_ORD) \
945 $(APP4ICON) $(APP4DEPN) $(USE_APP4DEF)
946 @echo ------------------------------
947 @echo "Making: " $(@:f)
948 .IF "$(GUI)"=="UNX"
949 .IF "$(OS)"=="MACOSX"
950 @echo unx
951 @-$(RM) $(MISC)$/$(@:b).list
952 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_4.cmd
953 @-$(RM) $(MISC)$/$(@:b).strip
954 @echo $(STDSLO) $(APP4OBJS:s/.obj/.o/) \
955 `cat /dev/null $(APP4LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
956 @echo -n $(APP4LINKER) $(APP4LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
957 $(APP4LINKTYPEFLAG) $(APP4STDLIBS) $(APP4STDLIB) $(STDLIB4) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_4.cmd
958 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
959 `cat $(MISC)$/$(TARGET).$(@:b)_4.cmd` \
960 >> $(MISC)$/$(TARGET).$(@:b)_4.cmd
961 @cat $(MISC)$/$(TARGET).$(@:b)_4.cmd
962 @+source $(MISC)$/$(TARGET).$(@:b)_4.cmd
963 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
964 # libraries at runtime
965 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
966 @strip -i -R $(MISC)$/$(@:b).strip -X $@
967 @ls -l $@
968 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
969 app $(APP4RPATH) $@
970 .IF "$(TARGETTYPE)"=="GUI"
971 @echo "Making: " $(@:f).app
972 @macosx-create-bundle $@
973 .ENDIF # "$(TARGETTYPE)"=="GUI"
974 .ELSE # "$(OS)"=="MACOSX"
975 @echo unx
976 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_4.cmd
977 @echo $(APP4LINKER) $(APP4LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
978 $(APP4OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_4.cmd
979 @cat $(mktmp /dev/null $(APP4LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_4.cmd
980 @echo $(APP4LINKTYPEFLAG) $(APP4LIBSALCPPRT) $(APP4STDLIBS) $(APP4STDLIB) $(STDLIB4) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_4.cmd
981 cat $(MISC)$/$(TARGET).$(@:b)_4.cmd
982 @+source $(MISC)$/$(TARGET).$(@:b)_4.cmd
983 @ls -l $@
984 .ENDIF # "$(OS)"=="MACOSX"
985 .ENDIF
986 .IF "$(GUI)" == "WNT"
987 @@-$(MKDIR) $(@:d:d)
988 .IF "$(APP4LINKRES)" != ""
989 @@-$(RM) $(MISC)$/$(APP4LINKRES:b).rc
990 .IF "$(APP4ICON)" != ""
991 @-echo 1 ICON $(EMQ)"$(APP4ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP4LINKRES:b).rc
992 .ENDIF # "$(APP4ICON)" != ""
993 .IF "$(APP4VERINFO)" != ""
994 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP4LINKRES:b).rc
995 @-echo $(EMQ)#include $(EMQ)"$(APP4VERINFO)$(EMQ)" >> $(MISC)$/$(APP4LINKRES:b).rc
996 .ENDIF # "$(APP4VERINFO)" != ""
997 $(RC) -DWIN32 $(APP4PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP4LINKRES:b).rc
998 .ENDIF # "$(APP4LINKRES)" != ""
999 .IF "$(COM)" == "GCC"
1000 @echo mingw
1001 .IF "$(APP4LINKRES)" != "" || "$(APP4RES)" != ""
1002 @cat $(APP4LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP4RES)) > $(MISC)$/$(@:b)_all.res
1003 windres $(MISC)$/$(@:b)_all.res $(APP4RESO)
1004 .ENDIF
1005 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
1006 $(APP4BASEX) $(APP4STACKN) -o $@ $(APP4OBJS) \
1007 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP4RESO) \
1008 `$(TYPE) /dev/null $(APP4LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1009 $(APP_LINKTYPE) $(APP4LIBSALCPPRT) \
1010 -Wl,--start-group $(APP4STDLIBS) -Wl,--end-group $(APP4STDLIB) \
1011 $(STDLIB4) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_4.cmd
1012 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_4.cmd
1013 @+source $(MISC)$/$(TARGET).$(@:b)_4.cmd
1014 @ls -l $@
1015 .ELSE # "$(COM)" == "GCC"
1016 .IF "$(linkinc)" == ""
1017 $(APP4LINKER) @$(mktmp \
1018 $(APP4LINKFLAGS) \
1019 $(LINKFLAGSAPP) $(APP4BASEX) \
1020 $(APP4STACKN) \
1021 -out:$@ \
1022 -map:$(MISC)$/{$(subst,$/,_ $(APP4TARGET)).map} \
1023 $(STDOBJ) \
1024 $(APP4LINKRES) \
1025 $(APP4RES) \
1026 $(APP4OBJS) \
1027 $(APP4LIBS) \
1028 $(APP4STDLIBS) \
1029 $(APP4STDLIB) $(STDLIB4) \
1031 @-echo linking $@.manifest ...
1032 .IF "$(VISTA_MANIFEST)"!=""
1033 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1034 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1035 .ELSE
1036 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1037 .ENDIF # "$(VISTA_MANIFEST)"!=""
1038 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1039 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1040 .ELSE
1041 -$(RM) $(MISC)\$(APP4TARGET).lnk
1042 -$(RM) $(MISC)\$(APP4TARGET).lst
1043 -$(RM) $(MISC)\linkobj.lst
1044 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1045 type $(mktmp,$(MISC)\$(APP4TARGET).lst
1046 $(APP4LINKFLAGS) \
1047 $(LINKFLAGSAPP) $(APP4BASEX) \
1048 $(APP4STACKN) \
1049 -out:$@ \
1050 $(STDOBJ) \
1051 $(APP4LINKRES) \
1052 $(APP4RES) \
1053 $(APP4OBJS) \
1054 $(APP4LIBS) \
1055 $(APP4STDLIBS) \
1056 $(APP4STDLIB) $(STDLIB4))
1057 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP4TARGETN:b)_linkobj.lst >> $(MISC)\$(APP4TARGET).lst
1058 $(IFEXIST) $(MISC)$/$(APP4TARGET).lst $(THEN) type $(MISC)$/$(APP4TARGET).lst >> $(MISC)$/$(APP4TARGET).lnk $(FI)
1059 $(APP4LINKER) @$(MISC)\$(APP4TARGET).lnk
1060 .ENDIF # "$(linkinc)" == ""
1061 .ENDIF # "$(COM)" == "GCC"
1062 .IF "$(APP4TARGET)" == "loader"
1063 $(PERL) loader.pl $@
1064 .IF "$(USE_SHELL)"=="4nt"
1065 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1066 .ELSE # "$(USE_SHELL)"=="4nt"
1067 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1068 .ENDIF # "$(USE_SHELL)"=="4nt"
1069 $(RM) $@
1070 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1071 .ENDIF # "$(TARGET)" == "setup"
1073 .ENDIF # "$(GUI)" == "WNT"
1075 .IF "$(GUI)" == "OS2"
1076 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
1077 .IF "$(APP4LINKRES)" != ""
1078 @+-$(RM) $(MISC)$/$(APP4LINKRES:b).rc >& $(NULLDEV)
1079 .IF "$(APP4ICON)" != ""
1080 .IF "$(USE_SHELL)"=="4nt"
1081 @-+echo ICON 1 "$(APP4ICON:s/\/\\/)" >> $(MISC)$/$(APP4LINKRES:b).rc
1082 .ELSE # "$(USE_SHELL)"=="4nt"
1083 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP4ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP4LINKRES:b).rc
1084 .ENDIF # "$(USE_SHELL)"=="4nt"
1085 .ENDIF # "$(APP4ICON)" != ""
1086 .IF "$(APP4VERINFO)" != ""
1087 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP4LINKRES:b).rc
1088 @-+echo $(EMQ)#include $(EMQ)"$(APP4VERINFO)$(EMQ)" >> $(MISC)$/$(APP4LINKRES:b).rc
1089 .ENDIF # "$(APP4VERINFO)" != ""
1090 $(RC) -r -DOS2 $(APP4PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP4LINKRES:b).rc
1091 .ENDIF # "$(APP4LINKRES)" != ""
1093 .IF "$(TARGETTYPE)" == "GUI"
1094 @echo NAME $(APP4TARGET) WINDOWAPI > $(MISC)$/$(APP4TARGET).def
1095 .ENDIF
1097 @+echo $(APP4LINKFLAGS) \
1098 $(LINKFLAGSAPP) $(APP4BASEX) \
1099 $(APP4STACKN) \
1100 -o $@ \
1101 -Zmap -L$(LB) \
1102 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1103 $(STDOBJ) \
1104 $(APP4LINKRES) \
1105 $(APP4RES) \
1106 $(APP4DEF) \
1107 $(APP4OBJS) \
1108 $(APP4LIBS) \
1109 $(APP4STDLIBS:^"-l") \
1110 $(APP4STDLIB:^"-l") $(STDLIB4:^"-l")
1111 $(APP4LINKER) -v \
1112 $(APP4LINKFLAGS) \
1113 $(LINKFLAGSAPP) $(APP4BASEX) \
1114 $(APP4STACKN) \
1115 -o $@ \
1116 -Zmap -L$(LB) \
1117 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1118 $(STDOBJ) \
1119 $(APP4LINKRES) \
1120 $(APP4RES) \
1121 $(APP4DEF) \
1122 $(APP4OBJS) \
1123 $(APP4LIBS) \
1124 $(APP4STDLIBS:^"-l") \
1125 $(APP4STDLIB:^"-l") $(STDLIB4:^"-l")
1128 .IF "$(APP4TARGET)" == "loader"
1129 +$(PERL) loader.pl $@
1130 .IF "$(USE_SHELL)"=="4nt"
1131 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1132 .ELSE # "$(USE_SHELL)"=="4nt"
1133 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1134 .ENDIF # "$(USE_SHELL)"=="4nt"
1135 +$(RM) $@
1136 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1137 .ENDIF # "$(TARGET)" == "setup"
1139 .ENDIF # "$(GUI)" == "OS2"
1141 .ENDIF # "$(APP4TARGETN)"!=""
1144 # Instruction for linking
1145 # unroll begin
1147 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
1148 APP5DEF = $(MISC)$/$(APP5TARGET).def
1149 .ENDIF
1151 .IF "$(APP5LINKTYPE)" != ""
1152 #must be either STATIC or SHARED
1153 APP5LINKTYPEFLAG=$(APPLINK$(APP5LINKTYPE))
1154 .ENDIF
1156 # decide how to link
1157 .IF "$(APP5CODETYPE)"=="C"
1158 APP5LINKER=$(LINKC)
1159 APP5STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1160 APP5LINKFLAGS+=$(LINKCFLAGS)
1161 .ELSE # "$(APP5CODETYPE)"=="C"
1162 APP5LINKER=$(LINK)
1163 APP5STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1164 APP5LINKFLAGS+=$(LINKFLAGS)
1165 .ENDIF # "$(APP5CODETYPE)"=="C"
1167 APP5RPATH*=OOO
1168 LINKFLAGSRUNPATH_$(APP5RPATH)*=/ERROR:/Bad_APP5RPATH_value
1169 .IF "$(OS)" != "MACOSX"
1170 APP5LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP5RPATH))
1171 .ENDIF
1173 .IF "$(APP5STACK)" != ""
1174 .IF "$(LINKFLAGSTACK)" != ""
1175 APP5STACKN=$(LINKFLAGSTACK)$(APP5STACK)
1176 .ENDIF
1177 .ELSE
1178 APP5STACKN=
1179 .ENDIF
1181 .IF "$(APP5NOSAL)"==""
1182 .IF "$(TARGETTYPE)" == "GUI"
1183 APP5OBJS+= $(STDOBJVCL)
1184 .ENDIF
1185 .ENDIF
1187 .IF "$(GUI)$(COM)" == "WNTGCC"
1188 APP5RESO=
1189 .IF "$(APP5LINKRES)" != "" || "$(APP5RES)" != ""
1190 APP5RESO=$(MISC)$/$(APP5TARGET:b)_res.o
1191 .ENDIF
1192 .ENDIF
1194 .IF "$(GUI)" == "UNX"
1195 APP5DEPN+:=$(APP5DEPNU)
1196 USE_APP5DEF=
1197 .ENDIF
1199 .IF "$(APP5TARGETN)"!=""
1201 .IF "$(APP5PRODUCTNAME)"!=""
1202 APP5PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP5PRODUCTNAME)\"
1203 .ENDIF # "$(APP5PRODUCTNAME)"!=""
1205 .IF "$(linkinc)"!=""
1206 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
1207 .IF "$(APP5LIBS)"!=""
1208 $(MISC)$/$(APP5TARGET)_linkinc.ls .PHONY:
1209 @@-$(RM) $@
1210 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP5LIBS) $(i:s/.lib/.lin/)) >> $@
1211 .ENDIF #"$(APP5LIBS)"!=""
1212 .ENDIF
1214 LINKINCTARGETS+=$(MISC)$/$(APP5TARGETN:b)_linkinc.ls
1215 $(APP5TARGETN) : $(LINKINCTARGETS)
1216 .ENDIF # "$(linkinc)"!=""
1218 # Allow for target specific LIBSALCPPRT override
1219 APP5LIBSALCPPRT*=$(LIBSALCPPRT)
1221 .IF "$(GUI)" == "OS2"
1222 _APP5IMP_ORD = $(APP5STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP5STDLIBS:^"$(LB)$/")
1223 APP5IMP_ORD = $(foreach,i,$(_APP5IMP_ORD) $(shell @-ls $i))
1224 .ELSE
1225 APP5IMP_ORD =
1226 .ENDIF
1228 $(APP5TARGETN): $(APP5OBJS) $(APP5LIBS) \
1229 $(APP5RES) \
1230 $(APP5IMP_ORD) \
1231 $(APP5ICON) $(APP5DEPN) $(USE_APP5DEF)
1232 @echo ------------------------------
1233 @echo "Making: " $(@:f)
1234 .IF "$(GUI)"=="UNX"
1235 .IF "$(OS)"=="MACOSX"
1236 @echo unx
1237 @-$(RM) $(MISC)$/$(@:b).list
1238 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_5.cmd
1239 @-$(RM) $(MISC)$/$(@:b).strip
1240 @echo $(STDSLO) $(APP5OBJS:s/.obj/.o/) \
1241 `cat /dev/null $(APP5LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
1242 @echo -n $(APP5LINKER) $(APP5LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
1243 $(APP5LINKTYPEFLAG) $(APP5STDLIBS) $(APP5STDLIB) $(STDLIB5) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_5.cmd
1244 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
1245 `cat $(MISC)$/$(TARGET).$(@:b)_5.cmd` \
1246 >> $(MISC)$/$(TARGET).$(@:b)_5.cmd
1247 @cat $(MISC)$/$(TARGET).$(@:b)_5.cmd
1248 @+source $(MISC)$/$(TARGET).$(@:b)_5.cmd
1249 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1250 # libraries at runtime
1251 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
1252 @strip -i -R $(MISC)$/$(@:b).strip -X $@
1253 @ls -l $@
1254 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
1255 app $(APP5RPATH) $@
1256 .IF "$(TARGETTYPE)"=="GUI"
1257 @echo "Making: " $(@:f).app
1258 @macosx-create-bundle $@
1259 .ENDIF # "$(TARGETTYPE)"=="GUI"
1260 .ELSE # "$(OS)"=="MACOSX"
1261 @echo unx
1262 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_5.cmd
1263 @echo $(APP5LINKER) $(APP5LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
1264 $(APP5OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_5.cmd
1265 @cat $(mktmp /dev/null $(APP5LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_5.cmd
1266 @echo $(APP5LINKTYPEFLAG) $(APP5LIBSALCPPRT) $(APP5STDLIBS) $(APP5STDLIB) $(STDLIB5) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_5.cmd
1267 cat $(MISC)$/$(TARGET).$(@:b)_5.cmd
1268 @+source $(MISC)$/$(TARGET).$(@:b)_5.cmd
1269 @ls -l $@
1270 .ENDIF # "$(OS)"=="MACOSX"
1271 .ENDIF
1272 .IF "$(GUI)" == "WNT"
1273 @@-$(MKDIR) $(@:d:d)
1274 .IF "$(APP5LINKRES)" != ""
1275 @@-$(RM) $(MISC)$/$(APP5LINKRES:b).rc
1276 .IF "$(APP5ICON)" != ""
1277 @-echo 1 ICON $(EMQ)"$(APP5ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP5LINKRES:b).rc
1278 .ENDIF # "$(APP5ICON)" != ""
1279 .IF "$(APP5VERINFO)" != ""
1280 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP5LINKRES:b).rc
1281 @-echo $(EMQ)#include $(EMQ)"$(APP5VERINFO)$(EMQ)" >> $(MISC)$/$(APP5LINKRES:b).rc
1282 .ENDIF # "$(APP5VERINFO)" != ""
1283 $(RC) -DWIN32 $(APP5PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP5LINKRES:b).rc
1284 .ENDIF # "$(APP5LINKRES)" != ""
1285 .IF "$(COM)" == "GCC"
1286 @echo mingw
1287 .IF "$(APP5LINKRES)" != "" || "$(APP5RES)" != ""
1288 @cat $(APP5LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP5RES)) > $(MISC)$/$(@:b)_all.res
1289 windres $(MISC)$/$(@:b)_all.res $(APP5RESO)
1290 .ENDIF
1291 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
1292 $(APP5BASEX) $(APP5STACKN) -o $@ $(APP5OBJS) \
1293 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP5RESO) \
1294 `$(TYPE) /dev/null $(APP5LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1295 $(APP_LINKTYPE) $(APP5LIBSALCPPRT) \
1296 -Wl,--start-group $(APP5STDLIBS) -Wl,--end-group $(APP5STDLIB) \
1297 $(STDLIB5) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_5.cmd
1298 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_5.cmd
1299 @+source $(MISC)$/$(TARGET).$(@:b)_5.cmd
1300 @ls -l $@
1301 .ELSE # "$(COM)" == "GCC"
1302 .IF "$(linkinc)" == ""
1303 $(APP5LINKER) @$(mktmp \
1304 $(APP5LINKFLAGS) \
1305 $(LINKFLAGSAPP) $(APP5BASEX) \
1306 $(APP5STACKN) \
1307 -out:$@ \
1308 -map:$(MISC)$/{$(subst,$/,_ $(APP5TARGET)).map} \
1309 $(STDOBJ) \
1310 $(APP5LINKRES) \
1311 $(APP5RES) \
1312 $(APP5OBJS) \
1313 $(APP5LIBS) \
1314 $(APP5STDLIBS) \
1315 $(APP5STDLIB) $(STDLIB5) \
1317 @-echo linking $@.manifest ...
1318 .IF "$(VISTA_MANIFEST)"!=""
1319 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1320 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1321 .ELSE
1322 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1323 .ENDIF # "$(VISTA_MANIFEST)"!=""
1324 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1325 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1326 .ELSE
1327 -$(RM) $(MISC)\$(APP5TARGET).lnk
1328 -$(RM) $(MISC)\$(APP5TARGET).lst
1329 -$(RM) $(MISC)\linkobj.lst
1330 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1331 type $(mktmp,$(MISC)\$(APP5TARGET).lst
1332 $(APP5LINKFLAGS) \
1333 $(LINKFLAGSAPP) $(APP5BASEX) \
1334 $(APP5STACKN) \
1335 -out:$@ \
1336 $(STDOBJ) \
1337 $(APP5LINKRES) \
1338 $(APP5RES) \
1339 $(APP5OBJS) \
1340 $(APP5LIBS) \
1341 $(APP5STDLIBS) \
1342 $(APP5STDLIB) $(STDLIB5))
1343 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP5TARGETN:b)_linkobj.lst >> $(MISC)\$(APP5TARGET).lst
1344 $(IFEXIST) $(MISC)$/$(APP5TARGET).lst $(THEN) type $(MISC)$/$(APP5TARGET).lst >> $(MISC)$/$(APP5TARGET).lnk $(FI)
1345 $(APP5LINKER) @$(MISC)\$(APP5TARGET).lnk
1346 .ENDIF # "$(linkinc)" == ""
1347 .ENDIF # "$(COM)" == "GCC"
1348 .IF "$(APP5TARGET)" == "loader"
1349 $(PERL) loader.pl $@
1350 .IF "$(USE_SHELL)"=="4nt"
1351 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1352 .ELSE # "$(USE_SHELL)"=="4nt"
1353 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1354 .ENDIF # "$(USE_SHELL)"=="4nt"
1355 $(RM) $@
1356 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1357 .ENDIF # "$(TARGET)" == "setup"
1359 .ENDIF # "$(GUI)" == "WNT"
1361 .IF "$(GUI)" == "OS2"
1362 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
1363 .IF "$(APP5LINKRES)" != ""
1364 @+-$(RM) $(MISC)$/$(APP5LINKRES:b).rc >& $(NULLDEV)
1365 .IF "$(APP5ICON)" != ""
1366 .IF "$(USE_SHELL)"=="4nt"
1367 @-+echo ICON 1 "$(APP5ICON:s/\/\\/)" >> $(MISC)$/$(APP5LINKRES:b).rc
1368 .ELSE # "$(USE_SHELL)"=="4nt"
1369 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP5ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP5LINKRES:b).rc
1370 .ENDIF # "$(USE_SHELL)"=="4nt"
1371 .ENDIF # "$(APP5ICON)" != ""
1372 .IF "$(APP5VERINFO)" != ""
1373 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP5LINKRES:b).rc
1374 @-+echo $(EMQ)#include $(EMQ)"$(APP5VERINFO)$(EMQ)" >> $(MISC)$/$(APP5LINKRES:b).rc
1375 .ENDIF # "$(APP5VERINFO)" != ""
1376 $(RC) -r -DOS2 $(APP5PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP5LINKRES:b).rc
1377 .ENDIF # "$(APP5LINKRES)" != ""
1379 .IF "$(TARGETTYPE)" == "GUI"
1380 @echo NAME $(APP5TARGET) WINDOWAPI > $(MISC)$/$(APP5TARGET).def
1381 .ENDIF
1383 @+echo $(APP5LINKFLAGS) \
1384 $(LINKFLAGSAPP) $(APP5BASEX) \
1385 $(APP5STACKN) \
1386 -o $@ \
1387 -Zmap -L$(LB) \
1388 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1389 $(STDOBJ) \
1390 $(APP5LINKRES) \
1391 $(APP5RES) \
1392 $(APP5DEF) \
1393 $(APP5OBJS) \
1394 $(APP5LIBS) \
1395 $(APP5STDLIBS:^"-l") \
1396 $(APP5STDLIB:^"-l") $(STDLIB5:^"-l")
1397 $(APP5LINKER) -v \
1398 $(APP5LINKFLAGS) \
1399 $(LINKFLAGSAPP) $(APP5BASEX) \
1400 $(APP5STACKN) \
1401 -o $@ \
1402 -Zmap -L$(LB) \
1403 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1404 $(STDOBJ) \
1405 $(APP5LINKRES) \
1406 $(APP5RES) \
1407 $(APP5DEF) \
1408 $(APP5OBJS) \
1409 $(APP5LIBS) \
1410 $(APP5STDLIBS:^"-l") \
1411 $(APP5STDLIB:^"-l") $(STDLIB5:^"-l")
1414 .IF "$(APP5TARGET)" == "loader"
1415 +$(PERL) loader.pl $@
1416 .IF "$(USE_SHELL)"=="4nt"
1417 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1418 .ELSE # "$(USE_SHELL)"=="4nt"
1419 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1420 .ENDIF # "$(USE_SHELL)"=="4nt"
1421 +$(RM) $@
1422 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1423 .ENDIF # "$(TARGET)" == "setup"
1425 .ENDIF # "$(GUI)" == "OS2"
1427 .ENDIF # "$(APP5TARGETN)"!=""
1430 # Instruction for linking
1431 # unroll begin
1433 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
1434 APP6DEF = $(MISC)$/$(APP6TARGET).def
1435 .ENDIF
1437 .IF "$(APP6LINKTYPE)" != ""
1438 #must be either STATIC or SHARED
1439 APP6LINKTYPEFLAG=$(APPLINK$(APP6LINKTYPE))
1440 .ENDIF
1442 # decide how to link
1443 .IF "$(APP6CODETYPE)"=="C"
1444 APP6LINKER=$(LINKC)
1445 APP6STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1446 APP6LINKFLAGS+=$(LINKCFLAGS)
1447 .ELSE # "$(APP6CODETYPE)"=="C"
1448 APP6LINKER=$(LINK)
1449 APP6STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1450 APP6LINKFLAGS+=$(LINKFLAGS)
1451 .ENDIF # "$(APP6CODETYPE)"=="C"
1453 APP6RPATH*=OOO
1454 LINKFLAGSRUNPATH_$(APP6RPATH)*=/ERROR:/Bad_APP6RPATH_value
1455 .IF "$(OS)" != "MACOSX"
1456 APP6LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP6RPATH))
1457 .ENDIF
1459 .IF "$(APP6STACK)" != ""
1460 .IF "$(LINKFLAGSTACK)" != ""
1461 APP6STACKN=$(LINKFLAGSTACK)$(APP6STACK)
1462 .ENDIF
1463 .ELSE
1464 APP6STACKN=
1465 .ENDIF
1467 .IF "$(APP6NOSAL)"==""
1468 .IF "$(TARGETTYPE)" == "GUI"
1469 APP6OBJS+= $(STDOBJVCL)
1470 .ENDIF
1471 .ENDIF
1473 .IF "$(GUI)$(COM)" == "WNTGCC"
1474 APP6RESO=
1475 .IF "$(APP6LINKRES)" != "" || "$(APP6RES)" != ""
1476 APP6RESO=$(MISC)$/$(APP6TARGET:b)_res.o
1477 .ENDIF
1478 .ENDIF
1480 .IF "$(GUI)" == "UNX"
1481 APP6DEPN+:=$(APP6DEPNU)
1482 USE_APP6DEF=
1483 .ENDIF
1485 .IF "$(APP6TARGETN)"!=""
1487 .IF "$(APP6PRODUCTNAME)"!=""
1488 APP6PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP6PRODUCTNAME)\"
1489 .ENDIF # "$(APP6PRODUCTNAME)"!=""
1491 .IF "$(linkinc)"!=""
1492 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
1493 .IF "$(APP6LIBS)"!=""
1494 $(MISC)$/$(APP6TARGET)_linkinc.ls .PHONY:
1495 @@-$(RM) $@
1496 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP6LIBS) $(i:s/.lib/.lin/)) >> $@
1497 .ENDIF #"$(APP6LIBS)"!=""
1498 .ENDIF
1500 LINKINCTARGETS+=$(MISC)$/$(APP6TARGETN:b)_linkinc.ls
1501 $(APP6TARGETN) : $(LINKINCTARGETS)
1502 .ENDIF # "$(linkinc)"!=""
1504 # Allow for target specific LIBSALCPPRT override
1505 APP6LIBSALCPPRT*=$(LIBSALCPPRT)
1507 .IF "$(GUI)" == "OS2"
1508 _APP6IMP_ORD = $(APP6STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP6STDLIBS:^"$(LB)$/")
1509 APP6IMP_ORD = $(foreach,i,$(_APP6IMP_ORD) $(shell @-ls $i))
1510 .ELSE
1511 APP6IMP_ORD =
1512 .ENDIF
1514 $(APP6TARGETN): $(APP6OBJS) $(APP6LIBS) \
1515 $(APP6RES) \
1516 $(APP6IMP_ORD) \
1517 $(APP6ICON) $(APP6DEPN) $(USE_APP6DEF)
1518 @echo ------------------------------
1519 @echo "Making: " $(@:f)
1520 .IF "$(GUI)"=="UNX"
1521 .IF "$(OS)"=="MACOSX"
1522 @echo unx
1523 @-$(RM) $(MISC)$/$(@:b).list
1524 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_6.cmd
1525 @-$(RM) $(MISC)$/$(@:b).strip
1526 @echo $(STDSLO) $(APP6OBJS:s/.obj/.o/) \
1527 `cat /dev/null $(APP6LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
1528 @echo -n $(APP6LINKER) $(APP6LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
1529 $(APP6LINKTYPEFLAG) $(APP6STDLIBS) $(APP6STDLIB) $(STDLIB6) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_6.cmd
1530 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
1531 `cat $(MISC)$/$(TARGET).$(@:b)_6.cmd` \
1532 >> $(MISC)$/$(TARGET).$(@:b)_6.cmd
1533 @cat $(MISC)$/$(TARGET).$(@:b)_6.cmd
1534 @+source $(MISC)$/$(TARGET).$(@:b)_6.cmd
1535 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1536 # libraries at runtime
1537 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
1538 @strip -i -R $(MISC)$/$(@:b).strip -X $@
1539 @ls -l $@
1540 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
1541 app $(APP6RPATH) $@
1542 .IF "$(TARGETTYPE)"=="GUI"
1543 @echo "Making: " $(@:f).app
1544 @macosx-create-bundle $@
1545 .ENDIF # "$(TARGETTYPE)"=="GUI"
1546 .ELSE # "$(OS)"=="MACOSX"
1547 @echo unx
1548 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_6.cmd
1549 @echo $(APP6LINKER) $(APP6LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
1550 $(APP6OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_6.cmd
1551 @cat $(mktmp /dev/null $(APP6LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_6.cmd
1552 @echo $(APP6LINKTYPEFLAG) $(APP6LIBSALCPPRT) $(APP6STDLIBS) $(APP6STDLIB) $(STDLIB6) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_6.cmd
1553 cat $(MISC)$/$(TARGET).$(@:b)_6.cmd
1554 @+source $(MISC)$/$(TARGET).$(@:b)_6.cmd
1555 @ls -l $@
1556 .ENDIF # "$(OS)"=="MACOSX"
1557 .ENDIF
1558 .IF "$(GUI)" == "WNT"
1559 @@-$(MKDIR) $(@:d:d)
1560 .IF "$(APP6LINKRES)" != ""
1561 @@-$(RM) $(MISC)$/$(APP6LINKRES:b).rc
1562 .IF "$(APP6ICON)" != ""
1563 @-echo 1 ICON $(EMQ)"$(APP6ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP6LINKRES:b).rc
1564 .ENDIF # "$(APP6ICON)" != ""
1565 .IF "$(APP6VERINFO)" != ""
1566 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP6LINKRES:b).rc
1567 @-echo $(EMQ)#include $(EMQ)"$(APP6VERINFO)$(EMQ)" >> $(MISC)$/$(APP6LINKRES:b).rc
1568 .ENDIF # "$(APP6VERINFO)" != ""
1569 $(RC) -DWIN32 $(APP6PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP6LINKRES:b).rc
1570 .ENDIF # "$(APP6LINKRES)" != ""
1571 .IF "$(COM)" == "GCC"
1572 @echo mingw
1573 .IF "$(APP6LINKRES)" != "" || "$(APP6RES)" != ""
1574 @cat $(APP6LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP6RES)) > $(MISC)$/$(@:b)_all.res
1575 windres $(MISC)$/$(@:b)_all.res $(APP6RESO)
1576 .ENDIF
1577 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
1578 $(APP6BASEX) $(APP6STACKN) -o $@ $(APP6OBJS) \
1579 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP6RESO) \
1580 `$(TYPE) /dev/null $(APP6LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1581 $(APP_LINKTYPE) $(APP6LIBSALCPPRT) \
1582 -Wl,--start-group $(APP6STDLIBS) -Wl,--end-group $(APP6STDLIB) \
1583 $(STDLIB6) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_6.cmd
1584 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_6.cmd
1585 @+source $(MISC)$/$(TARGET).$(@:b)_6.cmd
1586 @ls -l $@
1587 .ELSE # "$(COM)" == "GCC"
1588 .IF "$(linkinc)" == ""
1589 $(APP6LINKER) @$(mktmp \
1590 $(APP6LINKFLAGS) \
1591 $(LINKFLAGSAPP) $(APP6BASEX) \
1592 $(APP6STACKN) \
1593 -out:$@ \
1594 -map:$(MISC)$/{$(subst,$/,_ $(APP6TARGET)).map} \
1595 $(STDOBJ) \
1596 $(APP6LINKRES) \
1597 $(APP6RES) \
1598 $(APP6OBJS) \
1599 $(APP6LIBS) \
1600 $(APP6STDLIBS) \
1601 $(APP6STDLIB) $(STDLIB6) \
1603 @-echo linking $@.manifest ...
1604 .IF "$(VISTA_MANIFEST)"!=""
1605 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1606 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1607 .ELSE
1608 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1609 .ENDIF # "$(VISTA_MANIFEST)"!=""
1610 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1611 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1612 .ELSE
1613 -$(RM) $(MISC)\$(APP6TARGET).lnk
1614 -$(RM) $(MISC)\$(APP6TARGET).lst
1615 -$(RM) $(MISC)\linkobj.lst
1616 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1617 type $(mktmp,$(MISC)\$(APP6TARGET).lst
1618 $(APP6LINKFLAGS) \
1619 $(LINKFLAGSAPP) $(APP6BASEX) \
1620 $(APP6STACKN) \
1621 -out:$@ \
1622 $(STDOBJ) \
1623 $(APP6LINKRES) \
1624 $(APP6RES) \
1625 $(APP6OBJS) \
1626 $(APP6LIBS) \
1627 $(APP6STDLIBS) \
1628 $(APP6STDLIB) $(STDLIB6))
1629 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP6TARGETN:b)_linkobj.lst >> $(MISC)\$(APP6TARGET).lst
1630 $(IFEXIST) $(MISC)$/$(APP6TARGET).lst $(THEN) type $(MISC)$/$(APP6TARGET).lst >> $(MISC)$/$(APP6TARGET).lnk $(FI)
1631 $(APP6LINKER) @$(MISC)\$(APP6TARGET).lnk
1632 .ENDIF # "$(linkinc)" == ""
1633 .ENDIF # "$(COM)" == "GCC"
1634 .IF "$(APP6TARGET)" == "loader"
1635 $(PERL) loader.pl $@
1636 .IF "$(USE_SHELL)"=="4nt"
1637 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1638 .ELSE # "$(USE_SHELL)"=="4nt"
1639 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1640 .ENDIF # "$(USE_SHELL)"=="4nt"
1641 $(RM) $@
1642 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1643 .ENDIF # "$(TARGET)" == "setup"
1645 .ENDIF # "$(GUI)" == "WNT"
1647 .IF "$(GUI)" == "OS2"
1648 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
1649 .IF "$(APP6LINKRES)" != ""
1650 @+-$(RM) $(MISC)$/$(APP6LINKRES:b).rc >& $(NULLDEV)
1651 .IF "$(APP6ICON)" != ""
1652 .IF "$(USE_SHELL)"=="4nt"
1653 @-+echo ICON 1 "$(APP6ICON:s/\/\\/)" >> $(MISC)$/$(APP6LINKRES:b).rc
1654 .ELSE # "$(USE_SHELL)"=="4nt"
1655 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP6ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP6LINKRES:b).rc
1656 .ENDIF # "$(USE_SHELL)"=="4nt"
1657 .ENDIF # "$(APP6ICON)" != ""
1658 .IF "$(APP6VERINFO)" != ""
1659 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP6LINKRES:b).rc
1660 @-+echo $(EMQ)#include $(EMQ)"$(APP6VERINFO)$(EMQ)" >> $(MISC)$/$(APP6LINKRES:b).rc
1661 .ENDIF # "$(APP6VERINFO)" != ""
1662 $(RC) -r -DOS2 $(APP6PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP6LINKRES:b).rc
1663 .ENDIF # "$(APP6LINKRES)" != ""
1665 .IF "$(TARGETTYPE)" == "GUI"
1666 @echo NAME $(APP6TARGET) WINDOWAPI > $(MISC)$/$(APP6TARGET).def
1667 .ENDIF
1669 @+echo $(APP6LINKFLAGS) \
1670 $(LINKFLAGSAPP) $(APP6BASEX) \
1671 $(APP6STACKN) \
1672 -o $@ \
1673 -Zmap -L$(LB) \
1674 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1675 $(STDOBJ) \
1676 $(APP6LINKRES) \
1677 $(APP6RES) \
1678 $(APP6DEF) \
1679 $(APP6OBJS) \
1680 $(APP6LIBS) \
1681 $(APP6STDLIBS:^"-l") \
1682 $(APP6STDLIB:^"-l") $(STDLIB6:^"-l")
1683 $(APP6LINKER) -v \
1684 $(APP6LINKFLAGS) \
1685 $(LINKFLAGSAPP) $(APP6BASEX) \
1686 $(APP6STACKN) \
1687 -o $@ \
1688 -Zmap -L$(LB) \
1689 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1690 $(STDOBJ) \
1691 $(APP6LINKRES) \
1692 $(APP6RES) \
1693 $(APP6DEF) \
1694 $(APP6OBJS) \
1695 $(APP6LIBS) \
1696 $(APP6STDLIBS:^"-l") \
1697 $(APP6STDLIB:^"-l") $(STDLIB6:^"-l")
1700 .IF "$(APP6TARGET)" == "loader"
1701 +$(PERL) loader.pl $@
1702 .IF "$(USE_SHELL)"=="4nt"
1703 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1704 .ELSE # "$(USE_SHELL)"=="4nt"
1705 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1706 .ENDIF # "$(USE_SHELL)"=="4nt"
1707 +$(RM) $@
1708 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1709 .ENDIF # "$(TARGET)" == "setup"
1711 .ENDIF # "$(GUI)" == "OS2"
1713 .ENDIF # "$(APP6TARGETN)"!=""
1716 # Instruction for linking
1717 # unroll begin
1719 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
1720 APP7DEF = $(MISC)$/$(APP7TARGET).def
1721 .ENDIF
1723 .IF "$(APP7LINKTYPE)" != ""
1724 #must be either STATIC or SHARED
1725 APP7LINKTYPEFLAG=$(APPLINK$(APP7LINKTYPE))
1726 .ENDIF
1728 # decide how to link
1729 .IF "$(APP7CODETYPE)"=="C"
1730 APP7LINKER=$(LINKC)
1731 APP7STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1732 APP7LINKFLAGS+=$(LINKCFLAGS)
1733 .ELSE # "$(APP7CODETYPE)"=="C"
1734 APP7LINKER=$(LINK)
1735 APP7STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1736 APP7LINKFLAGS+=$(LINKFLAGS)
1737 .ENDIF # "$(APP7CODETYPE)"=="C"
1739 APP7RPATH*=OOO
1740 LINKFLAGSRUNPATH_$(APP7RPATH)*=/ERROR:/Bad_APP7RPATH_value
1741 .IF "$(OS)" != "MACOSX"
1742 APP7LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP7RPATH))
1743 .ENDIF
1745 .IF "$(APP7STACK)" != ""
1746 .IF "$(LINKFLAGSTACK)" != ""
1747 APP7STACKN=$(LINKFLAGSTACK)$(APP7STACK)
1748 .ENDIF
1749 .ELSE
1750 APP7STACKN=
1751 .ENDIF
1753 .IF "$(APP7NOSAL)"==""
1754 .IF "$(TARGETTYPE)" == "GUI"
1755 APP7OBJS+= $(STDOBJVCL)
1756 .ENDIF
1757 .ENDIF
1759 .IF "$(GUI)$(COM)" == "WNTGCC"
1760 APP7RESO=
1761 .IF "$(APP7LINKRES)" != "" || "$(APP7RES)" != ""
1762 APP7RESO=$(MISC)$/$(APP7TARGET:b)_res.o
1763 .ENDIF
1764 .ENDIF
1766 .IF "$(GUI)" == "UNX"
1767 APP7DEPN+:=$(APP7DEPNU)
1768 USE_APP7DEF=
1769 .ENDIF
1771 .IF "$(APP7TARGETN)"!=""
1773 .IF "$(APP7PRODUCTNAME)"!=""
1774 APP7PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP7PRODUCTNAME)\"
1775 .ENDIF # "$(APP7PRODUCTNAME)"!=""
1777 .IF "$(linkinc)"!=""
1778 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
1779 .IF "$(APP7LIBS)"!=""
1780 $(MISC)$/$(APP7TARGET)_linkinc.ls .PHONY:
1781 @@-$(RM) $@
1782 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP7LIBS) $(i:s/.lib/.lin/)) >> $@
1783 .ENDIF #"$(APP7LIBS)"!=""
1784 .ENDIF
1786 LINKINCTARGETS+=$(MISC)$/$(APP7TARGETN:b)_linkinc.ls
1787 $(APP7TARGETN) : $(LINKINCTARGETS)
1788 .ENDIF # "$(linkinc)"!=""
1790 # Allow for target specific LIBSALCPPRT override
1791 APP7LIBSALCPPRT*=$(LIBSALCPPRT)
1793 .IF "$(GUI)" == "OS2"
1794 _APP7IMP_ORD = $(APP7STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP7STDLIBS:^"$(LB)$/")
1795 APP7IMP_ORD = $(foreach,i,$(_APP7IMP_ORD) $(shell @-ls $i))
1796 .ELSE
1797 APP7IMP_ORD =
1798 .ENDIF
1800 $(APP7TARGETN): $(APP7OBJS) $(APP7LIBS) \
1801 $(APP7RES) \
1802 $(APP7IMP_ORD) \
1803 $(APP7ICON) $(APP7DEPN) $(USE_APP7DEF)
1804 @echo ------------------------------
1805 @echo "Making: " $(@:f)
1806 .IF "$(GUI)"=="UNX"
1807 .IF "$(OS)"=="MACOSX"
1808 @echo unx
1809 @-$(RM) $(MISC)$/$(@:b).list
1810 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_7.cmd
1811 @-$(RM) $(MISC)$/$(@:b).strip
1812 @echo $(STDSLO) $(APP7OBJS:s/.obj/.o/) \
1813 `cat /dev/null $(APP7LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
1814 @echo -n $(APP7LINKER) $(APP7LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
1815 $(APP7LINKTYPEFLAG) $(APP7STDLIBS) $(APP7STDLIB) $(STDLIB7) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_7.cmd
1816 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
1817 `cat $(MISC)$/$(TARGET).$(@:b)_7.cmd` \
1818 >> $(MISC)$/$(TARGET).$(@:b)_7.cmd
1819 @cat $(MISC)$/$(TARGET).$(@:b)_7.cmd
1820 @+source $(MISC)$/$(TARGET).$(@:b)_7.cmd
1821 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1822 # libraries at runtime
1823 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
1824 @strip -i -R $(MISC)$/$(@:b).strip -X $@
1825 @ls -l $@
1826 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
1827 app $(APP7RPATH) $@
1828 .IF "$(TARGETTYPE)"=="GUI"
1829 @echo "Making: " $(@:f).app
1830 @macosx-create-bundle $@
1831 .ENDIF # "$(TARGETTYPE)"=="GUI"
1832 .ELSE # "$(OS)"=="MACOSX"
1833 @echo unx
1834 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_7.cmd
1835 @echo $(APP7LINKER) $(APP7LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
1836 $(APP7OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_7.cmd
1837 @cat $(mktmp /dev/null $(APP7LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_7.cmd
1838 @echo $(APP7LINKTYPEFLAG) $(APP7LIBSALCPPRT) $(APP7STDLIBS) $(APP7STDLIB) $(STDLIB7) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_7.cmd
1839 cat $(MISC)$/$(TARGET).$(@:b)_7.cmd
1840 @+source $(MISC)$/$(TARGET).$(@:b)_7.cmd
1841 @ls -l $@
1842 .ENDIF # "$(OS)"=="MACOSX"
1843 .ENDIF
1844 .IF "$(GUI)" == "WNT"
1845 @@-$(MKDIR) $(@:d:d)
1846 .IF "$(APP7LINKRES)" != ""
1847 @@-$(RM) $(MISC)$/$(APP7LINKRES:b).rc
1848 .IF "$(APP7ICON)" != ""
1849 @-echo 1 ICON $(EMQ)"$(APP7ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP7LINKRES:b).rc
1850 .ENDIF # "$(APP7ICON)" != ""
1851 .IF "$(APP7VERINFO)" != ""
1852 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP7LINKRES:b).rc
1853 @-echo $(EMQ)#include $(EMQ)"$(APP7VERINFO)$(EMQ)" >> $(MISC)$/$(APP7LINKRES:b).rc
1854 .ENDIF # "$(APP7VERINFO)" != ""
1855 $(RC) -DWIN32 $(APP7PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP7LINKRES:b).rc
1856 .ENDIF # "$(APP7LINKRES)" != ""
1857 .IF "$(COM)" == "GCC"
1858 @echo mingw
1859 .IF "$(APP7LINKRES)" != "" || "$(APP7RES)" != ""
1860 @cat $(APP7LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP7RES)) > $(MISC)$/$(@:b)_all.res
1861 windres $(MISC)$/$(@:b)_all.res $(APP7RESO)
1862 .ENDIF
1863 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
1864 $(APP7BASEX) $(APP7STACKN) -o $@ $(APP7OBJS) \
1865 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP7RESO) \
1866 `$(TYPE) /dev/null $(APP7LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1867 $(APP_LINKTYPE) $(APP7LIBSALCPPRT) \
1868 -Wl,--start-group $(APP7STDLIBS) -Wl,--end-group $(APP7STDLIB) \
1869 $(STDLIB7) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_7.cmd
1870 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_7.cmd
1871 @+source $(MISC)$/$(TARGET).$(@:b)_7.cmd
1872 @ls -l $@
1873 .ELSE # "$(COM)" == "GCC"
1874 .IF "$(linkinc)" == ""
1875 $(APP7LINKER) @$(mktmp \
1876 $(APP7LINKFLAGS) \
1877 $(LINKFLAGSAPP) $(APP7BASEX) \
1878 $(APP7STACKN) \
1879 -out:$@ \
1880 -map:$(MISC)$/{$(subst,$/,_ $(APP7TARGET)).map} \
1881 $(STDOBJ) \
1882 $(APP7LINKRES) \
1883 $(APP7RES) \
1884 $(APP7OBJS) \
1885 $(APP7LIBS) \
1886 $(APP7STDLIBS) \
1887 $(APP7STDLIB) $(STDLIB7) \
1889 @-echo linking $@.manifest ...
1890 .IF "$(VISTA_MANIFEST)"!=""
1891 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1892 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1893 .ELSE
1894 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1895 .ENDIF # "$(VISTA_MANIFEST)"!=""
1896 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1897 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1898 .ELSE
1899 -$(RM) $(MISC)\$(APP7TARGET).lnk
1900 -$(RM) $(MISC)\$(APP7TARGET).lst
1901 -$(RM) $(MISC)\linkobj.lst
1902 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1903 type $(mktmp,$(MISC)\$(APP7TARGET).lst
1904 $(APP7LINKFLAGS) \
1905 $(LINKFLAGSAPP) $(APP7BASEX) \
1906 $(APP7STACKN) \
1907 -out:$@ \
1908 $(STDOBJ) \
1909 $(APP7LINKRES) \
1910 $(APP7RES) \
1911 $(APP7OBJS) \
1912 $(APP7LIBS) \
1913 $(APP7STDLIBS) \
1914 $(APP7STDLIB) $(STDLIB7))
1915 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP7TARGETN:b)_linkobj.lst >> $(MISC)\$(APP7TARGET).lst
1916 $(IFEXIST) $(MISC)$/$(APP7TARGET).lst $(THEN) type $(MISC)$/$(APP7TARGET).lst >> $(MISC)$/$(APP7TARGET).lnk $(FI)
1917 $(APP7LINKER) @$(MISC)\$(APP7TARGET).lnk
1918 .ENDIF # "$(linkinc)" == ""
1919 .ENDIF # "$(COM)" == "GCC"
1920 .IF "$(APP7TARGET)" == "loader"
1921 $(PERL) loader.pl $@
1922 .IF "$(USE_SHELL)"=="4nt"
1923 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1924 .ELSE # "$(USE_SHELL)"=="4nt"
1925 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1926 .ENDIF # "$(USE_SHELL)"=="4nt"
1927 $(RM) $@
1928 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1929 .ENDIF # "$(TARGET)" == "setup"
1931 .ENDIF # "$(GUI)" == "WNT"
1933 .IF "$(GUI)" == "OS2"
1934 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
1935 .IF "$(APP7LINKRES)" != ""
1936 @+-$(RM) $(MISC)$/$(APP7LINKRES:b).rc >& $(NULLDEV)
1937 .IF "$(APP7ICON)" != ""
1938 .IF "$(USE_SHELL)"=="4nt"
1939 @-+echo ICON 1 "$(APP7ICON:s/\/\\/)" >> $(MISC)$/$(APP7LINKRES:b).rc
1940 .ELSE # "$(USE_SHELL)"=="4nt"
1941 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP7ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP7LINKRES:b).rc
1942 .ENDIF # "$(USE_SHELL)"=="4nt"
1943 .ENDIF # "$(APP7ICON)" != ""
1944 .IF "$(APP7VERINFO)" != ""
1945 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP7LINKRES:b).rc
1946 @-+echo $(EMQ)#include $(EMQ)"$(APP7VERINFO)$(EMQ)" >> $(MISC)$/$(APP7LINKRES:b).rc
1947 .ENDIF # "$(APP7VERINFO)" != ""
1948 $(RC) -r -DOS2 $(APP7PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP7LINKRES:b).rc
1949 .ENDIF # "$(APP7LINKRES)" != ""
1951 .IF "$(TARGETTYPE)" == "GUI"
1952 @echo NAME $(APP7TARGET) WINDOWAPI > $(MISC)$/$(APP7TARGET).def
1953 .ENDIF
1955 @+echo $(APP7LINKFLAGS) \
1956 $(LINKFLAGSAPP) $(APP7BASEX) \
1957 $(APP7STACKN) \
1958 -o $@ \
1959 -Zmap -L$(LB) \
1960 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1961 $(STDOBJ) \
1962 $(APP7LINKRES) \
1963 $(APP7RES) \
1964 $(APP7DEF) \
1965 $(APP7OBJS) \
1966 $(APP7LIBS) \
1967 $(APP7STDLIBS:^"-l") \
1968 $(APP7STDLIB:^"-l") $(STDLIB7:^"-l")
1969 $(APP7LINKER) -v \
1970 $(APP7LINKFLAGS) \
1971 $(LINKFLAGSAPP) $(APP7BASEX) \
1972 $(APP7STACKN) \
1973 -o $@ \
1974 -Zmap -L$(LB) \
1975 -L$(SOLARVERSION)$/$(INPATH)$/lib \
1976 $(STDOBJ) \
1977 $(APP7LINKRES) \
1978 $(APP7RES) \
1979 $(APP7DEF) \
1980 $(APP7OBJS) \
1981 $(APP7LIBS) \
1982 $(APP7STDLIBS:^"-l") \
1983 $(APP7STDLIB:^"-l") $(STDLIB7:^"-l")
1986 .IF "$(APP7TARGET)" == "loader"
1987 +$(PERL) loader.pl $@
1988 .IF "$(USE_SHELL)"=="4nt"
1989 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
1990 .ELSE # "$(USE_SHELL)"=="4nt"
1991 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1992 .ENDIF # "$(USE_SHELL)"=="4nt"
1993 +$(RM) $@
1994 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1995 .ENDIF # "$(TARGET)" == "setup"
1997 .ENDIF # "$(GUI)" == "OS2"
1999 .ENDIF # "$(APP7TARGETN)"!=""
2002 # Instruction for linking
2003 # unroll begin
2005 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
2006 APP8DEF = $(MISC)$/$(APP8TARGET).def
2007 .ENDIF
2009 .IF "$(APP8LINKTYPE)" != ""
2010 #must be either STATIC or SHARED
2011 APP8LINKTYPEFLAG=$(APPLINK$(APP8LINKTYPE))
2012 .ENDIF
2014 # decide how to link
2015 .IF "$(APP8CODETYPE)"=="C"
2016 APP8LINKER=$(LINKC)
2017 APP8STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
2018 APP8LINKFLAGS+=$(LINKCFLAGS)
2019 .ELSE # "$(APP8CODETYPE)"=="C"
2020 APP8LINKER=$(LINK)
2021 APP8STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
2022 APP8LINKFLAGS+=$(LINKFLAGS)
2023 .ENDIF # "$(APP8CODETYPE)"=="C"
2025 APP8RPATH*=OOO
2026 LINKFLAGSRUNPATH_$(APP8RPATH)*=/ERROR:/Bad_APP8RPATH_value
2027 .IF "$(OS)" != "MACOSX"
2028 APP8LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP8RPATH))
2029 .ENDIF
2031 .IF "$(APP8STACK)" != ""
2032 .IF "$(LINKFLAGSTACK)" != ""
2033 APP8STACKN=$(LINKFLAGSTACK)$(APP8STACK)
2034 .ENDIF
2035 .ELSE
2036 APP8STACKN=
2037 .ENDIF
2039 .IF "$(APP8NOSAL)"==""
2040 .IF "$(TARGETTYPE)" == "GUI"
2041 APP8OBJS+= $(STDOBJVCL)
2042 .ENDIF
2043 .ENDIF
2045 .IF "$(GUI)$(COM)" == "WNTGCC"
2046 APP8RESO=
2047 .IF "$(APP8LINKRES)" != "" || "$(APP8RES)" != ""
2048 APP8RESO=$(MISC)$/$(APP8TARGET:b)_res.o
2049 .ENDIF
2050 .ENDIF
2052 .IF "$(GUI)" == "UNX"
2053 APP8DEPN+:=$(APP8DEPNU)
2054 USE_APP8DEF=
2055 .ENDIF
2057 .IF "$(APP8TARGETN)"!=""
2059 .IF "$(APP8PRODUCTNAME)"!=""
2060 APP8PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP8PRODUCTNAME)\"
2061 .ENDIF # "$(APP8PRODUCTNAME)"!=""
2063 .IF "$(linkinc)"!=""
2064 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
2065 .IF "$(APP8LIBS)"!=""
2066 $(MISC)$/$(APP8TARGET)_linkinc.ls .PHONY:
2067 @@-$(RM) $@
2068 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP8LIBS) $(i:s/.lib/.lin/)) >> $@
2069 .ENDIF #"$(APP8LIBS)"!=""
2070 .ENDIF
2072 LINKINCTARGETS+=$(MISC)$/$(APP8TARGETN:b)_linkinc.ls
2073 $(APP8TARGETN) : $(LINKINCTARGETS)
2074 .ENDIF # "$(linkinc)"!=""
2076 # Allow for target specific LIBSALCPPRT override
2077 APP8LIBSALCPPRT*=$(LIBSALCPPRT)
2079 .IF "$(GUI)" == "OS2"
2080 _APP8IMP_ORD = $(APP8STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP8STDLIBS:^"$(LB)$/")
2081 APP8IMP_ORD = $(foreach,i,$(_APP8IMP_ORD) $(shell @-ls $i))
2082 .ELSE
2083 APP8IMP_ORD =
2084 .ENDIF
2086 $(APP8TARGETN): $(APP8OBJS) $(APP8LIBS) \
2087 $(APP8RES) \
2088 $(APP8IMP_ORD) \
2089 $(APP8ICON) $(APP8DEPN) $(USE_APP8DEF)
2090 @echo ------------------------------
2091 @echo "Making: " $(@:f)
2092 .IF "$(GUI)"=="UNX"
2093 .IF "$(OS)"=="MACOSX"
2094 @echo unx
2095 @-$(RM) $(MISC)$/$(@:b).list
2096 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_8.cmd
2097 @-$(RM) $(MISC)$/$(@:b).strip
2098 @echo $(STDSLO) $(APP8OBJS:s/.obj/.o/) \
2099 `cat /dev/null $(APP8LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
2100 @echo -n $(APP8LINKER) $(APP8LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
2101 $(APP8LINKTYPEFLAG) $(APP8STDLIBS) $(APP8STDLIB) $(STDLIB8) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_8.cmd
2102 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
2103 `cat $(MISC)$/$(TARGET).$(@:b)_8.cmd` \
2104 >> $(MISC)$/$(TARGET).$(@:b)_8.cmd
2105 @cat $(MISC)$/$(TARGET).$(@:b)_8.cmd
2106 @+source $(MISC)$/$(TARGET).$(@:b)_8.cmd
2107 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
2108 # libraries at runtime
2109 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
2110 @strip -i -R $(MISC)$/$(@:b).strip -X $@
2111 @ls -l $@
2112 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
2113 app $(APP8RPATH) $@
2114 .IF "$(TARGETTYPE)"=="GUI"
2115 @echo "Making: " $(@:f).app
2116 @macosx-create-bundle $@
2117 .ENDIF # "$(TARGETTYPE)"=="GUI"
2118 .ELSE # "$(OS)"=="MACOSX"
2119 @echo unx
2120 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_8.cmd
2121 @echo $(APP8LINKER) $(APP8LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
2122 $(APP8OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_8.cmd
2123 @cat $(mktmp /dev/null $(APP8LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_8.cmd
2124 @echo $(APP8LINKTYPEFLAG) $(APP8LIBSALCPPRT) $(APP8STDLIBS) $(APP8STDLIB) $(STDLIB8) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_8.cmd
2125 cat $(MISC)$/$(TARGET).$(@:b)_8.cmd
2126 @+source $(MISC)$/$(TARGET).$(@:b)_8.cmd
2127 @ls -l $@
2128 .ENDIF # "$(OS)"=="MACOSX"
2129 .ENDIF
2130 .IF "$(GUI)" == "WNT"
2131 @@-$(MKDIR) $(@:d:d)
2132 .IF "$(APP8LINKRES)" != ""
2133 @@-$(RM) $(MISC)$/$(APP8LINKRES:b).rc
2134 .IF "$(APP8ICON)" != ""
2135 @-echo 1 ICON $(EMQ)"$(APP8ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP8LINKRES:b).rc
2136 .ENDIF # "$(APP8ICON)" != ""
2137 .IF "$(APP8VERINFO)" != ""
2138 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP8LINKRES:b).rc
2139 @-echo $(EMQ)#include $(EMQ)"$(APP8VERINFO)$(EMQ)" >> $(MISC)$/$(APP8LINKRES:b).rc
2140 .ENDIF # "$(APP8VERINFO)" != ""
2141 $(RC) -DWIN32 $(APP8PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP8LINKRES:b).rc
2142 .ENDIF # "$(APP8LINKRES)" != ""
2143 .IF "$(COM)" == "GCC"
2144 @echo mingw
2145 .IF "$(APP8LINKRES)" != "" || "$(APP8RES)" != ""
2146 @cat $(APP8LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP8RES)) > $(MISC)$/$(@:b)_all.res
2147 windres $(MISC)$/$(@:b)_all.res $(APP8RESO)
2148 .ENDIF
2149 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
2150 $(APP8BASEX) $(APP8STACKN) -o $@ $(APP8OBJS) \
2151 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP8RESO) \
2152 `$(TYPE) /dev/null $(APP8LIBS) | sed s#$(ROUT)#$(OUT)#g` \
2153 $(APP_LINKTYPE) $(APP8LIBSALCPPRT) \
2154 -Wl,--start-group $(APP8STDLIBS) -Wl,--end-group $(APP8STDLIB) \
2155 $(STDLIB8) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_8.cmd
2156 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_8.cmd
2157 @+source $(MISC)$/$(TARGET).$(@:b)_8.cmd
2158 @ls -l $@
2159 .ELSE # "$(COM)" == "GCC"
2160 .IF "$(linkinc)" == ""
2161 $(APP8LINKER) @$(mktmp \
2162 $(APP8LINKFLAGS) \
2163 $(LINKFLAGSAPP) $(APP8BASEX) \
2164 $(APP8STACKN) \
2165 -out:$@ \
2166 -map:$(MISC)$/{$(subst,$/,_ $(APP8TARGET)).map} \
2167 $(STDOBJ) \
2168 $(APP8LINKRES) \
2169 $(APP8RES) \
2170 $(APP8OBJS) \
2171 $(APP8LIBS) \
2172 $(APP8STDLIBS) \
2173 $(APP8STDLIB) $(STDLIB8) \
2175 @-echo linking $@.manifest ...
2176 .IF "$(VISTA_MANIFEST)"!=""
2177 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2178 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
2179 .ELSE
2180 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
2181 .ENDIF # "$(VISTA_MANIFEST)"!=""
2182 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2183 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2184 .ELSE
2185 -$(RM) $(MISC)\$(APP8TARGET).lnk
2186 -$(RM) $(MISC)\$(APP8TARGET).lst
2187 -$(RM) $(MISC)\linkobj.lst
2188 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
2189 type $(mktmp,$(MISC)\$(APP8TARGET).lst
2190 $(APP8LINKFLAGS) \
2191 $(LINKFLAGSAPP) $(APP8BASEX) \
2192 $(APP8STACKN) \
2193 -out:$@ \
2194 $(STDOBJ) \
2195 $(APP8LINKRES) \
2196 $(APP8RES) \
2197 $(APP8OBJS) \
2198 $(APP8LIBS) \
2199 $(APP8STDLIBS) \
2200 $(APP8STDLIB) $(STDLIB8))
2201 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP8TARGETN:b)_linkobj.lst >> $(MISC)\$(APP8TARGET).lst
2202 $(IFEXIST) $(MISC)$/$(APP8TARGET).lst $(THEN) type $(MISC)$/$(APP8TARGET).lst >> $(MISC)$/$(APP8TARGET).lnk $(FI)
2203 $(APP8LINKER) @$(MISC)\$(APP8TARGET).lnk
2204 .ENDIF # "$(linkinc)" == ""
2205 .ENDIF # "$(COM)" == "GCC"
2206 .IF "$(APP8TARGET)" == "loader"
2207 $(PERL) loader.pl $@
2208 .IF "$(USE_SHELL)"=="4nt"
2209 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
2210 .ELSE # "$(USE_SHELL)"=="4nt"
2211 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
2212 .ENDIF # "$(USE_SHELL)"=="4nt"
2213 $(RM) $@
2214 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
2215 .ENDIF # "$(TARGET)" == "setup"
2217 .ENDIF # "$(GUI)" == "WNT"
2219 .IF "$(GUI)" == "OS2"
2220 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
2221 .IF "$(APP8LINKRES)" != ""
2222 @+-$(RM) $(MISC)$/$(APP8LINKRES:b).rc >& $(NULLDEV)
2223 .IF "$(APP8ICON)" != ""
2224 .IF "$(USE_SHELL)"=="4nt"
2225 @-+echo ICON 1 "$(APP8ICON:s/\/\\/)" >> $(MISC)$/$(APP8LINKRES:b).rc
2226 .ELSE # "$(USE_SHELL)"=="4nt"
2227 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP8ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP8LINKRES:b).rc
2228 .ENDIF # "$(USE_SHELL)"=="4nt"
2229 .ENDIF # "$(APP8ICON)" != ""
2230 .IF "$(APP8VERINFO)" != ""
2231 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP8LINKRES:b).rc
2232 @-+echo $(EMQ)#include $(EMQ)"$(APP8VERINFO)$(EMQ)" >> $(MISC)$/$(APP8LINKRES:b).rc
2233 .ENDIF # "$(APP8VERINFO)" != ""
2234 $(RC) -r -DOS2 $(APP8PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP8LINKRES:b).rc
2235 .ENDIF # "$(APP8LINKRES)" != ""
2237 .IF "$(TARGETTYPE)" == "GUI"
2238 @echo NAME $(APP8TARGET) WINDOWAPI > $(MISC)$/$(APP8TARGET).def
2239 .ENDIF
2241 @+echo $(APP8LINKFLAGS) \
2242 $(LINKFLAGSAPP) $(APP8BASEX) \
2243 $(APP8STACKN) \
2244 -o $@ \
2245 -Zmap -L$(LB) \
2246 -L$(SOLARVERSION)$/$(INPATH)$/lib \
2247 $(STDOBJ) \
2248 $(APP8LINKRES) \
2249 $(APP8RES) \
2250 $(APP8DEF) \
2251 $(APP8OBJS) \
2252 $(APP8LIBS) \
2253 $(APP8STDLIBS:^"-l") \
2254 $(APP8STDLIB:^"-l") $(STDLIB8:^"-l")
2255 $(APP8LINKER) -v \
2256 $(APP8LINKFLAGS) \
2257 $(LINKFLAGSAPP) $(APP8BASEX) \
2258 $(APP8STACKN) \
2259 -o $@ \
2260 -Zmap -L$(LB) \
2261 -L$(SOLARVERSION)$/$(INPATH)$/lib \
2262 $(STDOBJ) \
2263 $(APP8LINKRES) \
2264 $(APP8RES) \
2265 $(APP8DEF) \
2266 $(APP8OBJS) \
2267 $(APP8LIBS) \
2268 $(APP8STDLIBS:^"-l") \
2269 $(APP8STDLIB:^"-l") $(STDLIB8:^"-l")
2272 .IF "$(APP8TARGET)" == "loader"
2273 +$(PERL) loader.pl $@
2274 .IF "$(USE_SHELL)"=="4nt"
2275 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
2276 .ELSE # "$(USE_SHELL)"=="4nt"
2277 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
2278 .ENDIF # "$(USE_SHELL)"=="4nt"
2279 +$(RM) $@
2280 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
2281 .ENDIF # "$(TARGET)" == "setup"
2283 .ENDIF # "$(GUI)" == "OS2"
2285 .ENDIF # "$(APP8TARGETN)"!=""
2288 # Instruction for linking
2289 # unroll begin
2291 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
2292 APP9DEF = $(MISC)$/$(APP9TARGET).def
2293 .ENDIF
2295 .IF "$(APP9LINKTYPE)" != ""
2296 #must be either STATIC or SHARED
2297 APP9LINKTYPEFLAG=$(APPLINK$(APP9LINKTYPE))
2298 .ENDIF
2300 # decide how to link
2301 .IF "$(APP9CODETYPE)"=="C"
2302 APP9LINKER=$(LINKC)
2303 APP9STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
2304 APP9LINKFLAGS+=$(LINKCFLAGS)
2305 .ELSE # "$(APP9CODETYPE)"=="C"
2306 APP9LINKER=$(LINK)
2307 APP9STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
2308 APP9LINKFLAGS+=$(LINKFLAGS)
2309 .ENDIF # "$(APP9CODETYPE)"=="C"
2311 APP9RPATH*=OOO
2312 LINKFLAGSRUNPATH_$(APP9RPATH)*=/ERROR:/Bad_APP9RPATH_value
2313 .IF "$(OS)" != "MACOSX"
2314 APP9LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP9RPATH))
2315 .ENDIF
2317 .IF "$(APP9STACK)" != ""
2318 .IF "$(LINKFLAGSTACK)" != ""
2319 APP9STACKN=$(LINKFLAGSTACK)$(APP9STACK)
2320 .ENDIF
2321 .ELSE
2322 APP9STACKN=
2323 .ENDIF
2325 .IF "$(APP9NOSAL)"==""
2326 .IF "$(TARGETTYPE)" == "GUI"
2327 APP9OBJS+= $(STDOBJVCL)
2328 .ENDIF
2329 .ENDIF
2331 .IF "$(GUI)$(COM)" == "WNTGCC"
2332 APP9RESO=
2333 .IF "$(APP9LINKRES)" != "" || "$(APP9RES)" != ""
2334 APP9RESO=$(MISC)$/$(APP9TARGET:b)_res.o
2335 .ENDIF
2336 .ENDIF
2338 .IF "$(GUI)" == "UNX"
2339 APP9DEPN+:=$(APP9DEPNU)
2340 USE_APP9DEF=
2341 .ENDIF
2343 .IF "$(APP9TARGETN)"!=""
2345 .IF "$(APP9PRODUCTNAME)"!=""
2346 APP9PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP9PRODUCTNAME)\"
2347 .ENDIF # "$(APP9PRODUCTNAME)"!=""
2349 .IF "$(linkinc)"!=""
2350 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
2351 .IF "$(APP9LIBS)"!=""
2352 $(MISC)$/$(APP9TARGET)_linkinc.ls .PHONY:
2353 @@-$(RM) $@
2354 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP9LIBS) $(i:s/.lib/.lin/)) >> $@
2355 .ENDIF #"$(APP9LIBS)"!=""
2356 .ENDIF
2358 LINKINCTARGETS+=$(MISC)$/$(APP9TARGETN:b)_linkinc.ls
2359 $(APP9TARGETN) : $(LINKINCTARGETS)
2360 .ENDIF # "$(linkinc)"!=""
2362 # Allow for target specific LIBSALCPPRT override
2363 APP9LIBSALCPPRT*=$(LIBSALCPPRT)
2365 .IF "$(GUI)" == "OS2"
2366 _APP9IMP_ORD = $(APP9STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP9STDLIBS:^"$(LB)$/")
2367 APP9IMP_ORD = $(foreach,i,$(_APP9IMP_ORD) $(shell @-ls $i))
2368 .ELSE
2369 APP9IMP_ORD =
2370 .ENDIF
2372 $(APP9TARGETN): $(APP9OBJS) $(APP9LIBS) \
2373 $(APP9RES) \
2374 $(APP9IMP_ORD) \
2375 $(APP9ICON) $(APP9DEPN) $(USE_APP9DEF)
2376 @echo ------------------------------
2377 @echo "Making: " $(@:f)
2378 .IF "$(GUI)"=="UNX"
2379 .IF "$(OS)"=="MACOSX"
2380 @echo unx
2381 @-$(RM) $(MISC)$/$(@:b).list
2382 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_9.cmd
2383 @-$(RM) $(MISC)$/$(@:b).strip
2384 @echo $(STDSLO) $(APP9OBJS:s/.obj/.o/) \
2385 `cat /dev/null $(APP9LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
2386 @echo -n $(APP9LINKER) $(APP9LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
2387 $(APP9LINKTYPEFLAG) $(APP9STDLIBS) $(APP9STDLIB) $(STDLIB9) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_9.cmd
2388 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
2389 `cat $(MISC)$/$(TARGET).$(@:b)_9.cmd` \
2390 >> $(MISC)$/$(TARGET).$(@:b)_9.cmd
2391 @cat $(MISC)$/$(TARGET).$(@:b)_9.cmd
2392 @+source $(MISC)$/$(TARGET).$(@:b)_9.cmd
2393 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
2394 # libraries at runtime
2395 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
2396 @strip -i -R $(MISC)$/$(@:b).strip -X $@
2397 @ls -l $@
2398 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
2399 app $(APP9RPATH) $@
2400 .IF "$(TARGETTYPE)"=="GUI"
2401 @echo "Making: " $(@:f).app
2402 @macosx-create-bundle $@
2403 .ENDIF # "$(TARGETTYPE)"=="GUI"
2404 .ELSE # "$(OS)"=="MACOSX"
2405 @echo unx
2406 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_9.cmd
2407 @echo $(APP9LINKER) $(APP9LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
2408 $(APP9OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_9.cmd
2409 @cat $(mktmp /dev/null $(APP9LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_9.cmd
2410 @echo $(APP9LINKTYPEFLAG) $(APP9LIBSALCPPRT) $(APP9STDLIBS) $(APP9STDLIB) $(STDLIB9) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_9.cmd
2411 cat $(MISC)$/$(TARGET).$(@:b)_9.cmd
2412 @+source $(MISC)$/$(TARGET).$(@:b)_9.cmd
2413 @ls -l $@
2414 .ENDIF # "$(OS)"=="MACOSX"
2415 .ENDIF
2416 .IF "$(GUI)" == "WNT"
2417 @@-$(MKDIR) $(@:d:d)
2418 .IF "$(APP9LINKRES)" != ""
2419 @@-$(RM) $(MISC)$/$(APP9LINKRES:b).rc
2420 .IF "$(APP9ICON)" != ""
2421 @-echo 1 ICON $(EMQ)"$(APP9ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP9LINKRES:b).rc
2422 .ENDIF # "$(APP9ICON)" != ""
2423 .IF "$(APP9VERINFO)" != ""
2424 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP9LINKRES:b).rc
2425 @-echo $(EMQ)#include $(EMQ)"$(APP9VERINFO)$(EMQ)" >> $(MISC)$/$(APP9LINKRES:b).rc
2426 .ENDIF # "$(APP9VERINFO)" != ""
2427 $(RC) -DWIN32 $(APP9PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP9LINKRES:b).rc
2428 .ENDIF # "$(APP9LINKRES)" != ""
2429 .IF "$(COM)" == "GCC"
2430 @echo mingw
2431 .IF "$(APP9LINKRES)" != "" || "$(APP9RES)" != ""
2432 @cat $(APP9LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP9RES)) > $(MISC)$/$(@:b)_all.res
2433 windres $(MISC)$/$(@:b)_all.res $(APP9RESO)
2434 .ENDIF
2435 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
2436 $(APP9BASEX) $(APP9STACKN) -o $@ $(APP9OBJS) \
2437 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP9RESO) \
2438 `$(TYPE) /dev/null $(APP9LIBS) | sed s#$(ROUT)#$(OUT)#g` \
2439 $(APP_LINKTYPE) $(APP9LIBSALCPPRT) \
2440 -Wl,--start-group $(APP9STDLIBS) -Wl,--end-group $(APP9STDLIB) \
2441 $(STDLIB9) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_9.cmd
2442 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_9.cmd
2443 @+source $(MISC)$/$(TARGET).$(@:b)_9.cmd
2444 @ls -l $@
2445 .ELSE # "$(COM)" == "GCC"
2446 .IF "$(linkinc)" == ""
2447 $(APP9LINKER) @$(mktmp \
2448 $(APP9LINKFLAGS) \
2449 $(LINKFLAGSAPP) $(APP9BASEX) \
2450 $(APP9STACKN) \
2451 -out:$@ \
2452 -map:$(MISC)$/{$(subst,$/,_ $(APP9TARGET)).map} \
2453 $(STDOBJ) \
2454 $(APP9LINKRES) \
2455 $(APP9RES) \
2456 $(APP9OBJS) \
2457 $(APP9LIBS) \
2458 $(APP9STDLIBS) \
2459 $(APP9STDLIB) $(STDLIB9) \
2461 @-echo linking $@.manifest ...
2462 .IF "$(VISTA_MANIFEST)"!=""
2463 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2464 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
2465 .ELSE
2466 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
2467 .ENDIF # "$(VISTA_MANIFEST)"!=""
2468 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2469 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2470 .ELSE
2471 -$(RM) $(MISC)\$(APP9TARGET).lnk
2472 -$(RM) $(MISC)\$(APP9TARGET).lst
2473 -$(RM) $(MISC)\linkobj.lst
2474 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
2475 type $(mktmp,$(MISC)\$(APP9TARGET).lst
2476 $(APP9LINKFLAGS) \
2477 $(LINKFLAGSAPP) $(APP9BASEX) \
2478 $(APP9STACKN) \
2479 -out:$@ \
2480 $(STDOBJ) \
2481 $(APP9LINKRES) \
2482 $(APP9RES) \
2483 $(APP9OBJS) \
2484 $(APP9LIBS) \
2485 $(APP9STDLIBS) \
2486 $(APP9STDLIB) $(STDLIB9))
2487 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP9TARGETN:b)_linkobj.lst >> $(MISC)\$(APP9TARGET).lst
2488 $(IFEXIST) $(MISC)$/$(APP9TARGET).lst $(THEN) type $(MISC)$/$(APP9TARGET).lst >> $(MISC)$/$(APP9TARGET).lnk $(FI)
2489 $(APP9LINKER) @$(MISC)\$(APP9TARGET).lnk
2490 .ENDIF # "$(linkinc)" == ""
2491 .ENDIF # "$(COM)" == "GCC"
2492 .IF "$(APP9TARGET)" == "loader"
2493 $(PERL) loader.pl $@
2494 .IF "$(USE_SHELL)"=="4nt"
2495 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
2496 .ELSE # "$(USE_SHELL)"=="4nt"
2497 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
2498 .ENDIF # "$(USE_SHELL)"=="4nt"
2499 $(RM) $@
2500 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
2501 .ENDIF # "$(TARGET)" == "setup"
2503 .ENDIF # "$(GUI)" == "WNT"
2505 .IF "$(GUI)" == "OS2"
2506 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
2507 .IF "$(APP9LINKRES)" != ""
2508 @+-$(RM) $(MISC)$/$(APP9LINKRES:b).rc >& $(NULLDEV)
2509 .IF "$(APP9ICON)" != ""
2510 .IF "$(USE_SHELL)"=="4nt"
2511 @-+echo ICON 1 "$(APP9ICON:s/\/\\/)" >> $(MISC)$/$(APP9LINKRES:b).rc
2512 .ELSE # "$(USE_SHELL)"=="4nt"
2513 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP9ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP9LINKRES:b).rc
2514 .ENDIF # "$(USE_SHELL)"=="4nt"
2515 .ENDIF # "$(APP9ICON)" != ""
2516 .IF "$(APP9VERINFO)" != ""
2517 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP9LINKRES:b).rc
2518 @-+echo $(EMQ)#include $(EMQ)"$(APP9VERINFO)$(EMQ)" >> $(MISC)$/$(APP9LINKRES:b).rc
2519 .ENDIF # "$(APP9VERINFO)" != ""
2520 $(RC) -r -DOS2 $(APP9PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP9LINKRES:b).rc
2521 .ENDIF # "$(APP9LINKRES)" != ""
2523 .IF "$(TARGETTYPE)" == "GUI"
2524 @echo NAME $(APP9TARGET) WINDOWAPI > $(MISC)$/$(APP9TARGET).def
2525 .ENDIF
2527 @+echo $(APP9LINKFLAGS) \
2528 $(LINKFLAGSAPP) $(APP9BASEX) \
2529 $(APP9STACKN) \
2530 -o $@ \
2531 -Zmap -L$(LB) \
2532 -L$(SOLARVERSION)$/$(INPATH)$/lib \
2533 $(STDOBJ) \
2534 $(APP9LINKRES) \
2535 $(APP9RES) \
2536 $(APP9DEF) \
2537 $(APP9OBJS) \
2538 $(APP9LIBS) \
2539 $(APP9STDLIBS:^"-l") \
2540 $(APP9STDLIB:^"-l") $(STDLIB9:^"-l")
2541 $(APP9LINKER) -v \
2542 $(APP9LINKFLAGS) \
2543 $(LINKFLAGSAPP) $(APP9BASEX) \
2544 $(APP9STACKN) \
2545 -o $@ \
2546 -Zmap -L$(LB) \
2547 -L$(SOLARVERSION)$/$(INPATH)$/lib \
2548 $(STDOBJ) \
2549 $(APP9LINKRES) \
2550 $(APP9RES) \
2551 $(APP9DEF) \
2552 $(APP9OBJS) \
2553 $(APP9LIBS) \
2554 $(APP9STDLIBS:^"-l") \
2555 $(APP9STDLIB:^"-l") $(STDLIB9:^"-l")
2558 .IF "$(APP9TARGET)" == "loader"
2559 +$(PERL) loader.pl $@
2560 .IF "$(USE_SHELL)"=="4nt"
2561 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
2562 .ELSE # "$(USE_SHELL)"=="4nt"
2563 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
2564 .ENDIF # "$(USE_SHELL)"=="4nt"
2565 +$(RM) $@
2566 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
2567 .ENDIF # "$(TARGET)" == "setup"
2569 .ENDIF # "$(GUI)" == "OS2"
2571 .ENDIF # "$(APP9TARGETN)"!=""
2574 # Instruction for linking
2575 # unroll begin
2577 .IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
2578 APP10DEF = $(MISC)$/$(APP10TARGET).def
2579 .ENDIF
2581 .IF "$(APP10LINKTYPE)" != ""
2582 #must be either STATIC or SHARED
2583 APP10LINKTYPEFLAG=$(APPLINK$(APP10LINKTYPE))
2584 .ENDIF
2586 # decide how to link
2587 .IF "$(APP10CODETYPE)"=="C"
2588 APP10LINKER=$(LINKC)
2589 APP10STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
2590 APP10LINKFLAGS+=$(LINKCFLAGS)
2591 .ELSE # "$(APP10CODETYPE)"=="C"
2592 APP10LINKER=$(LINK)
2593 APP10STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
2594 APP10LINKFLAGS+=$(LINKFLAGS)
2595 .ENDIF # "$(APP10CODETYPE)"=="C"
2597 APP10RPATH*=OOO
2598 LINKFLAGSRUNPATH_$(APP10RPATH)*=/ERROR:/Bad_APP10RPATH_value
2599 .IF "$(OS)" != "MACOSX"
2600 APP10LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP10RPATH))
2601 .ENDIF
2603 .IF "$(APP10STACK)" != ""
2604 .IF "$(LINKFLAGSTACK)" != ""
2605 APP10STACKN=$(LINKFLAGSTACK)$(APP10STACK)
2606 .ENDIF
2607 .ELSE
2608 APP10STACKN=
2609 .ENDIF
2611 .IF "$(APP10NOSAL)"==""
2612 .IF "$(TARGETTYPE)" == "GUI"
2613 APP10OBJS+= $(STDOBJVCL)
2614 .ENDIF
2615 .ENDIF
2617 .IF "$(GUI)$(COM)" == "WNTGCC"
2618 APP10RESO=
2619 .IF "$(APP10LINKRES)" != "" || "$(APP10RES)" != ""
2620 APP10RESO=$(MISC)$/$(APP10TARGET:b)_res.o
2621 .ENDIF
2622 .ENDIF
2624 .IF "$(GUI)" == "UNX"
2625 APP10DEPN+:=$(APP10DEPNU)
2626 USE_APP10DEF=
2627 .ENDIF
2629 .IF "$(APP10TARGETN)"!=""
2631 .IF "$(APP10PRODUCTNAME)"!=""
2632 APP10PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP10PRODUCTNAME)\"
2633 .ENDIF # "$(APP10PRODUCTNAME)"!=""
2635 .IF "$(linkinc)"!=""
2636 .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
2637 .IF "$(APP10LIBS)"!=""
2638 $(MISC)$/$(APP10TARGET)_linkinc.ls .PHONY:
2639 @@-$(RM) $@
2640 sed -f $(SOLARENV)$/bin$/chrel.sed $(foreach,i,$(APP10LIBS) $(i:s/.lib/.lin/)) >> $@
2641 .ENDIF #"$(APP10LIBS)"!=""
2642 .ENDIF
2644 LINKINCTARGETS+=$(MISC)$/$(APP10TARGETN:b)_linkinc.ls
2645 $(APP10TARGETN) : $(LINKINCTARGETS)
2646 .ENDIF # "$(linkinc)"!=""
2648 # Allow for target specific LIBSALCPPRT override
2649 APP10LIBSALCPPRT*=$(LIBSALCPPRT)
2651 .IF "$(GUI)" == "OS2"
2652 _APP10IMP_ORD = $(APP10STDLIBS:^"$(SOLARVERSION)$/$(INPATH)$/lib$/") $(APP10STDLIBS:^"$(LB)$/")
2653 APP10IMP_ORD = $(foreach,i,$(_APP10IMP_ORD) $(shell @-ls $i))
2654 .ELSE
2655 APP10IMP_ORD =
2656 .ENDIF
2658 $(APP10TARGETN): $(APP10OBJS) $(APP10LIBS) \
2659 $(APP10RES) \
2660 $(APP10IMP_ORD) \
2661 $(APP10ICON) $(APP10DEPN) $(USE_APP10DEF)
2662 @echo ------------------------------
2663 @echo "Making: " $(@:f)
2664 .IF "$(GUI)"=="UNX"
2665 .IF "$(OS)"=="MACOSX"
2666 @echo unx
2667 @-$(RM) $(MISC)$/$(@:b).list
2668 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_10.cmd
2669 @-$(RM) $(MISC)$/$(@:b).strip
2670 @echo $(STDSLO) $(APP10OBJS:s/.obj/.o/) \
2671 `cat /dev/null $(APP10LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
2672 @echo -n $(APP10LINKER) $(APP10LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
2673 $(APP10LINKTYPEFLAG) $(APP10STDLIBS) $(APP10STDLIB) $(STDLIB10) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(TARGET).$(@:b)_10.cmd
2674 @$(PERL) $(SOLARENV)$/bin$/macosx-dylib-link-list.pl \
2675 `cat $(MISC)$/$(TARGET).$(@:b)_10.cmd` \
2676 >> $(MISC)$/$(TARGET).$(@:b)_10.cmd
2677 @cat $(MISC)$/$(TARGET).$(@:b)_10.cmd
2678 @+source $(MISC)$/$(TARGET).$(@:b)_10.cmd
2679 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
2680 # libraries at runtime
2681 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
2682 @strip -i -R $(MISC)$/$(@:b).strip -X $@
2683 @ls -l $@
2684 @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \
2685 app $(APP10RPATH) $@
2686 .IF "$(TARGETTYPE)"=="GUI"
2687 @echo "Making: " $(@:f).app
2688 @macosx-create-bundle $@
2689 .ENDIF # "$(TARGETTYPE)"=="GUI"
2690 .ELSE # "$(OS)"=="MACOSX"
2691 @echo unx
2692 @-$(RM) $(MISC)$/$(TARGET).$(@:b)_10.cmd
2693 @echo $(APP10LINKER) $(APP10LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
2694 $(APP10OBJS:s/.obj/.o/) '\' > $(MISC)$/$(TARGET).$(@:b)_10.cmd
2695 @cat $(mktmp /dev/null $(APP10LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(TARGET).$(@:b)_10.cmd
2696 @echo $(APP10LINKTYPEFLAG) $(APP10LIBSALCPPRT) $(APP10STDLIBS) $(APP10STDLIB) $(STDLIB10) -o $@ >> $(MISC)$/$(TARGET).$(@:b)_10.cmd
2697 cat $(MISC)$/$(TARGET).$(@:b)_10.cmd
2698 @+source $(MISC)$/$(TARGET).$(@:b)_10.cmd
2699 @ls -l $@
2700 .ENDIF # "$(OS)"=="MACOSX"
2701 .ENDIF
2702 .IF "$(GUI)" == "WNT"
2703 @@-$(MKDIR) $(@:d:d)
2704 .IF "$(APP10LINKRES)" != ""
2705 @@-$(RM) $(MISC)$/$(APP10LINKRES:b).rc
2706 .IF "$(APP10ICON)" != ""
2707 @-echo 1 ICON $(EMQ)"$(APP10ICON:s/\/\\/)$(EMQ)" >> $(MISC)$/$(APP10LINKRES:b).rc
2708 .ENDIF # "$(APP10ICON)" != ""
2709 .IF "$(APP10VERINFO)" != ""
2710 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP10LINKRES:b).rc
2711 @-echo $(EMQ)#include $(EMQ)"$(APP10VERINFO)$(EMQ)" >> $(MISC)$/$(APP10LINKRES:b).rc
2712 .ENDIF # "$(APP10VERINFO)" != ""
2713 $(RC) -DWIN32 $(APP10PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP10LINKRES:b).rc
2714 .ENDIF # "$(APP10LINKRES)" != ""
2715 .IF "$(COM)" == "GCC"
2716 @echo mingw
2717 .IF "$(APP10LINKRES)" != "" || "$(APP10RES)" != ""
2718 @cat $(APP10LINKRES) $(subst,$/res$/,$/res{$(subst,$(BIN), $(@:d))} $(APP10RES)) > $(MISC)$/$(@:b)_all.res
2719 windres $(MISC)$/$(@:b)_all.res $(APP10RESO)
2720 .ENDIF
2721 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
2722 $(APP10BASEX) $(APP10STACKN) -o $@ $(APP10OBJS) \
2723 -Wl,-Map,$(MISC)$/$(@:b).map $(STDOBJ) $(APP10RESO) \
2724 `$(TYPE) /dev/null $(APP10LIBS) | sed s#$(ROUT)#$(OUT)#g` \
2725 $(APP_LINKTYPE) $(APP10LIBSALCPPRT) \
2726 -Wl,--start-group $(APP10STDLIBS) -Wl,--end-group $(APP10STDLIB) \
2727 $(STDLIB10) $(MINGWSSTDENDOBJ) > $(MISC)$/$(TARGET).$(@:b)_10.cmd
2728 @$(TYPE) $(MISC)$/$(TARGET).$(@:b)_10.cmd
2729 @+source $(MISC)$/$(TARGET).$(@:b)_10.cmd
2730 @ls -l $@
2731 .ELSE # "$(COM)" == "GCC"
2732 .IF "$(linkinc)" == ""
2733 $(APP10LINKER) @$(mktmp \
2734 $(APP10LINKFLAGS) \
2735 $(LINKFLAGSAPP) $(APP10BASEX) \
2736 $(APP10STACKN) \
2737 -out:$@ \
2738 -map:$(MISC)$/{$(subst,$/,_ $(APP10TARGET)).map} \
2739 $(STDOBJ) \
2740 $(APP10LINKRES) \
2741 $(APP10RES) \
2742 $(APP10OBJS) \
2743 $(APP10LIBS) \
2744 $(APP10STDLIBS) \
2745 $(APP10STDLIB) $(STDLIB10) \
2747 @-echo linking $@.manifest ...
2748 .IF "$(VISTA_MANIFEST)"!=""
2749 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)$/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2750 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
2751 .ELSE
2752 $(IFEXIST) $@.manifest $(THEN) mt.exe -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
2753 .ENDIF # "$(VISTA_MANIFEST)"!=""
2754 $(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2755 $(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2756 .ELSE
2757 -$(RM) $(MISC)\$(APP10TARGET).lnk
2758 -$(RM) $(MISC)\$(APP10TARGET).lst
2759 -$(RM) $(MISC)\linkobj.lst
2760 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
2761 type $(mktmp,$(MISC)\$(APP10TARGET).lst
2762 $(APP10LINKFLAGS) \
2763 $(LINKFLAGSAPP) $(APP10BASEX) \
2764 $(APP10STACKN) \
2765 -out:$@ \
2766 $(STDOBJ) \
2767 $(APP10LINKRES) \
2768 $(APP10RES) \
2769 $(APP10OBJS) \
2770 $(APP10LIBS) \
2771 $(APP10STDLIBS) \
2772 $(APP10STDLIB) $(STDLIB10))
2773 $(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP10TARGETN:b)_linkobj.lst >> $(MISC)\$(APP10TARGET).lst
2774 $(IFEXIST) $(MISC)$/$(APP10TARGET).lst $(THEN) type $(MISC)$/$(APP10TARGET).lst >> $(MISC)$/$(APP10TARGET).lnk $(FI)
2775 $(APP10LINKER) @$(MISC)\$(APP10TARGET).lnk
2776 .ENDIF # "$(linkinc)" == ""
2777 .ENDIF # "$(COM)" == "GCC"
2778 .IF "$(APP10TARGET)" == "loader"
2779 $(PERL) loader.pl $@
2780 .IF "$(USE_SHELL)"=="4nt"
2781 $(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
2782 .ELSE # "$(USE_SHELL)"=="4nt"
2783 $(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
2784 .ENDIF # "$(USE_SHELL)"=="4nt"
2785 $(RM) $@
2786 $(RENAME) $(@:d)_new.exe $(@:d)loader.exe
2787 .ENDIF # "$(TARGET)" == "setup"
2789 .ENDIF # "$(GUI)" == "WNT"
2791 .IF "$(GUI)" == "OS2"
2792 @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
2793 .IF "$(APP10LINKRES)" != ""
2794 @+-$(RM) $(MISC)$/$(APP10LINKRES:b).rc >& $(NULLDEV)
2795 .IF "$(APP10ICON)" != ""
2796 .IF "$(USE_SHELL)"=="4nt"
2797 @-+echo ICON 1 "$(APP10ICON:s/\/\\/)" >> $(MISC)$/$(APP10LINKRES:b).rc
2798 .ELSE # "$(USE_SHELL)"=="4nt"
2799 @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP10ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP10LINKRES:b).rc
2800 .ENDIF # "$(USE_SHELL)"=="4nt"
2801 .ENDIF # "$(APP10ICON)" != ""
2802 .IF "$(APP10VERINFO)" != ""
2803 @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP10LINKRES:b).rc
2804 @-+echo $(EMQ)#include $(EMQ)"$(APP10VERINFO)$(EMQ)" >> $(MISC)$/$(APP10LINKRES:b).rc
2805 .ENDIF # "$(APP10VERINFO)" != ""
2806 $(RC) -r -DOS2 $(APP10PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP10LINKRES:b).rc
2807 .ENDIF # "$(APP10LINKRES)" != ""
2809 .IF "$(TARGETTYPE)" == "GUI"
2810 @echo NAME $(APP10TARGET) WINDOWAPI > $(MISC)$/$(APP10TARGET).def
2811 .ENDIF
2813 @+echo $(APP10LINKFLAGS) \
2814 $(LINKFLAGSAPP) $(APP10BASEX) \
2815 $(APP10STACKN) \
2816 -o $@ \
2817 -Zmap -L$(LB) \
2818 -L$(SOLARVERSION)$/$(INPATH)$/lib \
2819 $(STDOBJ) \
2820 $(APP10LINKRES) \
2821 $(APP10RES) \
2822 $(APP10DEF) \
2823 $(APP10OBJS) \
2824 $(APP10LIBS) \
2825 $(APP10STDLIBS:^"-l") \
2826 $(APP10STDLIB:^"-l") $(STDLIB10:^"-l")
2827 $(APP10LINKER) -v \
2828 $(APP10LINKFLAGS) \
2829 $(LINKFLAGSAPP) $(APP10BASEX) \
2830 $(APP10STACKN) \
2831 -o $@ \
2832 -Zmap -L$(LB) \
2833 -L$(SOLARVERSION)$/$(INPATH)$/lib \
2834 $(STDOBJ) \
2835 $(APP10LINKRES) \
2836 $(APP10RES) \
2837 $(APP10DEF) \
2838 $(APP10OBJS) \
2839 $(APP10LIBS) \
2840 $(APP10STDLIBS:^"-l") \
2841 $(APP10STDLIB:^"-l") $(STDLIB10:^"-l")
2844 .IF "$(APP10TARGET)" == "loader"
2845 +$(PERL) loader.pl $@
2846 .IF "$(USE_SHELL)"=="4nt"
2847 +$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
2848 .ELSE # "$(USE_SHELL)"=="4nt"
2849 +$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
2850 .ENDIF # "$(USE_SHELL)"=="4nt"
2851 +$(RM) $@
2852 +$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
2853 .ENDIF # "$(TARGET)" == "setup"
2855 .ENDIF # "$(GUI)" == "OS2"
2857 .ENDIF # "$(APP10TARGETN)"!=""
2860 # Instruction for linking