Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / solenv / inc / _tg_app.mk
blobb5a7956cf2055a3ab44c3766a31afd8b37b8bb1e
1 # unroll begin
3 .IF "$(APP1LINKTYPE)" != ""
4 #must be either STATIC or SHARED
5 APP1LINKTYPEFLAG=$(APPLINK$(APP1LINKTYPE))
6 .ENDIF
8 # decide how to link
9 .IF "$(APP1CODETYPE)"=="C"
10 APP1LINKER=$(LINKC)
11 APP1STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
12 APP1LINKFLAGS+=$(LINKCFLAGS)
13 .ELSE # "$(APP1CODETYPE)"=="C"
14 APP1LINKER=$(LINK)
15 APP1STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
16 APP1LINKFLAGS+=$(LINKFLAGS)
17 .ENDIF # "$(APP1CODETYPE)"=="C"
19 APP1RPATH*=OOO
20 LINKFLAGSRUNPATH_$(APP1RPATH)*=/ERROR:/Bad_APP1RPATH_value
21 .IF "$(OS)" != "MACOSX"
22 APP1LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP1RPATH))
23 .ENDIF
25 .IF "$(APP1STACK)" != ""
26 .IF "$(LINKFLAGSTACK)" != ""
27 APP1STACKN=$(LINKFLAGSTACK)$(APP1STACK)
28 .ENDIF
29 .ELSE
30 APP1STACKN=
31 .ENDIF
33 .IF "$(APP1NOSAL)"==""
34 .IF "$(TARGETTYPE)" == "GUI"
35 APP1STDLIB+= -lvclmain
36 .ENDIF
37 .ENDIF
39 .IF "$(GUI)$(COM)" == "WNTGCC"
40 APP1RESO=
41 .IF "$(APP1LINKRES)" != "" || "$(APP1RES)" != ""
42 APP1RESO=$(MISC)/$(APP1TARGET:b)_res.o
43 .ENDIF
44 .ENDIF
46 .IF "$(GUI)" == "UNX"
47 APP1DEPN+:=$(APP1DEPNU)
48 USE_APP1DEF=
49 .ENDIF
51 .IF "$(APP1TARGETN)"!=""
53 .IF "$(APP1PRODUCTNAME)"!=""
54 APP1PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP1PRODUCTNAME)\"
55 .ENDIF # "$(APP1PRODUCTNAME)"!=""
57 .IF "$(linkinc)"!=""
58 .IF "$(GUI)"=="WNT"
59 .IF "$(APP1LIBS)"!=""
60 $(MISC)/$(APP1TARGET)_linkinc.ls .PHONY:
61 @@-$(RM) $@
62 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP1LIBS) $(i:s/.lib/.lin/)) >> $@
63 .ENDIF #"$(APP1LIBS)"!=""
64 .ENDIF
66 LINKINCTARGETS+=$(MISC)/$(APP1TARGETN:b)_linkinc.ls
67 $(APP1TARGETN) : $(LINKINCTARGETS)
68 .ENDIF # "$(linkinc)"!=""
70 # Allow for target specific LIBSALCPPRT override
71 APP1LIBSALCPPRT*=$(LIBSALCPPRT)
73 $(APP1TARGETN): $(APP1OBJS) $(APP1LIBS) \
74 $(APP1RES) \
75 $(APP1ICON) $(APP1DEPN) $(USE_APP1DEF)
76 @echo "Making: " $(@:f)
77 .IF "$(GUI)"=="UNX"
78 .IF "$(OS)"=="MACOSX"
79 @-$(RM) $(MISC)/$(@:b).list
80 @-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
81 @-$(RM) $(MISC)/$(@:b).strip
82 @echo $(STDSLO) $(APP1OBJS:s/.obj/.o/) \
83 `cat /dev/null $(APP1LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
84 @/bin/echo -n $(APP1LINKER) $(APP1LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
85 $(APP1LINKTYPEFLAG) $(APP1STDLIBS) $(APP1STDLIB) $(STDLIB1) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_1.cmd
86 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
87 `cat $(MISC)/$(TARGET).$(@:b)_1.cmd` \
88 >> $(MISC)/$(TARGET).$(@:b)_1.cmd
89 .IF "$(VERBOSE)" == "TRUE"
90 @cat $(MISC)/$(TARGET).$(@:b)_1.cmd
91 .ENDIF
92 @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
93 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
94 # libraries at runtime
95 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
96 @strip -i -R $(MISC)/$(@:b).strip -X $@
97 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
98 app $(APP1RPATH) $@
99 .IF "$(TARGETTYPE)"=="GUI"
100 @echo "Making: " $(@:f).app
101 @macosx-create-bundle $@
102 .ENDIF # "$(TARGETTYPE)"=="GUI"
103 .ELSE # "$(OS)"=="MACOSX"
104 @-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
105 @echo $(APP1LINKER) $(APP1LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
106 $(APP1OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_1.cmd
107 @cat $(mktmp /dev/null $(APP1LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_1.cmd
108 @echo $(APP1LINKTYPEFLAG) $(APP1LIBSALCPPRT) $(APP1STDLIBS) $(APP1STDLIB) $(STDLIB1) -o $@ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
109 .IF "$(VERBOSE)" == "TRUE"
110 @cat $(MISC)/$(TARGET).$(@:b)_1.cmd
111 .ENDIF
112 @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
113 .IF "$(VERBOSE)" == "TRUE"
114 .ENDIF
115 .ENDIF # "$(OS)"=="MACOSX"
116 .ENDIF
117 .IF "$(GUI)" == "WNT"
118 @@-$(MKDIR) $(@:d:d)
119 .IF "$(APP1LINKRES)" != ""
120 @@-$(RM) $(MISC)/$(APP1LINKRES:b).rc
121 .IF "$(APP1ICON)" != ""
122 @-echo 1 ICON $(EMQ)"$(APP1ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP1LINKRES:b).rc
123 .ENDIF # "$(APP1ICON)" != ""
124 .IF "$(APP1VERINFO)" != ""
125 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP1LINKRES:b).rc
126 @-echo $(EMQ)#include $(EMQ)"$(APP1VERINFO)$(EMQ)" >> $(MISC)/$(APP1LINKRES:b).rc
127 .ENDIF # "$(APP1VERINFO)" != ""
128 .IF "$(COM)" == "GCC"
129 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP1PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP1LINKRES:b).res $(MISC)/$(APP1LINKRES:b).rc
130 .ELSE
131 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP1PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP1LINKRES:b).rc
132 .ENDIF
133 .ENDIF # "$(APP1LINKRES)" != ""
134 .IF "$(COM)" == "GCC"
135 .IF "$(APP1LINKRES)" != "" || "$(APP1RES)" != ""
136 @cat $(APP1LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP1RES)) > $(MISC)/$(@:b)_all.res
137 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP1RESO)
138 .ENDIF
139 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
140 $(APP1BASEX) $(APP1STACKN) -o $@ $(APP1OBJS) \
141 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP1RESO) \
142 `$(TYPE) /dev/null $(APP1LIBS) | sed s#$(ROUT)#$(OUT)#g` \
143 $(APP_LINKTYPE) $(APP1LIBSALCPPRT) \
144 -Wl,--start-group $(APP1STDLIBS) -Wl,--end-group $(APP1STDLIB) \
145 $(STDLIB1) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_1.cmd
146 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
147 .IF "$(VERBOSE)" == "TRUE"
148 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_1.cmd
149 .ENDIF
150 @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
151 .ELSE # "$(COM)" == "GCC"
152 .IF "$(linkinc)" == ""
153 $(COMMAND_ECHO)$(APP1LINKER) @$(mktmp \
154 $(APP1LINKFLAGS) \
155 $(LINKFLAGSAPP) $(APP1BASEX) \
156 $(APP1STACKN) \
157 -out:$@ \
158 -map:$(MISC)/{$(subst,/,_ $(APP1TARGET)).map} \
159 $(STDOBJ) \
160 $(APP1LINKRES) \
161 $(APP1RES) \
162 $(APP1OBJS) \
163 $(APP1LIBS) \
164 $(APP1STDLIBS) \
165 $(APP1STDLIB) $(STDLIB1) \
167 @-echo linking $@.manifest ...
168 .IF "$(VISTA_MANIFEST)"!=""
169 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
170 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
171 .ELSE
172 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
173 .ENDIF # "$(VISTA_MANIFEST)"!=""
174 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
175 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
176 .ELSE
177 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP1TARGET).lnk
178 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP1TARGET).lst
179 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
180 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
181 type $(mktmp,$(MISC)\$(APP1TARGET).lst
182 $(APP1LINKFLAGS) \
183 $(LINKFLAGSAPP) $(APP1BASEX) \
184 $(APP1STACKN) \
185 -out:$@ \
186 $(STDOBJ) \
187 $(APP1LINKRES) \
188 $(APP1RES) \
189 $(APP1OBJS) \
190 $(APP1LIBS) \
191 $(APP1STDLIBS) \
192 $(APP1STDLIB) $(STDLIB1))
193 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP1TARGETN:b)_linkobj.lst >> $(MISC)\$(APP1TARGET).lst
194 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP1TARGET).lst $(THEN) type $(MISC)/$(APP1TARGET).lst >> $(MISC)/$(APP1TARGET).lnk $(FI)
195 $(COMMAND_ECHO)$(SED)$(APP1LINKER) @$(MISC)\$(APP1TARGET).lnk
196 .ENDIF # "$(linkinc)" == ""
197 .ENDIF # "$(COM)" == "GCC"
198 .IF "$(APP1TARGET)" == "loader"
199 $(COMMAND_ECHO)$(PERL) loader.pl $@
200 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
201 $(COMMAND_ECHO)$(RM) $@
202 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
203 .ENDIF # "$(TARGET)" == "setup"
205 .ENDIF # "$(GUI)" == "WNT"
207 .ENDIF # "$(APP1TARGETN)"!=""
210 # Instruction for linking
211 # unroll begin
213 .IF "$(APP2LINKTYPE)" != ""
214 #must be either STATIC or SHARED
215 APP2LINKTYPEFLAG=$(APPLINK$(APP2LINKTYPE))
216 .ENDIF
218 # decide how to link
219 .IF "$(APP2CODETYPE)"=="C"
220 APP2LINKER=$(LINKC)
221 APP2STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
222 APP2LINKFLAGS+=$(LINKCFLAGS)
223 .ELSE # "$(APP2CODETYPE)"=="C"
224 APP2LINKER=$(LINK)
225 APP2STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
226 APP2LINKFLAGS+=$(LINKFLAGS)
227 .ENDIF # "$(APP2CODETYPE)"=="C"
229 APP2RPATH*=OOO
230 LINKFLAGSRUNPATH_$(APP2RPATH)*=/ERROR:/Bad_APP2RPATH_value
231 .IF "$(OS)" != "MACOSX"
232 APP2LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP2RPATH))
233 .ENDIF
235 .IF "$(APP2STACK)" != ""
236 .IF "$(LINKFLAGSTACK)" != ""
237 APP2STACKN=$(LINKFLAGSTACK)$(APP2STACK)
238 .ENDIF
239 .ELSE
240 APP2STACKN=
241 .ENDIF
243 .IF "$(APP2NOSAL)"==""
244 .IF "$(TARGETTYPE)" == "GUI"
245 APP2STDLIB+= -lvclmain
246 .ENDIF
247 .ENDIF
249 .IF "$(GUI)$(COM)" == "WNTGCC"
250 APP2RESO=
251 .IF "$(APP2LINKRES)" != "" || "$(APP2RES)" != ""
252 APP2RESO=$(MISC)/$(APP2TARGET:b)_res.o
253 .ENDIF
254 .ENDIF
256 .IF "$(GUI)" == "UNX"
257 APP2DEPN+:=$(APP2DEPNU)
258 USE_APP2DEF=
259 .ENDIF
261 .IF "$(APP2TARGETN)"!=""
263 .IF "$(APP2PRODUCTNAME)"!=""
264 APP2PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP2PRODUCTNAME)\"
265 .ENDIF # "$(APP2PRODUCTNAME)"!=""
267 .IF "$(linkinc)"!=""
268 .IF "$(GUI)"=="WNT"
269 .IF "$(APP2LIBS)"!=""
270 $(MISC)/$(APP2TARGET)_linkinc.ls .PHONY:
271 @@-$(RM) $@
272 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP2LIBS) $(i:s/.lib/.lin/)) >> $@
273 .ENDIF #"$(APP2LIBS)"!=""
274 .ENDIF
276 LINKINCTARGETS+=$(MISC)/$(APP2TARGETN:b)_linkinc.ls
277 $(APP2TARGETN) : $(LINKINCTARGETS)
278 .ENDIF # "$(linkinc)"!=""
280 # Allow for target specific LIBSALCPPRT override
281 APP2LIBSALCPPRT*=$(LIBSALCPPRT)
283 $(APP2TARGETN): $(APP2OBJS) $(APP2LIBS) \
284 $(APP2RES) \
285 $(APP2ICON) $(APP2DEPN) $(USE_APP2DEF)
286 @echo "Making: " $(@:f)
287 .IF "$(GUI)"=="UNX"
288 .IF "$(OS)"=="MACOSX"
289 @-$(RM) $(MISC)/$(@:b).list
290 @-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
291 @-$(RM) $(MISC)/$(@:b).strip
292 @echo $(STDSLO) $(APP2OBJS:s/.obj/.o/) \
293 `cat /dev/null $(APP2LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
294 @/bin/echo -n $(APP2LINKER) $(APP2LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
295 $(APP2LINKTYPEFLAG) $(APP2STDLIBS) $(APP2STDLIB) $(STDLIB2) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_2.cmd
296 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
297 `cat $(MISC)/$(TARGET).$(@:b)_2.cmd` \
298 >> $(MISC)/$(TARGET).$(@:b)_2.cmd
299 .IF "$(VERBOSE)" == "TRUE"
300 @cat $(MISC)/$(TARGET).$(@:b)_2.cmd
301 .ENDIF
302 @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
303 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
304 # libraries at runtime
305 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
306 @strip -i -R $(MISC)/$(@:b).strip -X $@
307 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
308 app $(APP2RPATH) $@
309 .IF "$(TARGETTYPE)"=="GUI"
310 @echo "Making: " $(@:f).app
311 @macosx-create-bundle $@
312 .ENDIF # "$(TARGETTYPE)"=="GUI"
313 .ELSE # "$(OS)"=="MACOSX"
314 @-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
315 @echo $(APP2LINKER) $(APP2LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
316 $(APP2OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_2.cmd
317 @cat $(mktmp /dev/null $(APP2LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_2.cmd
318 @echo $(APP2LINKTYPEFLAG) $(APP2LIBSALCPPRT) $(APP2STDLIBS) $(APP2STDLIB) $(STDLIB2) -o $@ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
319 .IF "$(VERBOSE)" == "TRUE"
320 @cat $(MISC)/$(TARGET).$(@:b)_2.cmd
321 .ENDIF
322 @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
323 .IF "$(VERBOSE)" == "TRUE"
324 .ENDIF
325 .ENDIF # "$(OS)"=="MACOSX"
326 .ENDIF
327 .IF "$(GUI)" == "WNT"
328 @@-$(MKDIR) $(@:d:d)
329 .IF "$(APP2LINKRES)" != ""
330 @@-$(RM) $(MISC)/$(APP2LINKRES:b).rc
331 .IF "$(APP2ICON)" != ""
332 @-echo 1 ICON $(EMQ)"$(APP2ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP2LINKRES:b).rc
333 .ENDIF # "$(APP2ICON)" != ""
334 .IF "$(APP2VERINFO)" != ""
335 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP2LINKRES:b).rc
336 @-echo $(EMQ)#include $(EMQ)"$(APP2VERINFO)$(EMQ)" >> $(MISC)/$(APP2LINKRES:b).rc
337 .ENDIF # "$(APP2VERINFO)" != ""
338 .IF "$(COM)" == "GCC"
339 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP2PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP2LINKRES:b).res $(MISC)/$(APP2LINKRES:b).rc
340 .ELSE
341 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP2PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP2LINKRES:b).rc
342 .ENDIF
343 .ENDIF # "$(APP2LINKRES)" != ""
344 .IF "$(COM)" == "GCC"
345 .IF "$(APP2LINKRES)" != "" || "$(APP2RES)" != ""
346 @cat $(APP2LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP2RES)) > $(MISC)/$(@:b)_all.res
347 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP2RESO)
348 .ENDIF
349 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
350 $(APP2BASEX) $(APP2STACKN) -o $@ $(APP2OBJS) \
351 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP2RESO) \
352 `$(TYPE) /dev/null $(APP2LIBS) | sed s#$(ROUT)#$(OUT)#g` \
353 $(APP_LINKTYPE) $(APP2LIBSALCPPRT) \
354 -Wl,--start-group $(APP2STDLIBS) -Wl,--end-group $(APP2STDLIB) \
355 $(STDLIB2) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_2.cmd
356 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
357 .IF "$(VERBOSE)" == "TRUE"
358 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_2.cmd
359 .ENDIF
360 @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
361 .ELSE # "$(COM)" == "GCC"
362 .IF "$(linkinc)" == ""
363 $(COMMAND_ECHO)$(APP2LINKER) @$(mktmp \
364 $(APP2LINKFLAGS) \
365 $(LINKFLAGSAPP) $(APP2BASEX) \
366 $(APP2STACKN) \
367 -out:$@ \
368 -map:$(MISC)/{$(subst,/,_ $(APP2TARGET)).map} \
369 $(STDOBJ) \
370 $(APP2LINKRES) \
371 $(APP2RES) \
372 $(APP2OBJS) \
373 $(APP2LIBS) \
374 $(APP2STDLIBS) \
375 $(APP2STDLIB) $(STDLIB2) \
377 @-echo linking $@.manifest ...
378 .IF "$(VISTA_MANIFEST)"!=""
379 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
380 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
381 .ELSE
382 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
383 .ENDIF # "$(VISTA_MANIFEST)"!=""
384 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
385 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
386 .ELSE
387 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP2TARGET).lnk
388 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP2TARGET).lst
389 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
390 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
391 type $(mktmp,$(MISC)\$(APP2TARGET).lst
392 $(APP2LINKFLAGS) \
393 $(LINKFLAGSAPP) $(APP2BASEX) \
394 $(APP2STACKN) \
395 -out:$@ \
396 $(STDOBJ) \
397 $(APP2LINKRES) \
398 $(APP2RES) \
399 $(APP2OBJS) \
400 $(APP2LIBS) \
401 $(APP2STDLIBS) \
402 $(APP2STDLIB) $(STDLIB2))
403 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP2TARGETN:b)_linkobj.lst >> $(MISC)\$(APP2TARGET).lst
404 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP2TARGET).lst $(THEN) type $(MISC)/$(APP2TARGET).lst >> $(MISC)/$(APP2TARGET).lnk $(FI)
405 $(COMMAND_ECHO)$(SED)$(APP2LINKER) @$(MISC)\$(APP2TARGET).lnk
406 .ENDIF # "$(linkinc)" == ""
407 .ENDIF # "$(COM)" == "GCC"
408 .IF "$(APP2TARGET)" == "loader"
409 $(COMMAND_ECHO)$(PERL) loader.pl $@
410 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
411 $(COMMAND_ECHO)$(RM) $@
412 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
413 .ENDIF # "$(TARGET)" == "setup"
415 .ENDIF # "$(GUI)" == "WNT"
417 .ENDIF # "$(APP2TARGETN)"!=""
420 # Instruction for linking
421 # unroll begin
423 .IF "$(APP3LINKTYPE)" != ""
424 #must be either STATIC or SHARED
425 APP3LINKTYPEFLAG=$(APPLINK$(APP3LINKTYPE))
426 .ENDIF
428 # decide how to link
429 .IF "$(APP3CODETYPE)"=="C"
430 APP3LINKER=$(LINKC)
431 APP3STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
432 APP3LINKFLAGS+=$(LINKCFLAGS)
433 .ELSE # "$(APP3CODETYPE)"=="C"
434 APP3LINKER=$(LINK)
435 APP3STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
436 APP3LINKFLAGS+=$(LINKFLAGS)
437 .ENDIF # "$(APP3CODETYPE)"=="C"
439 APP3RPATH*=OOO
440 LINKFLAGSRUNPATH_$(APP3RPATH)*=/ERROR:/Bad_APP3RPATH_value
441 .IF "$(OS)" != "MACOSX"
442 APP3LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP3RPATH))
443 .ENDIF
445 .IF "$(APP3STACK)" != ""
446 .IF "$(LINKFLAGSTACK)" != ""
447 APP3STACKN=$(LINKFLAGSTACK)$(APP3STACK)
448 .ENDIF
449 .ELSE
450 APP3STACKN=
451 .ENDIF
453 .IF "$(APP3NOSAL)"==""
454 .IF "$(TARGETTYPE)" == "GUI"
455 APP3STDLIB+= -lvclmain
456 .ENDIF
457 .ENDIF
459 .IF "$(GUI)$(COM)" == "WNTGCC"
460 APP3RESO=
461 .IF "$(APP3LINKRES)" != "" || "$(APP3RES)" != ""
462 APP3RESO=$(MISC)/$(APP3TARGET:b)_res.o
463 .ENDIF
464 .ENDIF
466 .IF "$(GUI)" == "UNX"
467 APP3DEPN+:=$(APP3DEPNU)
468 USE_APP3DEF=
469 .ENDIF
471 .IF "$(APP3TARGETN)"!=""
473 .IF "$(APP3PRODUCTNAME)"!=""
474 APP3PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP3PRODUCTNAME)\"
475 .ENDIF # "$(APP3PRODUCTNAME)"!=""
477 .IF "$(linkinc)"!=""
478 .IF "$(GUI)"=="WNT"
479 .IF "$(APP3LIBS)"!=""
480 $(MISC)/$(APP3TARGET)_linkinc.ls .PHONY:
481 @@-$(RM) $@
482 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP3LIBS) $(i:s/.lib/.lin/)) >> $@
483 .ENDIF #"$(APP3LIBS)"!=""
484 .ENDIF
486 LINKINCTARGETS+=$(MISC)/$(APP3TARGETN:b)_linkinc.ls
487 $(APP3TARGETN) : $(LINKINCTARGETS)
488 .ENDIF # "$(linkinc)"!=""
490 # Allow for target specific LIBSALCPPRT override
491 APP3LIBSALCPPRT*=$(LIBSALCPPRT)
493 $(APP3TARGETN): $(APP3OBJS) $(APP3LIBS) \
494 $(APP3RES) \
495 $(APP3ICON) $(APP3DEPN) $(USE_APP3DEF)
496 @echo "Making: " $(@:f)
497 .IF "$(GUI)"=="UNX"
498 .IF "$(OS)"=="MACOSX"
499 @-$(RM) $(MISC)/$(@:b).list
500 @-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
501 @-$(RM) $(MISC)/$(@:b).strip
502 @echo $(STDSLO) $(APP3OBJS:s/.obj/.o/) \
503 `cat /dev/null $(APP3LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
504 @/bin/echo -n $(APP3LINKER) $(APP3LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
505 $(APP3LINKTYPEFLAG) $(APP3STDLIBS) $(APP3STDLIB) $(STDLIB3) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_3.cmd
506 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
507 `cat $(MISC)/$(TARGET).$(@:b)_3.cmd` \
508 >> $(MISC)/$(TARGET).$(@:b)_3.cmd
509 .IF "$(VERBOSE)" == "TRUE"
510 @cat $(MISC)/$(TARGET).$(@:b)_3.cmd
511 .ENDIF
512 @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
513 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
514 # libraries at runtime
515 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
516 @strip -i -R $(MISC)/$(@:b).strip -X $@
517 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
518 app $(APP3RPATH) $@
519 .IF "$(TARGETTYPE)"=="GUI"
520 @echo "Making: " $(@:f).app
521 @macosx-create-bundle $@
522 .ENDIF # "$(TARGETTYPE)"=="GUI"
523 .ELSE # "$(OS)"=="MACOSX"
524 @-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
525 @echo $(APP3LINKER) $(APP3LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
526 $(APP3OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_3.cmd
527 @cat $(mktmp /dev/null $(APP3LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_3.cmd
528 @echo $(APP3LINKTYPEFLAG) $(APP3LIBSALCPPRT) $(APP3STDLIBS) $(APP3STDLIB) $(STDLIB3) -o $@ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
529 .IF "$(VERBOSE)" == "TRUE"
530 @cat $(MISC)/$(TARGET).$(@:b)_3.cmd
531 .ENDIF
532 @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
533 .IF "$(VERBOSE)" == "TRUE"
534 .ENDIF
535 .ENDIF # "$(OS)"=="MACOSX"
536 .ENDIF
537 .IF "$(GUI)" == "WNT"
538 @@-$(MKDIR) $(@:d:d)
539 .IF "$(APP3LINKRES)" != ""
540 @@-$(RM) $(MISC)/$(APP3LINKRES:b).rc
541 .IF "$(APP3ICON)" != ""
542 @-echo 1 ICON $(EMQ)"$(APP3ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP3LINKRES:b).rc
543 .ENDIF # "$(APP3ICON)" != ""
544 .IF "$(APP3VERINFO)" != ""
545 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP3LINKRES:b).rc
546 @-echo $(EMQ)#include $(EMQ)"$(APP3VERINFO)$(EMQ)" >> $(MISC)/$(APP3LINKRES:b).rc
547 .ENDIF # "$(APP3VERINFO)" != ""
548 .IF "$(COM)" == "GCC"
549 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP3PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP3LINKRES:b).res $(MISC)/$(APP3LINKRES:b).rc
550 .ELSE
551 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP3PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP3LINKRES:b).rc
552 .ENDIF
553 .ENDIF # "$(APP3LINKRES)" != ""
554 .IF "$(COM)" == "GCC"
555 .IF "$(APP3LINKRES)" != "" || "$(APP3RES)" != ""
556 @cat $(APP3LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP3RES)) > $(MISC)/$(@:b)_all.res
557 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP3RESO)
558 .ENDIF
559 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
560 $(APP3BASEX) $(APP3STACKN) -o $@ $(APP3OBJS) \
561 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP3RESO) \
562 `$(TYPE) /dev/null $(APP3LIBS) | sed s#$(ROUT)#$(OUT)#g` \
563 $(APP_LINKTYPE) $(APP3LIBSALCPPRT) \
564 -Wl,--start-group $(APP3STDLIBS) -Wl,--end-group $(APP3STDLIB) \
565 $(STDLIB3) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_3.cmd
566 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
567 .IF "$(VERBOSE)" == "TRUE"
568 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_3.cmd
569 .ENDIF
570 @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
571 .ELSE # "$(COM)" == "GCC"
572 .IF "$(linkinc)" == ""
573 $(COMMAND_ECHO)$(APP3LINKER) @$(mktmp \
574 $(APP3LINKFLAGS) \
575 $(LINKFLAGSAPP) $(APP3BASEX) \
576 $(APP3STACKN) \
577 -out:$@ \
578 -map:$(MISC)/{$(subst,/,_ $(APP3TARGET)).map} \
579 $(STDOBJ) \
580 $(APP3LINKRES) \
581 $(APP3RES) \
582 $(APP3OBJS) \
583 $(APP3LIBS) \
584 $(APP3STDLIBS) \
585 $(APP3STDLIB) $(STDLIB3) \
587 @-echo linking $@.manifest ...
588 .IF "$(VISTA_MANIFEST)"!=""
589 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
590 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
591 .ELSE
592 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
593 .ENDIF # "$(VISTA_MANIFEST)"!=""
594 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
595 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
596 .ELSE
597 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP3TARGET).lnk
598 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP3TARGET).lst
599 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
600 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
601 type $(mktmp,$(MISC)\$(APP3TARGET).lst
602 $(APP3LINKFLAGS) \
603 $(LINKFLAGSAPP) $(APP3BASEX) \
604 $(APP3STACKN) \
605 -out:$@ \
606 $(STDOBJ) \
607 $(APP3LINKRES) \
608 $(APP3RES) \
609 $(APP3OBJS) \
610 $(APP3LIBS) \
611 $(APP3STDLIBS) \
612 $(APP3STDLIB) $(STDLIB3))
613 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP3TARGETN:b)_linkobj.lst >> $(MISC)\$(APP3TARGET).lst
614 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP3TARGET).lst $(THEN) type $(MISC)/$(APP3TARGET).lst >> $(MISC)/$(APP3TARGET).lnk $(FI)
615 $(COMMAND_ECHO)$(SED)$(APP3LINKER) @$(MISC)\$(APP3TARGET).lnk
616 .ENDIF # "$(linkinc)" == ""
617 .ENDIF # "$(COM)" == "GCC"
618 .IF "$(APP3TARGET)" == "loader"
619 $(COMMAND_ECHO)$(PERL) loader.pl $@
620 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
621 $(COMMAND_ECHO)$(RM) $@
622 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
623 .ENDIF # "$(TARGET)" == "setup"
625 .ENDIF # "$(GUI)" == "WNT"
627 .ENDIF # "$(APP3TARGETN)"!=""
630 # Instruction for linking
631 # unroll begin
633 .IF "$(APP4LINKTYPE)" != ""
634 #must be either STATIC or SHARED
635 APP4LINKTYPEFLAG=$(APPLINK$(APP4LINKTYPE))
636 .ENDIF
638 # decide how to link
639 .IF "$(APP4CODETYPE)"=="C"
640 APP4LINKER=$(LINKC)
641 APP4STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
642 APP4LINKFLAGS+=$(LINKCFLAGS)
643 .ELSE # "$(APP4CODETYPE)"=="C"
644 APP4LINKER=$(LINK)
645 APP4STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
646 APP4LINKFLAGS+=$(LINKFLAGS)
647 .ENDIF # "$(APP4CODETYPE)"=="C"
649 APP4RPATH*=OOO
650 LINKFLAGSRUNPATH_$(APP4RPATH)*=/ERROR:/Bad_APP4RPATH_value
651 .IF "$(OS)" != "MACOSX"
652 APP4LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP4RPATH))
653 .ENDIF
655 .IF "$(APP4STACK)" != ""
656 .IF "$(LINKFLAGSTACK)" != ""
657 APP4STACKN=$(LINKFLAGSTACK)$(APP4STACK)
658 .ENDIF
659 .ELSE
660 APP4STACKN=
661 .ENDIF
663 .IF "$(APP4NOSAL)"==""
664 .IF "$(TARGETTYPE)" == "GUI"
665 APP4STDLIB+= -lvclmain
666 .ENDIF
667 .ENDIF
669 .IF "$(GUI)$(COM)" == "WNTGCC"
670 APP4RESO=
671 .IF "$(APP4LINKRES)" != "" || "$(APP4RES)" != ""
672 APP4RESO=$(MISC)/$(APP4TARGET:b)_res.o
673 .ENDIF
674 .ENDIF
676 .IF "$(GUI)" == "UNX"
677 APP4DEPN+:=$(APP4DEPNU)
678 USE_APP4DEF=
679 .ENDIF
681 .IF "$(APP4TARGETN)"!=""
683 .IF "$(APP4PRODUCTNAME)"!=""
684 APP4PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP4PRODUCTNAME)\"
685 .ENDIF # "$(APP4PRODUCTNAME)"!=""
687 .IF "$(linkinc)"!=""
688 .IF "$(GUI)"=="WNT"
689 .IF "$(APP4LIBS)"!=""
690 $(MISC)/$(APP4TARGET)_linkinc.ls .PHONY:
691 @@-$(RM) $@
692 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP4LIBS) $(i:s/.lib/.lin/)) >> $@
693 .ENDIF #"$(APP4LIBS)"!=""
694 .ENDIF
696 LINKINCTARGETS+=$(MISC)/$(APP4TARGETN:b)_linkinc.ls
697 $(APP4TARGETN) : $(LINKINCTARGETS)
698 .ENDIF # "$(linkinc)"!=""
700 # Allow for target specific LIBSALCPPRT override
701 APP4LIBSALCPPRT*=$(LIBSALCPPRT)
703 $(APP4TARGETN): $(APP4OBJS) $(APP4LIBS) \
704 $(APP4RES) \
705 $(APP4ICON) $(APP4DEPN) $(USE_APP4DEF)
706 @echo "Making: " $(@:f)
707 .IF "$(GUI)"=="UNX"
708 .IF "$(OS)"=="MACOSX"
709 @-$(RM) $(MISC)/$(@:b).list
710 @-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
711 @-$(RM) $(MISC)/$(@:b).strip
712 @echo $(STDSLO) $(APP4OBJS:s/.obj/.o/) \
713 `cat /dev/null $(APP4LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
714 @/bin/echo -n $(APP4LINKER) $(APP4LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
715 $(APP4LINKTYPEFLAG) $(APP4STDLIBS) $(APP4STDLIB) $(STDLIB4) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_4.cmd
716 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
717 `cat $(MISC)/$(TARGET).$(@:b)_4.cmd` \
718 >> $(MISC)/$(TARGET).$(@:b)_4.cmd
719 .IF "$(VERBOSE)" == "TRUE"
720 @cat $(MISC)/$(TARGET).$(@:b)_4.cmd
721 .ENDIF
722 @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
723 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
724 # libraries at runtime
725 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
726 @strip -i -R $(MISC)/$(@:b).strip -X $@
727 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
728 app $(APP4RPATH) $@
729 .IF "$(TARGETTYPE)"=="GUI"
730 @echo "Making: " $(@:f).app
731 @macosx-create-bundle $@
732 .ENDIF # "$(TARGETTYPE)"=="GUI"
733 .ELSE # "$(OS)"=="MACOSX"
734 @-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
735 @echo $(APP4LINKER) $(APP4LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
736 $(APP4OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_4.cmd
737 @cat $(mktmp /dev/null $(APP4LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_4.cmd
738 @echo $(APP4LINKTYPEFLAG) $(APP4LIBSALCPPRT) $(APP4STDLIBS) $(APP4STDLIB) $(STDLIB4) -o $@ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
739 .IF "$(VERBOSE)" == "TRUE"
740 @cat $(MISC)/$(TARGET).$(@:b)_4.cmd
741 .ENDIF
742 @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
743 .IF "$(VERBOSE)" == "TRUE"
744 .ENDIF
745 .ENDIF # "$(OS)"=="MACOSX"
746 .ENDIF
747 .IF "$(GUI)" == "WNT"
748 @@-$(MKDIR) $(@:d:d)
749 .IF "$(APP4LINKRES)" != ""
750 @@-$(RM) $(MISC)/$(APP4LINKRES:b).rc
751 .IF "$(APP4ICON)" != ""
752 @-echo 1 ICON $(EMQ)"$(APP4ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP4LINKRES:b).rc
753 .ENDIF # "$(APP4ICON)" != ""
754 .IF "$(APP4VERINFO)" != ""
755 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP4LINKRES:b).rc
756 @-echo $(EMQ)#include $(EMQ)"$(APP4VERINFO)$(EMQ)" >> $(MISC)/$(APP4LINKRES:b).rc
757 .ENDIF # "$(APP4VERINFO)" != ""
758 .IF "$(COM)" == "GCC"
759 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP4PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP4LINKRES:b).res $(MISC)/$(APP4LINKRES:b).rc
760 .ELSE
761 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP4PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP4LINKRES:b).rc
762 .ENDIF
763 .ENDIF # "$(APP4LINKRES)" != ""
764 .IF "$(COM)" == "GCC"
765 .IF "$(APP4LINKRES)" != "" || "$(APP4RES)" != ""
766 @cat $(APP4LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP4RES)) > $(MISC)/$(@:b)_all.res
767 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP4RESO)
768 .ENDIF
769 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
770 $(APP4BASEX) $(APP4STACKN) -o $@ $(APP4OBJS) \
771 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP4RESO) \
772 `$(TYPE) /dev/null $(APP4LIBS) | sed s#$(ROUT)#$(OUT)#g` \
773 $(APP_LINKTYPE) $(APP4LIBSALCPPRT) \
774 -Wl,--start-group $(APP4STDLIBS) -Wl,--end-group $(APP4STDLIB) \
775 $(STDLIB4) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_4.cmd
776 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
777 .IF "$(VERBOSE)" == "TRUE"
778 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_4.cmd
779 .ENDIF
780 @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
781 .ELSE # "$(COM)" == "GCC"
782 .IF "$(linkinc)" == ""
783 $(COMMAND_ECHO)$(APP4LINKER) @$(mktmp \
784 $(APP4LINKFLAGS) \
785 $(LINKFLAGSAPP) $(APP4BASEX) \
786 $(APP4STACKN) \
787 -out:$@ \
788 -map:$(MISC)/{$(subst,/,_ $(APP4TARGET)).map} \
789 $(STDOBJ) \
790 $(APP4LINKRES) \
791 $(APP4RES) \
792 $(APP4OBJS) \
793 $(APP4LIBS) \
794 $(APP4STDLIBS) \
795 $(APP4STDLIB) $(STDLIB4) \
797 @-echo linking $@.manifest ...
798 .IF "$(VISTA_MANIFEST)"!=""
799 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
800 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
801 .ELSE
802 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
803 .ENDIF # "$(VISTA_MANIFEST)"!=""
804 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
805 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
806 .ELSE
807 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP4TARGET).lnk
808 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP4TARGET).lst
809 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
810 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
811 type $(mktmp,$(MISC)\$(APP4TARGET).lst
812 $(APP4LINKFLAGS) \
813 $(LINKFLAGSAPP) $(APP4BASEX) \
814 $(APP4STACKN) \
815 -out:$@ \
816 $(STDOBJ) \
817 $(APP4LINKRES) \
818 $(APP4RES) \
819 $(APP4OBJS) \
820 $(APP4LIBS) \
821 $(APP4STDLIBS) \
822 $(APP4STDLIB) $(STDLIB4))
823 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP4TARGETN:b)_linkobj.lst >> $(MISC)\$(APP4TARGET).lst
824 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP4TARGET).lst $(THEN) type $(MISC)/$(APP4TARGET).lst >> $(MISC)/$(APP4TARGET).lnk $(FI)
825 $(COMMAND_ECHO)$(SED)$(APP4LINKER) @$(MISC)\$(APP4TARGET).lnk
826 .ENDIF # "$(linkinc)" == ""
827 .ENDIF # "$(COM)" == "GCC"
828 .IF "$(APP4TARGET)" == "loader"
829 $(COMMAND_ECHO)$(PERL) loader.pl $@
830 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
831 $(COMMAND_ECHO)$(RM) $@
832 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
833 .ENDIF # "$(TARGET)" == "setup"
835 .ENDIF # "$(GUI)" == "WNT"
837 .ENDIF # "$(APP4TARGETN)"!=""
840 # Instruction for linking
841 # unroll begin
843 .IF "$(APP5LINKTYPE)" != ""
844 #must be either STATIC or SHARED
845 APP5LINKTYPEFLAG=$(APPLINK$(APP5LINKTYPE))
846 .ENDIF
848 # decide how to link
849 .IF "$(APP5CODETYPE)"=="C"
850 APP5LINKER=$(LINKC)
851 APP5STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
852 APP5LINKFLAGS+=$(LINKCFLAGS)
853 .ELSE # "$(APP5CODETYPE)"=="C"
854 APP5LINKER=$(LINK)
855 APP5STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
856 APP5LINKFLAGS+=$(LINKFLAGS)
857 .ENDIF # "$(APP5CODETYPE)"=="C"
859 APP5RPATH*=OOO
860 LINKFLAGSRUNPATH_$(APP5RPATH)*=/ERROR:/Bad_APP5RPATH_value
861 .IF "$(OS)" != "MACOSX"
862 APP5LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP5RPATH))
863 .ENDIF
865 .IF "$(APP5STACK)" != ""
866 .IF "$(LINKFLAGSTACK)" != ""
867 APP5STACKN=$(LINKFLAGSTACK)$(APP5STACK)
868 .ENDIF
869 .ELSE
870 APP5STACKN=
871 .ENDIF
873 .IF "$(APP5NOSAL)"==""
874 .IF "$(TARGETTYPE)" == "GUI"
875 APP5STDLIB+= -lvclmain
876 .ENDIF
877 .ENDIF
879 .IF "$(GUI)$(COM)" == "WNTGCC"
880 APP5RESO=
881 .IF "$(APP5LINKRES)" != "" || "$(APP5RES)" != ""
882 APP5RESO=$(MISC)/$(APP5TARGET:b)_res.o
883 .ENDIF
884 .ENDIF
886 .IF "$(GUI)" == "UNX"
887 APP5DEPN+:=$(APP5DEPNU)
888 USE_APP5DEF=
889 .ENDIF
891 .IF "$(APP5TARGETN)"!=""
893 .IF "$(APP5PRODUCTNAME)"!=""
894 APP5PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP5PRODUCTNAME)\"
895 .ENDIF # "$(APP5PRODUCTNAME)"!=""
897 .IF "$(linkinc)"!=""
898 .IF "$(GUI)"=="WNT"
899 .IF "$(APP5LIBS)"!=""
900 $(MISC)/$(APP5TARGET)_linkinc.ls .PHONY:
901 @@-$(RM) $@
902 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP5LIBS) $(i:s/.lib/.lin/)) >> $@
903 .ENDIF #"$(APP5LIBS)"!=""
904 .ENDIF
906 LINKINCTARGETS+=$(MISC)/$(APP5TARGETN:b)_linkinc.ls
907 $(APP5TARGETN) : $(LINKINCTARGETS)
908 .ENDIF # "$(linkinc)"!=""
910 # Allow for target specific LIBSALCPPRT override
911 APP5LIBSALCPPRT*=$(LIBSALCPPRT)
913 $(APP5TARGETN): $(APP5OBJS) $(APP5LIBS) \
914 $(APP5RES) \
915 $(APP5ICON) $(APP5DEPN) $(USE_APP5DEF)
916 @echo "Making: " $(@:f)
917 .IF "$(GUI)"=="UNX"
918 .IF "$(OS)"=="MACOSX"
919 @-$(RM) $(MISC)/$(@:b).list
920 @-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
921 @-$(RM) $(MISC)/$(@:b).strip
922 @echo $(STDSLO) $(APP5OBJS:s/.obj/.o/) \
923 `cat /dev/null $(APP5LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
924 @/bin/echo -n $(APP5LINKER) $(APP5LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
925 $(APP5LINKTYPEFLAG) $(APP5STDLIBS) $(APP5STDLIB) $(STDLIB5) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_5.cmd
926 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
927 `cat $(MISC)/$(TARGET).$(@:b)_5.cmd` \
928 >> $(MISC)/$(TARGET).$(@:b)_5.cmd
929 .IF "$(VERBOSE)" == "TRUE"
930 @cat $(MISC)/$(TARGET).$(@:b)_5.cmd
931 .ENDIF
932 @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
933 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
934 # libraries at runtime
935 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
936 @strip -i -R $(MISC)/$(@:b).strip -X $@
937 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
938 app $(APP5RPATH) $@
939 .IF "$(TARGETTYPE)"=="GUI"
940 @echo "Making: " $(@:f).app
941 @macosx-create-bundle $@
942 .ENDIF # "$(TARGETTYPE)"=="GUI"
943 .ELSE # "$(OS)"=="MACOSX"
944 @-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
945 @echo $(APP5LINKER) $(APP5LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
946 $(APP5OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_5.cmd
947 @cat $(mktmp /dev/null $(APP5LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_5.cmd
948 @echo $(APP5LINKTYPEFLAG) $(APP5LIBSALCPPRT) $(APP5STDLIBS) $(APP5STDLIB) $(STDLIB5) -o $@ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
949 .IF "$(VERBOSE)" == "TRUE"
950 @cat $(MISC)/$(TARGET).$(@:b)_5.cmd
951 .ENDIF
952 @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
953 .IF "$(VERBOSE)" == "TRUE"
954 .ENDIF
955 .ENDIF # "$(OS)"=="MACOSX"
956 .ENDIF
957 .IF "$(GUI)" == "WNT"
958 @@-$(MKDIR) $(@:d:d)
959 .IF "$(APP5LINKRES)" != ""
960 @@-$(RM) $(MISC)/$(APP5LINKRES:b).rc
961 .IF "$(APP5ICON)" != ""
962 @-echo 1 ICON $(EMQ)"$(APP5ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP5LINKRES:b).rc
963 .ENDIF # "$(APP5ICON)" != ""
964 .IF "$(APP5VERINFO)" != ""
965 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP5LINKRES:b).rc
966 @-echo $(EMQ)#include $(EMQ)"$(APP5VERINFO)$(EMQ)" >> $(MISC)/$(APP5LINKRES:b).rc
967 .ENDIF # "$(APP5VERINFO)" != ""
968 .IF "$(COM)" == "GCC"
969 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP5PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP5LINKRES:b).res $(MISC)/$(APP5LINKRES:b).rc
970 .ELSE
971 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP5PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP5LINKRES:b).rc
972 .ENDIF
973 .ENDIF # "$(APP5LINKRES)" != ""
974 .IF "$(COM)" == "GCC"
975 .IF "$(APP5LINKRES)" != "" || "$(APP5RES)" != ""
976 @cat $(APP5LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP5RES)) > $(MISC)/$(@:b)_all.res
977 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP5RESO)
978 .ENDIF
979 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
980 $(APP5BASEX) $(APP5STACKN) -o $@ $(APP5OBJS) \
981 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP5RESO) \
982 `$(TYPE) /dev/null $(APP5LIBS) | sed s#$(ROUT)#$(OUT)#g` \
983 $(APP_LINKTYPE) $(APP5LIBSALCPPRT) \
984 -Wl,--start-group $(APP5STDLIBS) -Wl,--end-group $(APP5STDLIB) \
985 $(STDLIB5) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_5.cmd
986 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
987 .IF "$(VERBOSE)" == "TRUE"
988 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_5.cmd
989 .ENDIF
990 @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
991 .ELSE # "$(COM)" == "GCC"
992 .IF "$(linkinc)" == ""
993 $(COMMAND_ECHO)$(APP5LINKER) @$(mktmp \
994 $(APP5LINKFLAGS) \
995 $(LINKFLAGSAPP) $(APP5BASEX) \
996 $(APP5STACKN) \
997 -out:$@ \
998 -map:$(MISC)/{$(subst,/,_ $(APP5TARGET)).map} \
999 $(STDOBJ) \
1000 $(APP5LINKRES) \
1001 $(APP5RES) \
1002 $(APP5OBJS) \
1003 $(APP5LIBS) \
1004 $(APP5STDLIBS) \
1005 $(APP5STDLIB) $(STDLIB5) \
1007 @-echo linking $@.manifest ...
1008 .IF "$(VISTA_MANIFEST)"!=""
1009 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1010 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1011 .ELSE
1012 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1013 .ENDIF # "$(VISTA_MANIFEST)"!=""
1014 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1015 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1016 .ELSE
1017 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP5TARGET).lnk
1018 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP5TARGET).lst
1019 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
1020 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1021 type $(mktmp,$(MISC)\$(APP5TARGET).lst
1022 $(APP5LINKFLAGS) \
1023 $(LINKFLAGSAPP) $(APP5BASEX) \
1024 $(APP5STACKN) \
1025 -out:$@ \
1026 $(STDOBJ) \
1027 $(APP5LINKRES) \
1028 $(APP5RES) \
1029 $(APP5OBJS) \
1030 $(APP5LIBS) \
1031 $(APP5STDLIBS) \
1032 $(APP5STDLIB) $(STDLIB5))
1033 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP5TARGETN:b)_linkobj.lst >> $(MISC)\$(APP5TARGET).lst
1034 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP5TARGET).lst $(THEN) type $(MISC)/$(APP5TARGET).lst >> $(MISC)/$(APP5TARGET).lnk $(FI)
1035 $(COMMAND_ECHO)$(SED)$(APP5LINKER) @$(MISC)\$(APP5TARGET).lnk
1036 .ENDIF # "$(linkinc)" == ""
1037 .ENDIF # "$(COM)" == "GCC"
1038 .IF "$(APP5TARGET)" == "loader"
1039 $(COMMAND_ECHO)$(PERL) loader.pl $@
1040 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1041 $(COMMAND_ECHO)$(RM) $@
1042 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1043 .ENDIF # "$(TARGET)" == "setup"
1045 .ENDIF # "$(GUI)" == "WNT"
1047 .ENDIF # "$(APP5TARGETN)"!=""
1050 # Instruction for linking
1051 # unroll begin
1053 .IF "$(APP6LINKTYPE)" != ""
1054 #must be either STATIC or SHARED
1055 APP6LINKTYPEFLAG=$(APPLINK$(APP6LINKTYPE))
1056 .ENDIF
1058 # decide how to link
1059 .IF "$(APP6CODETYPE)"=="C"
1060 APP6LINKER=$(LINKC)
1061 APP6STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1062 APP6LINKFLAGS+=$(LINKCFLAGS)
1063 .ELSE # "$(APP6CODETYPE)"=="C"
1064 APP6LINKER=$(LINK)
1065 APP6STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1066 APP6LINKFLAGS+=$(LINKFLAGS)
1067 .ENDIF # "$(APP6CODETYPE)"=="C"
1069 APP6RPATH*=OOO
1070 LINKFLAGSRUNPATH_$(APP6RPATH)*=/ERROR:/Bad_APP6RPATH_value
1071 .IF "$(OS)" != "MACOSX"
1072 APP6LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP6RPATH))
1073 .ENDIF
1075 .IF "$(APP6STACK)" != ""
1076 .IF "$(LINKFLAGSTACK)" != ""
1077 APP6STACKN=$(LINKFLAGSTACK)$(APP6STACK)
1078 .ENDIF
1079 .ELSE
1080 APP6STACKN=
1081 .ENDIF
1083 .IF "$(APP6NOSAL)"==""
1084 .IF "$(TARGETTYPE)" == "GUI"
1085 APP6STDLIB+= -lvclmain
1086 .ENDIF
1087 .ENDIF
1089 .IF "$(GUI)$(COM)" == "WNTGCC"
1090 APP6RESO=
1091 .IF "$(APP6LINKRES)" != "" || "$(APP6RES)" != ""
1092 APP6RESO=$(MISC)/$(APP6TARGET:b)_res.o
1093 .ENDIF
1094 .ENDIF
1096 .IF "$(GUI)" == "UNX"
1097 APP6DEPN+:=$(APP6DEPNU)
1098 USE_APP6DEF=
1099 .ENDIF
1101 .IF "$(APP6TARGETN)"!=""
1103 .IF "$(APP6PRODUCTNAME)"!=""
1104 APP6PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP6PRODUCTNAME)\"
1105 .ENDIF # "$(APP6PRODUCTNAME)"!=""
1107 .IF "$(linkinc)"!=""
1108 .IF "$(GUI)"=="WNT"
1109 .IF "$(APP6LIBS)"!=""
1110 $(MISC)/$(APP6TARGET)_linkinc.ls .PHONY:
1111 @@-$(RM) $@
1112 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP6LIBS) $(i:s/.lib/.lin/)) >> $@
1113 .ENDIF #"$(APP6LIBS)"!=""
1114 .ENDIF
1116 LINKINCTARGETS+=$(MISC)/$(APP6TARGETN:b)_linkinc.ls
1117 $(APP6TARGETN) : $(LINKINCTARGETS)
1118 .ENDIF # "$(linkinc)"!=""
1120 # Allow for target specific LIBSALCPPRT override
1121 APP6LIBSALCPPRT*=$(LIBSALCPPRT)
1123 $(APP6TARGETN): $(APP6OBJS) $(APP6LIBS) \
1124 $(APP6RES) \
1125 $(APP6ICON) $(APP6DEPN) $(USE_APP6DEF)
1126 @echo "Making: " $(@:f)
1127 .IF "$(GUI)"=="UNX"
1128 .IF "$(OS)"=="MACOSX"
1129 @-$(RM) $(MISC)/$(@:b).list
1130 @-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
1131 @-$(RM) $(MISC)/$(@:b).strip
1132 @echo $(STDSLO) $(APP6OBJS:s/.obj/.o/) \
1133 `cat /dev/null $(APP6LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
1134 @/bin/echo -n $(APP6LINKER) $(APP6LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
1135 $(APP6LINKTYPEFLAG) $(APP6STDLIBS) $(APP6STDLIB) $(STDLIB6) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_6.cmd
1136 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
1137 `cat $(MISC)/$(TARGET).$(@:b)_6.cmd` \
1138 >> $(MISC)/$(TARGET).$(@:b)_6.cmd
1139 .IF "$(VERBOSE)" == "TRUE"
1140 @cat $(MISC)/$(TARGET).$(@:b)_6.cmd
1141 .ENDIF
1142 @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
1143 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1144 # libraries at runtime
1145 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
1146 @strip -i -R $(MISC)/$(@:b).strip -X $@
1147 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
1148 app $(APP6RPATH) $@
1149 .IF "$(TARGETTYPE)"=="GUI"
1150 @echo "Making: " $(@:f).app
1151 @macosx-create-bundle $@
1152 .ENDIF # "$(TARGETTYPE)"=="GUI"
1153 .ELSE # "$(OS)"=="MACOSX"
1154 @-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
1155 @echo $(APP6LINKER) $(APP6LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1156 $(APP6OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_6.cmd
1157 @cat $(mktmp /dev/null $(APP6LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_6.cmd
1158 @echo $(APP6LINKTYPEFLAG) $(APP6LIBSALCPPRT) $(APP6STDLIBS) $(APP6STDLIB) $(STDLIB6) -o $@ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
1159 .IF "$(VERBOSE)" == "TRUE"
1160 @cat $(MISC)/$(TARGET).$(@:b)_6.cmd
1161 .ENDIF
1162 @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
1163 .IF "$(VERBOSE)" == "TRUE"
1164 .ENDIF
1165 .ENDIF # "$(OS)"=="MACOSX"
1166 .ENDIF
1167 .IF "$(GUI)" == "WNT"
1168 @@-$(MKDIR) $(@:d:d)
1169 .IF "$(APP6LINKRES)" != ""
1170 @@-$(RM) $(MISC)/$(APP6LINKRES:b).rc
1171 .IF "$(APP6ICON)" != ""
1172 @-echo 1 ICON $(EMQ)"$(APP6ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP6LINKRES:b).rc
1173 .ENDIF # "$(APP6ICON)" != ""
1174 .IF "$(APP6VERINFO)" != ""
1175 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP6LINKRES:b).rc
1176 @-echo $(EMQ)#include $(EMQ)"$(APP6VERINFO)$(EMQ)" >> $(MISC)/$(APP6LINKRES:b).rc
1177 .ENDIF # "$(APP6VERINFO)" != ""
1178 .IF "$(COM)" == "GCC"
1179 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP6PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP6LINKRES:b).res $(MISC)/$(APP6LINKRES:b).rc
1180 .ELSE
1181 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP6PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP6LINKRES:b).rc
1182 .ENDIF
1183 .ENDIF # "$(APP6LINKRES)" != ""
1184 .IF "$(COM)" == "GCC"
1185 .IF "$(APP6LINKRES)" != "" || "$(APP6RES)" != ""
1186 @cat $(APP6LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP6RES)) > $(MISC)/$(@:b)_all.res
1187 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP6RESO)
1188 .ENDIF
1189 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1190 $(APP6BASEX) $(APP6STACKN) -o $@ $(APP6OBJS) \
1191 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP6RESO) \
1192 `$(TYPE) /dev/null $(APP6LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1193 $(APP_LINKTYPE) $(APP6LIBSALCPPRT) \
1194 -Wl,--start-group $(APP6STDLIBS) -Wl,--end-group $(APP6STDLIB) \
1195 $(STDLIB6) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_6.cmd
1196 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
1197 .IF "$(VERBOSE)" == "TRUE"
1198 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_6.cmd
1199 .ENDIF
1200 @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
1201 .ELSE # "$(COM)" == "GCC"
1202 .IF "$(linkinc)" == ""
1203 $(COMMAND_ECHO)$(APP6LINKER) @$(mktmp \
1204 $(APP6LINKFLAGS) \
1205 $(LINKFLAGSAPP) $(APP6BASEX) \
1206 $(APP6STACKN) \
1207 -out:$@ \
1208 -map:$(MISC)/{$(subst,/,_ $(APP6TARGET)).map} \
1209 $(STDOBJ) \
1210 $(APP6LINKRES) \
1211 $(APP6RES) \
1212 $(APP6OBJS) \
1213 $(APP6LIBS) \
1214 $(APP6STDLIBS) \
1215 $(APP6STDLIB) $(STDLIB6) \
1217 @-echo linking $@.manifest ...
1218 .IF "$(VISTA_MANIFEST)"!=""
1219 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1220 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1221 .ELSE
1222 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1223 .ENDIF # "$(VISTA_MANIFEST)"!=""
1224 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1225 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1226 .ELSE
1227 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP6TARGET).lnk
1228 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP6TARGET).lst
1229 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
1230 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1231 type $(mktmp,$(MISC)\$(APP6TARGET).lst
1232 $(APP6LINKFLAGS) \
1233 $(LINKFLAGSAPP) $(APP6BASEX) \
1234 $(APP6STACKN) \
1235 -out:$@ \
1236 $(STDOBJ) \
1237 $(APP6LINKRES) \
1238 $(APP6RES) \
1239 $(APP6OBJS) \
1240 $(APP6LIBS) \
1241 $(APP6STDLIBS) \
1242 $(APP6STDLIB) $(STDLIB6))
1243 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP6TARGETN:b)_linkobj.lst >> $(MISC)\$(APP6TARGET).lst
1244 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP6TARGET).lst $(THEN) type $(MISC)/$(APP6TARGET).lst >> $(MISC)/$(APP6TARGET).lnk $(FI)
1245 $(COMMAND_ECHO)$(SED)$(APP6LINKER) @$(MISC)\$(APP6TARGET).lnk
1246 .ENDIF # "$(linkinc)" == ""
1247 .ENDIF # "$(COM)" == "GCC"
1248 .IF "$(APP6TARGET)" == "loader"
1249 $(COMMAND_ECHO)$(PERL) loader.pl $@
1250 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1251 $(COMMAND_ECHO)$(RM) $@
1252 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1253 .ENDIF # "$(TARGET)" == "setup"
1255 .ENDIF # "$(GUI)" == "WNT"
1257 .ENDIF # "$(APP6TARGETN)"!=""
1260 # Instruction for linking
1261 # unroll begin
1263 .IF "$(APP7LINKTYPE)" != ""
1264 #must be either STATIC or SHARED
1265 APP7LINKTYPEFLAG=$(APPLINK$(APP7LINKTYPE))
1266 .ENDIF
1268 # decide how to link
1269 .IF "$(APP7CODETYPE)"=="C"
1270 APP7LINKER=$(LINKC)
1271 APP7STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1272 APP7LINKFLAGS+=$(LINKCFLAGS)
1273 .ELSE # "$(APP7CODETYPE)"=="C"
1274 APP7LINKER=$(LINK)
1275 APP7STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1276 APP7LINKFLAGS+=$(LINKFLAGS)
1277 .ENDIF # "$(APP7CODETYPE)"=="C"
1279 APP7RPATH*=OOO
1280 LINKFLAGSRUNPATH_$(APP7RPATH)*=/ERROR:/Bad_APP7RPATH_value
1281 .IF "$(OS)" != "MACOSX"
1282 APP7LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP7RPATH))
1283 .ENDIF
1285 .IF "$(APP7STACK)" != ""
1286 .IF "$(LINKFLAGSTACK)" != ""
1287 APP7STACKN=$(LINKFLAGSTACK)$(APP7STACK)
1288 .ENDIF
1289 .ELSE
1290 APP7STACKN=
1291 .ENDIF
1293 .IF "$(APP7NOSAL)"==""
1294 .IF "$(TARGETTYPE)" == "GUI"
1295 APP7STDLIB+= -lvclmain
1296 .ENDIF
1297 .ENDIF
1299 .IF "$(GUI)$(COM)" == "WNTGCC"
1300 APP7RESO=
1301 .IF "$(APP7LINKRES)" != "" || "$(APP7RES)" != ""
1302 APP7RESO=$(MISC)/$(APP7TARGET:b)_res.o
1303 .ENDIF
1304 .ENDIF
1306 .IF "$(GUI)" == "UNX"
1307 APP7DEPN+:=$(APP7DEPNU)
1308 USE_APP7DEF=
1309 .ENDIF
1311 .IF "$(APP7TARGETN)"!=""
1313 .IF "$(APP7PRODUCTNAME)"!=""
1314 APP7PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP7PRODUCTNAME)\"
1315 .ENDIF # "$(APP7PRODUCTNAME)"!=""
1317 .IF "$(linkinc)"!=""
1318 .IF "$(GUI)"=="WNT"
1319 .IF "$(APP7LIBS)"!=""
1320 $(MISC)/$(APP7TARGET)_linkinc.ls .PHONY:
1321 @@-$(RM) $@
1322 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP7LIBS) $(i:s/.lib/.lin/)) >> $@
1323 .ENDIF #"$(APP7LIBS)"!=""
1324 .ENDIF
1326 LINKINCTARGETS+=$(MISC)/$(APP7TARGETN:b)_linkinc.ls
1327 $(APP7TARGETN) : $(LINKINCTARGETS)
1328 .ENDIF # "$(linkinc)"!=""
1330 # Allow for target specific LIBSALCPPRT override
1331 APP7LIBSALCPPRT*=$(LIBSALCPPRT)
1333 $(APP7TARGETN): $(APP7OBJS) $(APP7LIBS) \
1334 $(APP7RES) \
1335 $(APP7ICON) $(APP7DEPN) $(USE_APP7DEF)
1336 @echo "Making: " $(@:f)
1337 .IF "$(GUI)"=="UNX"
1338 .IF "$(OS)"=="MACOSX"
1339 @-$(RM) $(MISC)/$(@:b).list
1340 @-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
1341 @-$(RM) $(MISC)/$(@:b).strip
1342 @echo $(STDSLO) $(APP7OBJS:s/.obj/.o/) \
1343 `cat /dev/null $(APP7LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
1344 @/bin/echo -n $(APP7LINKER) $(APP7LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
1345 $(APP7LINKTYPEFLAG) $(APP7STDLIBS) $(APP7STDLIB) $(STDLIB7) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_7.cmd
1346 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
1347 `cat $(MISC)/$(TARGET).$(@:b)_7.cmd` \
1348 >> $(MISC)/$(TARGET).$(@:b)_7.cmd
1349 .IF "$(VERBOSE)" == "TRUE"
1350 @cat $(MISC)/$(TARGET).$(@:b)_7.cmd
1351 .ENDIF
1352 @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
1353 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1354 # libraries at runtime
1355 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
1356 @strip -i -R $(MISC)/$(@:b).strip -X $@
1357 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
1358 app $(APP7RPATH) $@
1359 .IF "$(TARGETTYPE)"=="GUI"
1360 @echo "Making: " $(@:f).app
1361 @macosx-create-bundle $@
1362 .ENDIF # "$(TARGETTYPE)"=="GUI"
1363 .ELSE # "$(OS)"=="MACOSX"
1364 @-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
1365 @echo $(APP7LINKER) $(APP7LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1366 $(APP7OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_7.cmd
1367 @cat $(mktmp /dev/null $(APP7LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_7.cmd
1368 @echo $(APP7LINKTYPEFLAG) $(APP7LIBSALCPPRT) $(APP7STDLIBS) $(APP7STDLIB) $(STDLIB7) -o $@ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
1369 .IF "$(VERBOSE)" == "TRUE"
1370 @cat $(MISC)/$(TARGET).$(@:b)_7.cmd
1371 .ENDIF
1372 @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
1373 .IF "$(VERBOSE)" == "TRUE"
1374 .ENDIF
1375 .ENDIF # "$(OS)"=="MACOSX"
1376 .ENDIF
1377 .IF "$(GUI)" == "WNT"
1378 @@-$(MKDIR) $(@:d:d)
1379 .IF "$(APP7LINKRES)" != ""
1380 @@-$(RM) $(MISC)/$(APP7LINKRES:b).rc
1381 .IF "$(APP7ICON)" != ""
1382 @-echo 1 ICON $(EMQ)"$(APP7ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP7LINKRES:b).rc
1383 .ENDIF # "$(APP7ICON)" != ""
1384 .IF "$(APP7VERINFO)" != ""
1385 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP7LINKRES:b).rc
1386 @-echo $(EMQ)#include $(EMQ)"$(APP7VERINFO)$(EMQ)" >> $(MISC)/$(APP7LINKRES:b).rc
1387 .ENDIF # "$(APP7VERINFO)" != ""
1388 .IF "$(COM)" == "GCC"
1389 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP7PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP7LINKRES:b).res $(MISC)/$(APP7LINKRES:b).rc
1390 .ELSE
1391 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP7PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP7LINKRES:b).rc
1392 .ENDIF
1393 .ENDIF # "$(APP7LINKRES)" != ""
1394 .IF "$(COM)" == "GCC"
1395 .IF "$(APP7LINKRES)" != "" || "$(APP7RES)" != ""
1396 @cat $(APP7LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP7RES)) > $(MISC)/$(@:b)_all.res
1397 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP7RESO)
1398 .ENDIF
1399 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1400 $(APP7BASEX) $(APP7STACKN) -o $@ $(APP7OBJS) \
1401 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP7RESO) \
1402 `$(TYPE) /dev/null $(APP7LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1403 $(APP_LINKTYPE) $(APP7LIBSALCPPRT) \
1404 -Wl,--start-group $(APP7STDLIBS) -Wl,--end-group $(APP7STDLIB) \
1405 $(STDLIB7) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_7.cmd
1406 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
1407 .IF "$(VERBOSE)" == "TRUE"
1408 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_7.cmd
1409 .ENDIF
1410 @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
1411 .ELSE # "$(COM)" == "GCC"
1412 .IF "$(linkinc)" == ""
1413 $(COMMAND_ECHO)$(APP7LINKER) @$(mktmp \
1414 $(APP7LINKFLAGS) \
1415 $(LINKFLAGSAPP) $(APP7BASEX) \
1416 $(APP7STACKN) \
1417 -out:$@ \
1418 -map:$(MISC)/{$(subst,/,_ $(APP7TARGET)).map} \
1419 $(STDOBJ) \
1420 $(APP7LINKRES) \
1421 $(APP7RES) \
1422 $(APP7OBJS) \
1423 $(APP7LIBS) \
1424 $(APP7STDLIBS) \
1425 $(APP7STDLIB) $(STDLIB7) \
1427 @-echo linking $@.manifest ...
1428 .IF "$(VISTA_MANIFEST)"!=""
1429 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1430 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1431 .ELSE
1432 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1433 .ENDIF # "$(VISTA_MANIFEST)"!=""
1434 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1435 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1436 .ELSE
1437 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP7TARGET).lnk
1438 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP7TARGET).lst
1439 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
1440 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1441 type $(mktmp,$(MISC)\$(APP7TARGET).lst
1442 $(APP7LINKFLAGS) \
1443 $(LINKFLAGSAPP) $(APP7BASEX) \
1444 $(APP7STACKN) \
1445 -out:$@ \
1446 $(STDOBJ) \
1447 $(APP7LINKRES) \
1448 $(APP7RES) \
1449 $(APP7OBJS) \
1450 $(APP7LIBS) \
1451 $(APP7STDLIBS) \
1452 $(APP7STDLIB) $(STDLIB7))
1453 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP7TARGETN:b)_linkobj.lst >> $(MISC)\$(APP7TARGET).lst
1454 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP7TARGET).lst $(THEN) type $(MISC)/$(APP7TARGET).lst >> $(MISC)/$(APP7TARGET).lnk $(FI)
1455 $(COMMAND_ECHO)$(SED)$(APP7LINKER) @$(MISC)\$(APP7TARGET).lnk
1456 .ENDIF # "$(linkinc)" == ""
1457 .ENDIF # "$(COM)" == "GCC"
1458 .IF "$(APP7TARGET)" == "loader"
1459 $(COMMAND_ECHO)$(PERL) loader.pl $@
1460 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1461 $(COMMAND_ECHO)$(RM) $@
1462 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1463 .ENDIF # "$(TARGET)" == "setup"
1465 .ENDIF # "$(GUI)" == "WNT"
1467 .ENDIF # "$(APP7TARGETN)"!=""
1470 # Instruction for linking
1471 # unroll begin
1473 .IF "$(APP8LINKTYPE)" != ""
1474 #must be either STATIC or SHARED
1475 APP8LINKTYPEFLAG=$(APPLINK$(APP8LINKTYPE))
1476 .ENDIF
1478 # decide how to link
1479 .IF "$(APP8CODETYPE)"=="C"
1480 APP8LINKER=$(LINKC)
1481 APP8STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1482 APP8LINKFLAGS+=$(LINKCFLAGS)
1483 .ELSE # "$(APP8CODETYPE)"=="C"
1484 APP8LINKER=$(LINK)
1485 APP8STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1486 APP8LINKFLAGS+=$(LINKFLAGS)
1487 .ENDIF # "$(APP8CODETYPE)"=="C"
1489 APP8RPATH*=OOO
1490 LINKFLAGSRUNPATH_$(APP8RPATH)*=/ERROR:/Bad_APP8RPATH_value
1491 .IF "$(OS)" != "MACOSX"
1492 APP8LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP8RPATH))
1493 .ENDIF
1495 .IF "$(APP8STACK)" != ""
1496 .IF "$(LINKFLAGSTACK)" != ""
1497 APP8STACKN=$(LINKFLAGSTACK)$(APP8STACK)
1498 .ENDIF
1499 .ELSE
1500 APP8STACKN=
1501 .ENDIF
1503 .IF "$(APP8NOSAL)"==""
1504 .IF "$(TARGETTYPE)" == "GUI"
1505 APP8STDLIB+= -lvclmain
1506 .ENDIF
1507 .ENDIF
1509 .IF "$(GUI)$(COM)" == "WNTGCC"
1510 APP8RESO=
1511 .IF "$(APP8LINKRES)" != "" || "$(APP8RES)" != ""
1512 APP8RESO=$(MISC)/$(APP8TARGET:b)_res.o
1513 .ENDIF
1514 .ENDIF
1516 .IF "$(GUI)" == "UNX"
1517 APP8DEPN+:=$(APP8DEPNU)
1518 USE_APP8DEF=
1519 .ENDIF
1521 .IF "$(APP8TARGETN)"!=""
1523 .IF "$(APP8PRODUCTNAME)"!=""
1524 APP8PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP8PRODUCTNAME)\"
1525 .ENDIF # "$(APP8PRODUCTNAME)"!=""
1527 .IF "$(linkinc)"!=""
1528 .IF "$(GUI)"=="WNT"
1529 .IF "$(APP8LIBS)"!=""
1530 $(MISC)/$(APP8TARGET)_linkinc.ls .PHONY:
1531 @@-$(RM) $@
1532 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP8LIBS) $(i:s/.lib/.lin/)) >> $@
1533 .ENDIF #"$(APP8LIBS)"!=""
1534 .ENDIF
1536 LINKINCTARGETS+=$(MISC)/$(APP8TARGETN:b)_linkinc.ls
1537 $(APP8TARGETN) : $(LINKINCTARGETS)
1538 .ENDIF # "$(linkinc)"!=""
1540 # Allow for target specific LIBSALCPPRT override
1541 APP8LIBSALCPPRT*=$(LIBSALCPPRT)
1543 $(APP8TARGETN): $(APP8OBJS) $(APP8LIBS) \
1544 $(APP8RES) \
1545 $(APP8ICON) $(APP8DEPN) $(USE_APP8DEF)
1546 @echo "Making: " $(@:f)
1547 .IF "$(GUI)"=="UNX"
1548 .IF "$(OS)"=="MACOSX"
1549 @-$(RM) $(MISC)/$(@:b).list
1550 @-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
1551 @-$(RM) $(MISC)/$(@:b).strip
1552 @echo $(STDSLO) $(APP8OBJS:s/.obj/.o/) \
1553 `cat /dev/null $(APP8LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
1554 @/bin/echo -n $(APP8LINKER) $(APP8LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
1555 $(APP8LINKTYPEFLAG) $(APP8STDLIBS) $(APP8STDLIB) $(STDLIB8) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_8.cmd
1556 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
1557 `cat $(MISC)/$(TARGET).$(@:b)_8.cmd` \
1558 >> $(MISC)/$(TARGET).$(@:b)_8.cmd
1559 .IF "$(VERBOSE)" == "TRUE"
1560 @cat $(MISC)/$(TARGET).$(@:b)_8.cmd
1561 .ENDIF
1562 @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
1563 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1564 # libraries at runtime
1565 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
1566 @strip -i -R $(MISC)/$(@:b).strip -X $@
1567 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
1568 app $(APP8RPATH) $@
1569 .IF "$(TARGETTYPE)"=="GUI"
1570 @echo "Making: " $(@:f).app
1571 @macosx-create-bundle $@
1572 .ENDIF # "$(TARGETTYPE)"=="GUI"
1573 .ELSE # "$(OS)"=="MACOSX"
1574 @-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
1575 @echo $(APP8LINKER) $(APP8LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1576 $(APP8OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_8.cmd
1577 @cat $(mktmp /dev/null $(APP8LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_8.cmd
1578 @echo $(APP8LINKTYPEFLAG) $(APP8LIBSALCPPRT) $(APP8STDLIBS) $(APP8STDLIB) $(STDLIB8) -o $@ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
1579 .IF "$(VERBOSE)" == "TRUE"
1580 @cat $(MISC)/$(TARGET).$(@:b)_8.cmd
1581 .ENDIF
1582 @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
1583 .IF "$(VERBOSE)" == "TRUE"
1584 .ENDIF
1585 .ENDIF # "$(OS)"=="MACOSX"
1586 .ENDIF
1587 .IF "$(GUI)" == "WNT"
1588 @@-$(MKDIR) $(@:d:d)
1589 .IF "$(APP8LINKRES)" != ""
1590 @@-$(RM) $(MISC)/$(APP8LINKRES:b).rc
1591 .IF "$(APP8ICON)" != ""
1592 @-echo 1 ICON $(EMQ)"$(APP8ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP8LINKRES:b).rc
1593 .ENDIF # "$(APP8ICON)" != ""
1594 .IF "$(APP8VERINFO)" != ""
1595 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP8LINKRES:b).rc
1596 @-echo $(EMQ)#include $(EMQ)"$(APP8VERINFO)$(EMQ)" >> $(MISC)/$(APP8LINKRES:b).rc
1597 .ENDIF # "$(APP8VERINFO)" != ""
1598 .IF "$(COM)" == "GCC"
1599 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP8PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP8LINKRES:b).res $(MISC)/$(APP8LINKRES:b).rc
1600 .ELSE
1601 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP8PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP8LINKRES:b).rc
1602 .ENDIF
1603 .ENDIF # "$(APP8LINKRES)" != ""
1604 .IF "$(COM)" == "GCC"
1605 .IF "$(APP8LINKRES)" != "" || "$(APP8RES)" != ""
1606 @cat $(APP8LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP8RES)) > $(MISC)/$(@:b)_all.res
1607 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP8RESO)
1608 .ENDIF
1609 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1610 $(APP8BASEX) $(APP8STACKN) -o $@ $(APP8OBJS) \
1611 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP8RESO) \
1612 `$(TYPE) /dev/null $(APP8LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1613 $(APP_LINKTYPE) $(APP8LIBSALCPPRT) \
1614 -Wl,--start-group $(APP8STDLIBS) -Wl,--end-group $(APP8STDLIB) \
1615 $(STDLIB8) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_8.cmd
1616 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
1617 .IF "$(VERBOSE)" == "TRUE"
1618 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_8.cmd
1619 .ENDIF
1620 @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
1621 .ELSE # "$(COM)" == "GCC"
1622 .IF "$(linkinc)" == ""
1623 $(COMMAND_ECHO)$(APP8LINKER) @$(mktmp \
1624 $(APP8LINKFLAGS) \
1625 $(LINKFLAGSAPP) $(APP8BASEX) \
1626 $(APP8STACKN) \
1627 -out:$@ \
1628 -map:$(MISC)/{$(subst,/,_ $(APP8TARGET)).map} \
1629 $(STDOBJ) \
1630 $(APP8LINKRES) \
1631 $(APP8RES) \
1632 $(APP8OBJS) \
1633 $(APP8LIBS) \
1634 $(APP8STDLIBS) \
1635 $(APP8STDLIB) $(STDLIB8) \
1637 @-echo linking $@.manifest ...
1638 .IF "$(VISTA_MANIFEST)"!=""
1639 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1640 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1641 .ELSE
1642 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1643 .ENDIF # "$(VISTA_MANIFEST)"!=""
1644 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1645 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1646 .ELSE
1647 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP8TARGET).lnk
1648 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP8TARGET).lst
1649 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
1650 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1651 type $(mktmp,$(MISC)\$(APP8TARGET).lst
1652 $(APP8LINKFLAGS) \
1653 $(LINKFLAGSAPP) $(APP8BASEX) \
1654 $(APP8STACKN) \
1655 -out:$@ \
1656 $(STDOBJ) \
1657 $(APP8LINKRES) \
1658 $(APP8RES) \
1659 $(APP8OBJS) \
1660 $(APP8LIBS) \
1661 $(APP8STDLIBS) \
1662 $(APP8STDLIB) $(STDLIB8))
1663 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP8TARGETN:b)_linkobj.lst >> $(MISC)\$(APP8TARGET).lst
1664 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP8TARGET).lst $(THEN) type $(MISC)/$(APP8TARGET).lst >> $(MISC)/$(APP8TARGET).lnk $(FI)
1665 $(COMMAND_ECHO)$(SED)$(APP8LINKER) @$(MISC)\$(APP8TARGET).lnk
1666 .ENDIF # "$(linkinc)" == ""
1667 .ENDIF # "$(COM)" == "GCC"
1668 .IF "$(APP8TARGET)" == "loader"
1669 $(COMMAND_ECHO)$(PERL) loader.pl $@
1670 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1671 $(COMMAND_ECHO)$(RM) $@
1672 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1673 .ENDIF # "$(TARGET)" == "setup"
1675 .ENDIF # "$(GUI)" == "WNT"
1677 .ENDIF # "$(APP8TARGETN)"!=""
1680 # Instruction for linking
1681 # unroll begin
1683 .IF "$(APP9LINKTYPE)" != ""
1684 #must be either STATIC or SHARED
1685 APP9LINKTYPEFLAG=$(APPLINK$(APP9LINKTYPE))
1686 .ENDIF
1688 # decide how to link
1689 .IF "$(APP9CODETYPE)"=="C"
1690 APP9LINKER=$(LINKC)
1691 APP9STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1692 APP9LINKFLAGS+=$(LINKCFLAGS)
1693 .ELSE # "$(APP9CODETYPE)"=="C"
1694 APP9LINKER=$(LINK)
1695 APP9STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1696 APP9LINKFLAGS+=$(LINKFLAGS)
1697 .ENDIF # "$(APP9CODETYPE)"=="C"
1699 APP9RPATH*=OOO
1700 LINKFLAGSRUNPATH_$(APP9RPATH)*=/ERROR:/Bad_APP9RPATH_value
1701 .IF "$(OS)" != "MACOSX"
1702 APP9LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP9RPATH))
1703 .ENDIF
1705 .IF "$(APP9STACK)" != ""
1706 .IF "$(LINKFLAGSTACK)" != ""
1707 APP9STACKN=$(LINKFLAGSTACK)$(APP9STACK)
1708 .ENDIF
1709 .ELSE
1710 APP9STACKN=
1711 .ENDIF
1713 .IF "$(APP9NOSAL)"==""
1714 .IF "$(TARGETTYPE)" == "GUI"
1715 APP9STDLIB+= -lvclmain
1716 .ENDIF
1717 .ENDIF
1719 .IF "$(GUI)$(COM)" == "WNTGCC"
1720 APP9RESO=
1721 .IF "$(APP9LINKRES)" != "" || "$(APP9RES)" != ""
1722 APP9RESO=$(MISC)/$(APP9TARGET:b)_res.o
1723 .ENDIF
1724 .ENDIF
1726 .IF "$(GUI)" == "UNX"
1727 APP9DEPN+:=$(APP9DEPNU)
1728 USE_APP9DEF=
1729 .ENDIF
1731 .IF "$(APP9TARGETN)"!=""
1733 .IF "$(APP9PRODUCTNAME)"!=""
1734 APP9PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP9PRODUCTNAME)\"
1735 .ENDIF # "$(APP9PRODUCTNAME)"!=""
1737 .IF "$(linkinc)"!=""
1738 .IF "$(GUI)"=="WNT"
1739 .IF "$(APP9LIBS)"!=""
1740 $(MISC)/$(APP9TARGET)_linkinc.ls .PHONY:
1741 @@-$(RM) $@
1742 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP9LIBS) $(i:s/.lib/.lin/)) >> $@
1743 .ENDIF #"$(APP9LIBS)"!=""
1744 .ENDIF
1746 LINKINCTARGETS+=$(MISC)/$(APP9TARGETN:b)_linkinc.ls
1747 $(APP9TARGETN) : $(LINKINCTARGETS)
1748 .ENDIF # "$(linkinc)"!=""
1750 # Allow for target specific LIBSALCPPRT override
1751 APP9LIBSALCPPRT*=$(LIBSALCPPRT)
1753 $(APP9TARGETN): $(APP9OBJS) $(APP9LIBS) \
1754 $(APP9RES) \
1755 $(APP9ICON) $(APP9DEPN) $(USE_APP9DEF)
1756 @echo "Making: " $(@:f)
1757 .IF "$(GUI)"=="UNX"
1758 .IF "$(OS)"=="MACOSX"
1759 @-$(RM) $(MISC)/$(@:b).list
1760 @-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
1761 @-$(RM) $(MISC)/$(@:b).strip
1762 @echo $(STDSLO) $(APP9OBJS:s/.obj/.o/) \
1763 `cat /dev/null $(APP9LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
1764 @/bin/echo -n $(APP9LINKER) $(APP9LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
1765 $(APP9LINKTYPEFLAG) $(APP9STDLIBS) $(APP9STDLIB) $(STDLIB9) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_9.cmd
1766 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
1767 `cat $(MISC)/$(TARGET).$(@:b)_9.cmd` \
1768 >> $(MISC)/$(TARGET).$(@:b)_9.cmd
1769 .IF "$(VERBOSE)" == "TRUE"
1770 @cat $(MISC)/$(TARGET).$(@:b)_9.cmd
1771 .ENDIF
1772 @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
1773 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1774 # libraries at runtime
1775 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
1776 @strip -i -R $(MISC)/$(@:b).strip -X $@
1777 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
1778 app $(APP9RPATH) $@
1779 .IF "$(TARGETTYPE)"=="GUI"
1780 @echo "Making: " $(@:f).app
1781 @macosx-create-bundle $@
1782 .ENDIF # "$(TARGETTYPE)"=="GUI"
1783 .ELSE # "$(OS)"=="MACOSX"
1784 @-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
1785 @echo $(APP9LINKER) $(APP9LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1786 $(APP9OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_9.cmd
1787 @cat $(mktmp /dev/null $(APP9LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_9.cmd
1788 @echo $(APP9LINKTYPEFLAG) $(APP9LIBSALCPPRT) $(APP9STDLIBS) $(APP9STDLIB) $(STDLIB9) -o $@ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
1789 .IF "$(VERBOSE)" == "TRUE"
1790 @cat $(MISC)/$(TARGET).$(@:b)_9.cmd
1791 .ENDIF
1792 @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
1793 .IF "$(VERBOSE)" == "TRUE"
1794 .ENDIF
1795 .ENDIF # "$(OS)"=="MACOSX"
1796 .ENDIF
1797 .IF "$(GUI)" == "WNT"
1798 @@-$(MKDIR) $(@:d:d)
1799 .IF "$(APP9LINKRES)" != ""
1800 @@-$(RM) $(MISC)/$(APP9LINKRES:b).rc
1801 .IF "$(APP9ICON)" != ""
1802 @-echo 1 ICON $(EMQ)"$(APP9ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP9LINKRES:b).rc
1803 .ENDIF # "$(APP9ICON)" != ""
1804 .IF "$(APP9VERINFO)" != ""
1805 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP9LINKRES:b).rc
1806 @-echo $(EMQ)#include $(EMQ)"$(APP9VERINFO)$(EMQ)" >> $(MISC)/$(APP9LINKRES:b).rc
1807 .ENDIF # "$(APP9VERINFO)" != ""
1808 .IF "$(COM)" == "GCC"
1809 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP9PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP9LINKRES:b).res $(MISC)/$(APP9LINKRES:b).rc
1810 .ELSE
1811 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP9PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP9LINKRES:b).rc
1812 .ENDIF
1813 .ENDIF # "$(APP9LINKRES)" != ""
1814 .IF "$(COM)" == "GCC"
1815 .IF "$(APP9LINKRES)" != "" || "$(APP9RES)" != ""
1816 @cat $(APP9LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP9RES)) > $(MISC)/$(@:b)_all.res
1817 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP9RESO)
1818 .ENDIF
1819 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1820 $(APP9BASEX) $(APP9STACKN) -o $@ $(APP9OBJS) \
1821 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP9RESO) \
1822 `$(TYPE) /dev/null $(APP9LIBS) | sed s#$(ROUT)#$(OUT)#g` \
1823 $(APP_LINKTYPE) $(APP9LIBSALCPPRT) \
1824 -Wl,--start-group $(APP9STDLIBS) -Wl,--end-group $(APP9STDLIB) \
1825 $(STDLIB9) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_9.cmd
1826 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
1827 .IF "$(VERBOSE)" == "TRUE"
1828 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_9.cmd
1829 .ENDIF
1830 @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
1831 .ELSE # "$(COM)" == "GCC"
1832 .IF "$(linkinc)" == ""
1833 $(COMMAND_ECHO)$(APP9LINKER) @$(mktmp \
1834 $(APP9LINKFLAGS) \
1835 $(LINKFLAGSAPP) $(APP9BASEX) \
1836 $(APP9STACKN) \
1837 -out:$@ \
1838 -map:$(MISC)/{$(subst,/,_ $(APP9TARGET)).map} \
1839 $(STDOBJ) \
1840 $(APP9LINKRES) \
1841 $(APP9RES) \
1842 $(APP9OBJS) \
1843 $(APP9LIBS) \
1844 $(APP9STDLIBS) \
1845 $(APP9STDLIB) $(STDLIB9) \
1847 @-echo linking $@.manifest ...
1848 .IF "$(VISTA_MANIFEST)"!=""
1849 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
1850 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
1851 .ELSE
1852 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
1853 .ENDIF # "$(VISTA_MANIFEST)"!=""
1854 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
1855 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
1856 .ELSE
1857 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP9TARGET).lnk
1858 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP9TARGET).lst
1859 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
1860 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
1861 type $(mktmp,$(MISC)\$(APP9TARGET).lst
1862 $(APP9LINKFLAGS) \
1863 $(LINKFLAGSAPP) $(APP9BASEX) \
1864 $(APP9STACKN) \
1865 -out:$@ \
1866 $(STDOBJ) \
1867 $(APP9LINKRES) \
1868 $(APP9RES) \
1869 $(APP9OBJS) \
1870 $(APP9LIBS) \
1871 $(APP9STDLIBS) \
1872 $(APP9STDLIB) $(STDLIB9))
1873 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP9TARGETN:b)_linkobj.lst >> $(MISC)\$(APP9TARGET).lst
1874 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP9TARGET).lst $(THEN) type $(MISC)/$(APP9TARGET).lst >> $(MISC)/$(APP9TARGET).lnk $(FI)
1875 $(COMMAND_ECHO)$(SED)$(APP9LINKER) @$(MISC)\$(APP9TARGET).lnk
1876 .ENDIF # "$(linkinc)" == ""
1877 .ENDIF # "$(COM)" == "GCC"
1878 .IF "$(APP9TARGET)" == "loader"
1879 $(COMMAND_ECHO)$(PERL) loader.pl $@
1880 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
1881 $(COMMAND_ECHO)$(RM) $@
1882 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
1883 .ENDIF # "$(TARGET)" == "setup"
1885 .ENDIF # "$(GUI)" == "WNT"
1887 .ENDIF # "$(APP9TARGETN)"!=""
1890 # Instruction for linking
1891 # unroll begin
1893 .IF "$(APP10LINKTYPE)" != ""
1894 #must be either STATIC or SHARED
1895 APP10LINKTYPEFLAG=$(APPLINK$(APP10LINKTYPE))
1896 .ENDIF
1898 # decide how to link
1899 .IF "$(APP10CODETYPE)"=="C"
1900 APP10LINKER=$(LINKC)
1901 APP10STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
1902 APP10LINKFLAGS+=$(LINKCFLAGS)
1903 .ELSE # "$(APP10CODETYPE)"=="C"
1904 APP10LINKER=$(LINK)
1905 APP10STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
1906 APP10LINKFLAGS+=$(LINKFLAGS)
1907 .ENDIF # "$(APP10CODETYPE)"=="C"
1909 APP10RPATH*=OOO
1910 LINKFLAGSRUNPATH_$(APP10RPATH)*=/ERROR:/Bad_APP10RPATH_value
1911 .IF "$(OS)" != "MACOSX"
1912 APP10LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP10RPATH))
1913 .ENDIF
1915 .IF "$(APP10STACK)" != ""
1916 .IF "$(LINKFLAGSTACK)" != ""
1917 APP10STACKN=$(LINKFLAGSTACK)$(APP10STACK)
1918 .ENDIF
1919 .ELSE
1920 APP10STACKN=
1921 .ENDIF
1923 .IF "$(APP10NOSAL)"==""
1924 .IF "$(TARGETTYPE)" == "GUI"
1925 APP10STDLIB+= -lvclmain
1926 .ENDIF
1927 .ENDIF
1929 .IF "$(GUI)$(COM)" == "WNTGCC"
1930 APP10RESO=
1931 .IF "$(APP10LINKRES)" != "" || "$(APP10RES)" != ""
1932 APP10RESO=$(MISC)/$(APP10TARGET:b)_res.o
1933 .ENDIF
1934 .ENDIF
1936 .IF "$(GUI)" == "UNX"
1937 APP10DEPN+:=$(APP10DEPNU)
1938 USE_APP10DEF=
1939 .ENDIF
1941 .IF "$(APP10TARGETN)"!=""
1943 .IF "$(APP10PRODUCTNAME)"!=""
1944 APP10PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP10PRODUCTNAME)\"
1945 .ENDIF # "$(APP10PRODUCTNAME)"!=""
1947 .IF "$(linkinc)"!=""
1948 .IF "$(GUI)"=="WNT"
1949 .IF "$(APP10LIBS)"!=""
1950 $(MISC)/$(APP10TARGET)_linkinc.ls .PHONY:
1951 @@-$(RM) $@
1952 sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP10LIBS) $(i:s/.lib/.lin/)) >> $@
1953 .ENDIF #"$(APP10LIBS)"!=""
1954 .ENDIF
1956 LINKINCTARGETS+=$(MISC)/$(APP10TARGETN:b)_linkinc.ls
1957 $(APP10TARGETN) : $(LINKINCTARGETS)
1958 .ENDIF # "$(linkinc)"!=""
1960 # Allow for target specific LIBSALCPPRT override
1961 APP10LIBSALCPPRT*=$(LIBSALCPPRT)
1963 $(APP10TARGETN): $(APP10OBJS) $(APP10LIBS) \
1964 $(APP10RES) \
1965 $(APP10ICON) $(APP10DEPN) $(USE_APP10DEF)
1966 @echo "Making: " $(@:f)
1967 .IF "$(GUI)"=="UNX"
1968 .IF "$(OS)"=="MACOSX"
1969 @-$(RM) $(MISC)/$(@:b).list
1970 @-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
1971 @-$(RM) $(MISC)/$(@:b).strip
1972 @echo $(STDSLO) $(APP10OBJS:s/.obj/.o/) \
1973 `cat /dev/null $(APP10LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
1974 @/bin/echo -n $(APP10LINKER) $(APP10LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
1975 $(APP10LINKTYPEFLAG) $(APP10STDLIBS) $(APP10STDLIB) $(STDLIB10) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_10.cmd
1976 @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
1977 `cat $(MISC)/$(TARGET).$(@:b)_10.cmd` \
1978 >> $(MISC)/$(TARGET).$(@:b)_10.cmd
1979 .IF "$(VERBOSE)" == "TRUE"
1980 @cat $(MISC)/$(TARGET).$(@:b)_10.cmd
1981 .ENDIF
1982 @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
1983 # Need to strip __objcInit symbol to avoid duplicate symbols when loading
1984 # libraries at runtime
1985 @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
1986 @strip -i -R $(MISC)/$(@:b).strip -X $@
1987 @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
1988 app $(APP10RPATH) $@
1989 .IF "$(TARGETTYPE)"=="GUI"
1990 @echo "Making: " $(@:f).app
1991 @macosx-create-bundle $@
1992 .ENDIF # "$(TARGETTYPE)"=="GUI"
1993 .ELSE # "$(OS)"=="MACOSX"
1994 @-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
1995 @echo $(APP10LINKER) $(APP10LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
1996 $(APP10OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_10.cmd
1997 @cat $(mktmp /dev/null $(APP10LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_10.cmd
1998 @echo $(APP10LINKTYPEFLAG) $(APP10LIBSALCPPRT) $(APP10STDLIBS) $(APP10STDLIB) $(STDLIB10) -o $@ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
1999 .IF "$(VERBOSE)" == "TRUE"
2000 @cat $(MISC)/$(TARGET).$(@:b)_10.cmd
2001 .ENDIF
2002 @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
2003 .IF "$(VERBOSE)" == "TRUE"
2004 .ENDIF
2005 .ENDIF # "$(OS)"=="MACOSX"
2006 .ENDIF
2007 .IF "$(GUI)" == "WNT"
2008 @@-$(MKDIR) $(@:d:d)
2009 .IF "$(APP10LINKRES)" != ""
2010 @@-$(RM) $(MISC)/$(APP10LINKRES:b).rc
2011 .IF "$(APP10ICON)" != ""
2012 @-echo 1 ICON $(EMQ)"$(APP10ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP10LINKRES:b).rc
2013 .ENDIF # "$(APP10ICON)" != ""
2014 .IF "$(APP10VERINFO)" != ""
2015 @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP10LINKRES:b).rc
2016 @-echo $(EMQ)#include $(EMQ)"$(APP10VERINFO)$(EMQ)" >> $(MISC)/$(APP10LINKRES:b).rc
2017 .ENDIF # "$(APP10VERINFO)" != ""
2018 .IF "$(COM)" == "GCC"
2019 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP10PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) -o $(MISC)/$(APP10LINKRES:b).res $(MISC)/$(APP10LINKRES:b).rc
2020 .ELSE
2021 $(COMMAND_ECHO)$(RC) -DWIN32 $(APP10PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP10LINKRES:b).rc
2022 .ENDIF
2023 .ENDIF # "$(APP10LINKRES)" != ""
2024 .IF "$(COM)" == "GCC"
2025 .IF "$(APP10LINKRES)" != "" || "$(APP10RES)" != ""
2026 @cat $(APP10LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP10RES)) > $(MISC)/$(@:b)_all.res
2027 $(WINDRES) $(MISC)/$(@:b)_all.res $(APP10RESO)
2028 .ENDIF
2029 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
2030 $(APP10BASEX) $(APP10STACKN) -o $@ $(APP10OBJS) \
2031 -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP10RESO) \
2032 `$(TYPE) /dev/null $(APP10LIBS) | sed s#$(ROUT)#$(OUT)#g` \
2033 $(APP_LINKTYPE) $(APP10LIBSALCPPRT) \
2034 -Wl,--start-group $(APP10STDLIBS) -Wl,--end-group $(APP10STDLIB) \
2035 $(STDLIB10) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_10.cmd
2036 # need this comment line, else dmake somehow gets confused by the .IFs and .ENDIFs
2037 .IF "$(VERBOSE)" == "TRUE"
2038 @$(TYPE) $(MISC)/$(TARGET).$(@:b)_10.cmd
2039 .ENDIF
2040 @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
2041 .ELSE # "$(COM)" == "GCC"
2042 .IF "$(linkinc)" == ""
2043 $(COMMAND_ECHO)$(APP10LINKER) @$(mktmp \
2044 $(APP10LINKFLAGS) \
2045 $(LINKFLAGSAPP) $(APP10BASEX) \
2046 $(APP10STACKN) \
2047 -out:$@ \
2048 -map:$(MISC)/{$(subst,/,_ $(APP10TARGET)).map} \
2049 $(STDOBJ) \
2050 $(APP10LINKRES) \
2051 $(APP10RES) \
2052 $(APP10OBJS) \
2053 $(APP10LIBS) \
2054 $(APP10STDLIBS) \
2055 $(APP10STDLIB) $(STDLIB10) \
2057 @-echo linking $@.manifest ...
2058 .IF "$(VISTA_MANIFEST)"!=""
2059 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
2060 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
2061 .ELSE
2062 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
2063 .ENDIF # "$(VISTA_MANIFEST)"!=""
2064 $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
2065 $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
2066 .ELSE
2067 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP10TARGET).lnk
2068 $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP10TARGET).lst
2069 $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
2070 for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
2071 type $(mktmp,$(MISC)\$(APP10TARGET).lst
2072 $(APP10LINKFLAGS) \
2073 $(LINKFLAGSAPP) $(APP10BASEX) \
2074 $(APP10STACKN) \
2075 -out:$@ \
2076 $(STDOBJ) \
2077 $(APP10LINKRES) \
2078 $(APP10RES) \
2079 $(APP10OBJS) \
2080 $(APP10LIBS) \
2081 $(APP10STDLIBS) \
2082 $(APP10STDLIB) $(STDLIB10))
2083 $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP10TARGETN:b)_linkobj.lst >> $(MISC)\$(APP10TARGET).lst
2084 $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP10TARGET).lst $(THEN) type $(MISC)/$(APP10TARGET).lst >> $(MISC)/$(APP10TARGET).lnk $(FI)
2085 $(COMMAND_ECHO)$(SED)$(APP10LINKER) @$(MISC)\$(APP10TARGET).lnk
2086 .ENDIF # "$(linkinc)" == ""
2087 .ENDIF # "$(COM)" == "GCC"
2088 .IF "$(APP10TARGET)" == "loader"
2089 $(COMMAND_ECHO)$(PERL) loader.pl $@
2090 $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
2091 $(COMMAND_ECHO)$(RM) $@
2092 $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
2093 .ENDIF # "$(TARGET)" == "setup"
2095 .ENDIF # "$(GUI)" == "WNT"
2097 .ENDIF # "$(APP10TARGETN)"!=""
2100 # Instruction for linking