xref: /aoo41x/main/solenv/inc/tg_app.mk (revision cdf0e10c)
1*cdf0e10cSrcweir#*************************************************************************
2*cdf0e10cSrcweir#
3*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir#
5*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir#
7*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir#
9*cdf0e10cSrcweir# This file is part of OpenOffice.org.
10*cdf0e10cSrcweir#
11*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir# only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir#
15*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir#
21*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir# for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir#
26*cdf0e10cSrcweir#*************************************************************************
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir#######################################################
29*cdf0e10cSrcweir# instructions for linking
30*cdf0e10cSrcweir# unroll begin
31*cdf0e10cSrcweir
32*cdf0e10cSrcweir.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
33*cdf0e10cSrcweirAPP$(TNR)DEF = $(MISC)/$(APP$(TNR)TARGET).def
34*cdf0e10cSrcweir.ENDIF
35*cdf0e10cSrcweir
36*cdf0e10cSrcweir.IF "$(APP$(TNR)LINKTYPE)" != ""
37*cdf0e10cSrcweir#must be either STATIC or SHARED
38*cdf0e10cSrcweirAPP$(TNR)LINKTYPEFLAG=$(APPLINK$(APP$(TNR)LINKTYPE))
39*cdf0e10cSrcweir.ENDIF
40*cdf0e10cSrcweir
41*cdf0e10cSrcweir# decide how to link
42*cdf0e10cSrcweir.IF "$(APP$(TNR)CODETYPE)"=="C"
43*cdf0e10cSrcweirAPP$(TNR)LINKER=$(LINKC)
44*cdf0e10cSrcweirAPP$(TNR)STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
45*cdf0e10cSrcweirAPP$(TNR)LINKFLAGS+=$(LINKCFLAGS)
46*cdf0e10cSrcweir.ELSE			# "$(APP$(TNR)CODETYPE)"=="C"
47*cdf0e10cSrcweirAPP$(TNR)LINKER=$(LINK)
48*cdf0e10cSrcweirAPP$(TNR)STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
49*cdf0e10cSrcweirAPP$(TNR)LINKFLAGS+=$(LINKFLAGS)
50*cdf0e10cSrcweir.ENDIF			# "$(APP$(TNR)CODETYPE)"=="C"
51*cdf0e10cSrcweir
52*cdf0e10cSrcweirAPP$(TNR)RPATH*=OOO
53*cdf0e10cSrcweirLINKFLAGSRUNPATH_$(APP$(TNR)RPATH)*=/ERROR:/Bad_APP$(TNR)RPATH_value
54*cdf0e10cSrcweir.IF "$(OS)" != "MACOSX"
55*cdf0e10cSrcweirAPP$(TNR)LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP$(TNR)RPATH))
56*cdf0e10cSrcweir.ENDIF
57*cdf0e10cSrcweir
58*cdf0e10cSrcweir.IF "$(APP$(TNR)STACK)" != ""
59*cdf0e10cSrcweir.IF "$(LINKFLAGSTACK)" != ""
60*cdf0e10cSrcweirAPP$(TNR)STACKN=$(LINKFLAGSTACK)$(APP$(TNR)STACK)
61*cdf0e10cSrcweir.ENDIF
62*cdf0e10cSrcweir.ELSE
63*cdf0e10cSrcweirAPP$(TNR)STACKN=
64*cdf0e10cSrcweir.ENDIF
65*cdf0e10cSrcweir
66*cdf0e10cSrcweir.IF "$(APP$(TNR)NOSAL)"==""
67*cdf0e10cSrcweir.IF "$(TARGETTYPE)" == "GUI"
68*cdf0e10cSrcweirAPP$(TNR)OBJS+= $(STDOBJVCL)
69*cdf0e10cSrcweir.ENDIF
70*cdf0e10cSrcweir.ENDIF
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir.IF "$(GUI)$(COM)" == "WNTGCC"
73*cdf0e10cSrcweirAPP$(TNR)RESO=
74*cdf0e10cSrcweir.IF "$(APP$(TNR)LINKRES)" != "" || "$(APP$(TNR)RES)" != ""
75*cdf0e10cSrcweirAPP$(TNR)RESO=$(MISC)/$(APP$(TNR)TARGET:b)_res.o
76*cdf0e10cSrcweir.ENDIF
77*cdf0e10cSrcweir.ENDIF
78*cdf0e10cSrcweir
79*cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
80*cdf0e10cSrcweirAPP$(TNR)DEPN+:=$(APP$(TNR)DEPNU)
81*cdf0e10cSrcweirUSE_APP$(TNR)DEF=
82*cdf0e10cSrcweir.ENDIF
83*cdf0e10cSrcweir
84*cdf0e10cSrcweir.IF "$(APP$(TNR)TARGETN)"!=""
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir.IF "$(APP$(TNR)PRODUCTNAME)"!=""
87*cdf0e10cSrcweirAPP$(TNR)PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP$(TNR)PRODUCTNAME)\"
88*cdf0e10cSrcweir.ENDIF			# "$(APP$(TNR)PRODUCTNAME)"!=""
89*cdf0e10cSrcweir
90*cdf0e10cSrcweir.IF "$(linkinc)"!=""
91*cdf0e10cSrcweir.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
92*cdf0e10cSrcweir.IF "$(APP$(TNR)LIBS)"!=""
93*cdf0e10cSrcweir$(MISC)/$(APP$(TNR)TARGET)_linkinc.ls .PHONY:
94*cdf0e10cSrcweir	@@-$(RM) $@
95*cdf0e10cSrcweir	sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP$(TNR)LIBS) $(i:s/.lib/.lin/)) >> $@
96*cdf0e10cSrcweir.ENDIF          #"$(APP$(TNR)LIBS)"!=""
97*cdf0e10cSrcweir.ENDIF
98*cdf0e10cSrcweir
99*cdf0e10cSrcweirLINKINCTARGETS+=$(MISC)/$(APP$(TNR)TARGETN:b)_linkinc.ls
100*cdf0e10cSrcweir$(APP$(TNR)TARGETN) : $(LINKINCTARGETS)
101*cdf0e10cSrcweir.ENDIF          # "$(linkinc)"!=""
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir# Allow for target specific LIBSALCPPRT override
104*cdf0e10cSrcweirAPP$(TNR)LIBSALCPPRT*=$(LIBSALCPPRT)
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir.IF "$(GUI)" == "OS2"
107*cdf0e10cSrcweir_APP$(TNR)IMP_ORD = $(APP$(TNR)STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP$(TNR)STDLIBS:^"$(LB)/")
108*cdf0e10cSrcweirAPP$(TNR)IMP_ORD = $(foreach,i,$(_APP$(TNR)IMP_ORD) $(shell @-ls $i))
109*cdf0e10cSrcweir.ELSE
110*cdf0e10cSrcweirAPP$(TNR)IMP_ORD =
111*cdf0e10cSrcweir.ENDIF
112*cdf0e10cSrcweir
113*cdf0e10cSrcweir$(APP$(TNR)TARGETN): $(APP$(TNR)OBJS) $(APP$(TNR)LIBS) \
114*cdf0e10cSrcweir	$(APP$(TNR)RES) \
115*cdf0e10cSrcweir	$(APP$(TNR)IMP_ORD) \
116*cdf0e10cSrcweir	$(APP$(TNR)ICON) $(APP$(TNR)DEPN) $(USE_APP$(TNR)DEF)
117*cdf0e10cSrcweir	@echo "Making:   " $(@:f)
118*cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
119*cdf0e10cSrcweir.IF "$(OS)"=="MACOSX"
120*cdf0e10cSrcweir	@echo unx
121*cdf0e10cSrcweir	@-$(RM) $(MISC)/$(@:b).list
122*cdf0e10cSrcweir	@-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
123*cdf0e10cSrcweir	@-$(RM) $(MISC)/$(@:b).strip
124*cdf0e10cSrcweir	@echo $(STDSLO) $(APP$(TNR)OBJS:s/.obj/.o/) \
125*cdf0e10cSrcweir	`cat /dev/null $(APP$(TNR)LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
126*cdf0e10cSrcweir	@echo -n $(APP$(TNR)LINKER) $(APP$(TNR)LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
127*cdf0e10cSrcweir	$(APP$(TNR)LINKTYPEFLAG) $(APP$(TNR)STDLIBS) $(APP$(TNR)STDLIB) $(STDLIB$(TNR)) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
128*cdf0e10cSrcweir    @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
129*cdf0e10cSrcweir        `cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd` \
130*cdf0e10cSrcweir        >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
131*cdf0e10cSrcweir  .IF "$(VERBOSE)" == "TRUE"
132*cdf0e10cSrcweir	@cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
133*cdf0e10cSrcweir  .ENDIF
134*cdf0e10cSrcweir	@+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
135*cdf0e10cSrcweir# Need to strip __objcInit symbol to avoid duplicate symbols when loading
136*cdf0e10cSrcweir# libraries at runtime
137*cdf0e10cSrcweir	@-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
138*cdf0e10cSrcweir	@strip -i -R $(MISC)/$(@:b).strip -X $@
139*cdf0e10cSrcweir	@ls -l $@
140*cdf0e10cSrcweir    @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
141*cdf0e10cSrcweir        app $(APP$(TNR)RPATH) $@
142*cdf0e10cSrcweir.IF "$(TARGETTYPE)"=="GUI"
143*cdf0e10cSrcweir	@echo "Making:   " $(@:f).app
144*cdf0e10cSrcweir	@macosx-create-bundle $@
145*cdf0e10cSrcweir.ENDIF		# "$(TARGETTYPE)"=="GUI"
146*cdf0e10cSrcweir.ELSE		# "$(OS)"=="MACOSX"
147*cdf0e10cSrcweir	@echo unx
148*cdf0e10cSrcweir	@-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
149*cdf0e10cSrcweir	@echo $(APP$(TNR)LINKER) $(APP$(TNR)LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
150*cdf0e10cSrcweir	$(APP$(TNR)OBJS:s/.obj/.o/) '\' >  $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
151*cdf0e10cSrcweir	@cat $(mktmp /dev/null $(APP$(TNR)LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#'  >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
152*cdf0e10cSrcweir	@echo $(APP$(TNR)LINKTYPEFLAG) $(APP$(TNR)LIBSALCPPRT) $(APP$(TNR)STDLIBS) $(APP$(TNR)STDLIB) $(STDLIB$(TNR)) -o $@ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
153*cdf0e10cSrcweir  .IF "$(VERBOSE)" == "TRUE"
154*cdf0e10cSrcweir	@cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
155*cdf0e10cSrcweir  .ENDIF
156*cdf0e10cSrcweir	@+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
157*cdf0e10cSrcweir  .IF "$(VERBOSE)" == "TRUE"
158*cdf0e10cSrcweir	@ls -l $@
159*cdf0e10cSrcweir  .ENDIF
160*cdf0e10cSrcweir.ENDIF		# "$(OS)"=="MACOSX"
161*cdf0e10cSrcweir.ENDIF
162*cdf0e10cSrcweir.IF "$(GUI)" == "WNT"
163*cdf0e10cSrcweir	@@-$(MKDIR) $(@:d:d)
164*cdf0e10cSrcweir.IF "$(APP$(TNR)LINKRES)" != ""
165*cdf0e10cSrcweir	@@-$(RM) $(MISC)/$(APP$(TNR)LINKRES:b).rc
166*cdf0e10cSrcweir.IF "$(APP$(TNR)ICON)" != ""
167*cdf0e10cSrcweir	@-echo 1 ICON $(EMQ)"$(APP$(TNR)ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
168*cdf0e10cSrcweir.ENDIF		# "$(APP$(TNR)ICON)" != ""
169*cdf0e10cSrcweir.IF "$(APP$(TNR)VERINFO)" != ""
170*cdf0e10cSrcweir	@-echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
171*cdf0e10cSrcweir	@-echo $(EMQ)#include  $(EMQ)"$(APP$(TNR)VERINFO)$(EMQ)" >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
172*cdf0e10cSrcweir.ENDIF		# "$(APP$(TNR)VERINFO)" != ""
173*cdf0e10cSrcweir	$(COMMAND_ECHO)$(RC) -DWIN32 $(APP$(TNR)PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP$(TNR)LINKRES:b).rc
174*cdf0e10cSrcweir.ENDIF			# "$(APP$(TNR)LINKRES)" != ""
175*cdf0e10cSrcweir.IF "$(COM)" == "GCC"
176*cdf0e10cSrcweir	@echo mingw
177*cdf0e10cSrcweir.IF "$(APP$(TNR)LINKRES)" != "" || "$(APP$(TNR)RES)" != ""
178*cdf0e10cSrcweir	@cat $(APP$(TNR)LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP$(TNR)RES)) >  $(MISC)/$(@:b)_all.res
179*cdf0e10cSrcweir	windres $(MISC)/$(@:b)_all.res $(APP$(TNR)RESO)
180*cdf0e10cSrcweir.ENDIF
181*cdf0e10cSrcweir	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
182*cdf0e10cSrcweir		$(APP$(TNR)BASEX) $(APP$(TNR)STACKN) -o $@ $(APP$(TNR)OBJS) \
183*cdf0e10cSrcweir		-Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP$(TNR)RESO) \
184*cdf0e10cSrcweir		`$(TYPE) /dev/null $(APP$(TNR)LIBS) | sed s#$(ROUT)#$(OUT)#g` \
185*cdf0e10cSrcweir		$(APP_LINKTYPE) $(APP$(TNR)LIBSALCPPRT) \
186*cdf0e10cSrcweir		-Wl,--start-group $(APP$(TNR)STDLIBS) -Wl,--end-group $(APP$(TNR)STDLIB) \
187*cdf0e10cSrcweir		$(STDLIB$(TNR)) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
188*cdf0e10cSrcweir  # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
189*cdf0e10cSrcweir  .IF "$(VERBOSE)" == "TRUE"
190*cdf0e10cSrcweir	@$(TYPE)  $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
191*cdf0e10cSrcweir  .ENDIF
192*cdf0e10cSrcweir	@+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
193*cdf0e10cSrcweir	@ls -l $@
194*cdf0e10cSrcweir.ELSE	# "$(COM)" == "GCC"
195*cdf0e10cSrcweir.IF "$(linkinc)" == ""
196*cdf0e10cSrcweir	$(COMMAND_ECHO)$(APP$(TNR)LINKER) @$(mktmp \
197*cdf0e10cSrcweir		$(APP$(TNR)LINKFLAGS) \
198*cdf0e10cSrcweir		$(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
199*cdf0e10cSrcweir		$(APP$(TNR)STACKN) \
200*cdf0e10cSrcweir		-out:$@ \
201*cdf0e10cSrcweir		-map:$(MISC)/{$(subst,/,_ $(APP$(TNR)TARGET)).map} \
202*cdf0e10cSrcweir		$(STDOBJ) \
203*cdf0e10cSrcweir		$(APP$(TNR)LINKRES) \
204*cdf0e10cSrcweir		$(APP$(TNR)RES) \
205*cdf0e10cSrcweir		$(APP$(TNR)OBJS) \
206*cdf0e10cSrcweir		$(APP$(TNR)LIBS) \
207*cdf0e10cSrcweir		$(APP$(TNR)STDLIBS) \
208*cdf0e10cSrcweir		$(APP$(TNR)STDLIB) $(STDLIB$(TNR)) \
209*cdf0e10cSrcweir		)
210*cdf0e10cSrcweir	@-echo linking $@.manifest ...
211*cdf0e10cSrcweir.IF "$(VISTA_MANIFEST)"!=""
212*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
213*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
214*cdf0e10cSrcweir.ELSE
215*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
216*cdf0e10cSrcweir.ENDIF # "$(VISTA_MANIFEST)"!=""
217*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
218*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
219*cdf0e10cSrcweir.ELSE
220*cdf0e10cSrcweir		$(COMMAND_ECHO)-$(RM) $(MISC)\$(APP$(TNR)TARGET).lnk
221*cdf0e10cSrcweir		$(COMMAND_ECHO)-$(RM) $(MISC)\$(APP$(TNR)TARGET).lst
222*cdf0e10cSrcweir		$(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
223*cdf0e10cSrcweir		for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
224*cdf0e10cSrcweir	type $(mktmp,$(MISC)\$(APP$(TNR)TARGET).lst
225*cdf0e10cSrcweir		$(APP$(TNR)LINKFLAGS) \
226*cdf0e10cSrcweir		$(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
227*cdf0e10cSrcweir		$(APP$(TNR)STACKN) \
228*cdf0e10cSrcweir		-out:$@ \
229*cdf0e10cSrcweir		$(STDOBJ) \
230*cdf0e10cSrcweir		$(APP$(TNR)LINKRES) \
231*cdf0e10cSrcweir		$(APP$(TNR)RES) \
232*cdf0e10cSrcweir		$(APP$(TNR)OBJS) \
233*cdf0e10cSrcweir		$(APP$(TNR)LIBS) \
234*cdf0e10cSrcweir		$(APP$(TNR)STDLIBS) \
235*cdf0e10cSrcweir		$(APP$(TNR)STDLIB) $(STDLIB$(TNR)))
236*cdf0e10cSrcweir		$(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP$(TNR)TARGETN:b)_linkobj.lst >> $(MISC)\$(APP$(TNR)TARGET).lst
237*cdf0e10cSrcweir		$(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP$(TNR)TARGET).lst $(THEN) type $(MISC)/$(APP$(TNR)TARGET).lst  >> $(MISC)/$(APP$(TNR)TARGET).lnk $(FI)
238*cdf0e10cSrcweir		$(COMMAND_ECHO)$(SED)$(APP$(TNR)LINKER) @$(MISC)\$(APP$(TNR)TARGET).lnk
239*cdf0e10cSrcweir.ENDIF		# "$(linkinc)" == ""
240*cdf0e10cSrcweir.ENDIF		# "$(COM)" == "GCC"
241*cdf0e10cSrcweir.IF "$(APP$(TNR)TARGET)" == "loader"
242*cdf0e10cSrcweir	$(COMMAND_ECHO)$(PERL) loader.pl $@
243*cdf0e10cSrcweir	$(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
244*cdf0e10cSrcweir	$(COMMAND_ECHO)$(RM) $@
245*cdf0e10cSrcweir	$(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
246*cdf0e10cSrcweir.ENDIF			# "$(TARGET)" == "setup"
247*cdf0e10cSrcweir
248*cdf0e10cSrcweir.ENDIF			# "$(GUI)" == "WNT"
249*cdf0e10cSrcweir
250*cdf0e10cSrcweir.IF "$(GUI)" == "OS2"
251*cdf0e10cSrcweir	@+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
252*cdf0e10cSrcweir.IF "$(APP$(TNR)LINKRES)" != ""
253*cdf0e10cSrcweir	@+-$(RM) $(MISC)/$(APP$(TNR)LINKRES:b).rc >& $(NULLDEV)
254*cdf0e10cSrcweir.IF "$(APP$(TNR)ICON)" != ""
255*cdf0e10cSrcweir	@-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP$(TNR)ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
256*cdf0e10cSrcweir.ENDIF		# "$(APP$(TNR)ICON)" != ""
257*cdf0e10cSrcweir.IF "$(APP$(TNR)VERINFO)" != ""
258*cdf0e10cSrcweir	@-+echo $(EMQ)#define VERVARIANT	$(BUILD) >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
259*cdf0e10cSrcweir	@-+echo $(EMQ)#include  $(EMQ)"$(APP$(TNR)VERINFO)$(EMQ)" >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
260*cdf0e10cSrcweir.ENDIF		# "$(APP$(TNR)VERINFO)" != ""
261*cdf0e10cSrcweir	$(COMMAND_ECHO)$(RC) -r -DOS2 $(APP$(TNR)PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP$(TNR)LINKRES:b).rc
262*cdf0e10cSrcweir.ENDIF			# "$(APP$(TNR)LINKRES)" != ""
263*cdf0e10cSrcweir
264*cdf0e10cSrcweir.IF "$(TARGETTYPE)" == "GUI"
265*cdf0e10cSrcweir	@echo NAME $(APP$(TNR)TARGET) WINDOWAPI > $(MISC)/$(APP$(TNR)TARGET).def
266*cdf0e10cSrcweir.ENDIF
267*cdf0e10cSrcweir
268*cdf0e10cSrcweir  .IF "$(VERBOSE)" == "TRUE"
269*cdf0e10cSrcweir	@+echo	$(APP$(TNR)LINKFLAGS) \
270*cdf0e10cSrcweir		$(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
271*cdf0e10cSrcweir		$(APP$(TNR)STACKN) \
272*cdf0e10cSrcweir		-o $@ \
273*cdf0e10cSrcweir		-Zmap -L$(LB) \
274*cdf0e10cSrcweir		-L$(SOLARVERSION)/$(INPATH)/lib \
275*cdf0e10cSrcweir		$(STDOBJ) \
276*cdf0e10cSrcweir		$(APP$(TNR)LINKRES) \
277*cdf0e10cSrcweir		$(APP$(TNR)RES) \
278*cdf0e10cSrcweir		$(APP$(TNR)DEF) \
279*cdf0e10cSrcweir		$(APP$(TNR)OBJS) \
280*cdf0e10cSrcweir		$(APP$(TNR)LIBS) \
281*cdf0e10cSrcweir		$(APP$(TNR)STDLIBS:^"-l") \
282*cdf0e10cSrcweir		$(APP$(TNR)STDLIB:^"-l") $(STDLIB$(TNR):^"-l")
283*cdf0e10cSrcweir  .ENDIF
284*cdf0e10cSrcweir	$(COMMAND_ECHO)$(APP$(TNR)LINKER) -v \
285*cdf0e10cSrcweir		$(APP$(TNR)LINKFLAGS) \
286*cdf0e10cSrcweir		$(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
287*cdf0e10cSrcweir		$(APP$(TNR)STACKN) \
288*cdf0e10cSrcweir		-o $@ \
289*cdf0e10cSrcweir		-Zmap -L$(LB) \
290*cdf0e10cSrcweir		-L$(SOLARVERSION)/$(INPATH)/lib \
291*cdf0e10cSrcweir		$(STDOBJ) \
292*cdf0e10cSrcweir		$(APP$(TNR)LINKRES) \
293*cdf0e10cSrcweir		$(APP$(TNR)RES) \
294*cdf0e10cSrcweir		$(APP$(TNR)DEF) \
295*cdf0e10cSrcweir		$(APP$(TNR)OBJS) \
296*cdf0e10cSrcweir		$(APP$(TNR)LIBS) \
297*cdf0e10cSrcweir		$(APP$(TNR)STDLIBS:^"-l") \
298*cdf0e10cSrcweir		$(APP$(TNR)STDLIB:^"-l") $(STDLIB$(TNR):^"-l")
299*cdf0e10cSrcweir
300*cdf0e10cSrcweir
301*cdf0e10cSrcweir.IF "$(APP$(TNR)TARGET)" == "loader"
302*cdf0e10cSrcweir	$(COMMAND_ECHO)+$(PERL) loader.pl $@
303*cdf0e10cSrcweir	$(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
304*cdf0e10cSrcweir	$(COMMAND_ECHO)+$(RM) $@
305*cdf0e10cSrcweir	$(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
306*cdf0e10cSrcweir.ENDIF			# "$(TARGET)" == "setup"
307*cdf0e10cSrcweir
308*cdf0e10cSrcweir.ENDIF			# "$(GUI)" == "OS2"
309*cdf0e10cSrcweir
310*cdf0e10cSrcweir.ENDIF			# "$(APP$(TNR)TARGETN)"!=""
311*cdf0e10cSrcweir
312*cdf0e10cSrcweir
313*cdf0e10cSrcweir# Instruction for linking
314*cdf0e10cSrcweir# unroll end
315*cdf0e10cSrcweir#######################################################
316*cdf0e10cSrcweir
317