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