2000-09-20 08:43:26 -05:00
|
|
|
#*************************************************************************
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2005-09-08 03:42:07 -05:00
|
|
|
# OpenOffice.org - a multi-platform office productivity suite
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2005-09-08 03:42:07 -05:00
|
|
|
# $RCSfile: tg_app.mk,v $
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2006-07-05 15:57:28 -05:00
|
|
|
# $Revision: 1.55 $
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2006-07-05 15:57:28 -05:00
|
|
|
# last change: $Author: kz $ $Date: 2006-07-05 21:57:28 $
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2005-09-08 03:42:07 -05:00
|
|
|
# The Contents of this file are made available subject to
|
|
|
|
# the terms of GNU Lesser General Public License Version 2.1.
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
|
|
|
#
|
2005-09-08 03:42:07 -05:00
|
|
|
# GNU Lesser General Public License Version 2.1
|
|
|
|
# =============================================
|
|
|
|
# Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
# 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2005-09-08 03:42:07 -05:00
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License version 2.1, as published by the Free Software Foundation.
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2005-09-08 03:42:07 -05:00
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2005-09-08 03:42:07 -05:00
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
# MA 02111-1307 USA
|
2001-06-20 02:58:57 -05:00
|
|
|
#
|
2000-09-20 08:43:26 -05:00
|
|
|
#*************************************************************************
|
|
|
|
|
|
|
|
#######################################################
|
2001-06-20 02:58:57 -05:00
|
|
|
# instructions for linking
|
2000-09-20 08:43:26 -05:00
|
|
|
# unroll begin
|
|
|
|
|
|
|
|
.IF "$(APP$(TNR)LINKTYPE)" != ""
|
2005-03-15 02:56:34 -06:00
|
|
|
#must be either STATIC or SHARED
|
2003-12-16 04:38:23 -06:00
|
|
|
APP$(TNR)LINKTYPEFLAG=$(APPLINK$(APP$(TNR)LINKTYPE))
|
2000-09-20 08:43:26 -05:00
|
|
|
.ENDIF
|
|
|
|
|
2005-03-15 02:56:34 -06:00
|
|
|
# decide how to link
|
|
|
|
.IF "$(APP$(TNR)CODETYPE)"=="C"
|
|
|
|
APP$(TNR)LINKER=$(LINKC)
|
|
|
|
APP$(TNR)STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
|
2005-07-11 09:27:59 -05:00
|
|
|
APP$(TNR)LINKFLAGS+=$(LINKCFLAGS)
|
2005-03-15 02:56:34 -06:00
|
|
|
.ELSE # "$(APP$(TNR)CODETYPE)"=="C"
|
|
|
|
APP$(TNR)LINKER=$(LINK)
|
|
|
|
APP$(TNR)STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
|
2005-07-11 09:27:59 -05:00
|
|
|
APP$(TNR)LINKFLAGS+=$(LINKFLAGS)
|
2005-03-15 02:56:34 -06:00
|
|
|
.ENDIF # "$(APP$(TNR)CODETYPE)"=="C"
|
|
|
|
|
2000-09-20 08:43:26 -05:00
|
|
|
.IF "$(APP$(TNR)STACK)" != ""
|
|
|
|
.IF "$(LINKFLAGSTACK)" != ""
|
|
|
|
APP$(TNR)STACKN=$(LINKFLAGSTACK)$(APP$(TNR)STACK)
|
|
|
|
.ENDIF
|
|
|
|
.ELSE
|
|
|
|
APP$(TNR)STACKN=
|
|
|
|
.ENDIF
|
2005-03-15 02:56:34 -06:00
|
|
|
|
2000-09-20 08:43:26 -05:00
|
|
|
.IF "$(APP$(TNR)NOSAL)"==""
|
|
|
|
.IF "$(TARGETTYPE)" == "GUI"
|
|
|
|
APP$(TNR)OBJS+= $(STDOBJVCL)
|
|
|
|
.ENDIF
|
|
|
|
.ENDIF
|
|
|
|
|
|
|
|
.IF "$(GUI)" == "UNX"
|
2000-12-21 13:26:38 -06:00
|
|
|
APP$(TNR)DEPN+:=$(APP$(TNR)DEPNU)
|
2000-09-20 08:43:26 -05:00
|
|
|
USE_APP$(TNR)DEF=
|
|
|
|
.ENDIF
|
|
|
|
|
|
|
|
.IF "$(APP$(TNR)TARGETN)"!=""
|
2001-09-28 11:11:33 -05:00
|
|
|
|
2005-04-29 02:49:48 -05:00
|
|
|
.IF "$(APP$(TNR)PRODUCTNAME)"!=""
|
2005-07-11 09:27:59 -05:00
|
|
|
APP$(TNR)PRODUCTDEF:=-DPRODUCT_NAME=\"$(APP$(TNR)PRODUCTNAME)\"
|
2005-04-29 02:49:48 -05:00
|
|
|
.ENDIF # "$(APP$(TNR)PRODUCTNAME)"!=""
|
|
|
|
|
2001-09-28 11:11:33 -05:00
|
|
|
.IF "$(linkinc)"!=""
|
2001-10-23 09:07:29 -05:00
|
|
|
.IF "$(GUI)"=="WNT"
|
|
|
|
$(MISC)$/$(APP$(TNR)TARGET)_linkinc.ls .PHONY:
|
|
|
|
@+-$(RM) $@ >& $(NULLDEV)
|
2002-03-26 11:23:25 -06:00
|
|
|
+sed -f $(COMMON_ENV_TOOLS)$/chrel.sed $(foreach,i,$(APP$(TNR)LIBS) $(i:s/.lib/.lin/)) >> $@
|
2001-10-23 09:07:29 -05:00
|
|
|
.ENDIF
|
|
|
|
|
2001-09-28 11:11:33 -05:00
|
|
|
LINKINCTARGETS+=$(MISC)$/$(APP$(TNR)TARGETN:b)_linkinc.ls
|
|
|
|
$(APP$(TNR)TARGETN) : $(LINKINCTARGETS)
|
|
|
|
.ENDIF # "$(linkinc)"!=""
|
|
|
|
|
2003-03-27 04:48:49 -06:00
|
|
|
# Allow for target specific LIBSALCPPRT override
|
|
|
|
APP$(TNR)LIBSALCPPRT*=$(LIBSALCPPRT)
|
|
|
|
|
2000-09-20 08:43:26 -05:00
|
|
|
$(APP$(TNR)TARGETN): $(APP$(TNR)OBJS) $(APP$(TNR)LIBS) \
|
|
|
|
$(APP$(TNR)RES) \
|
|
|
|
$(APP$(TNR)ICON) $(APP$(TNR)DEPN) $(USE_APP$(TNR)DEF)
|
|
|
|
@echo ------------------------------
|
|
|
|
@echo Making: $@
|
|
|
|
.IF "$(GUI)"=="UNX"
|
2001-03-06 12:20:33 -06:00
|
|
|
.IF "$(OS)"=="MACOSX"
|
2000-09-20 08:43:26 -05:00
|
|
|
@+echo unx
|
2001-03-06 12:20:33 -06:00
|
|
|
@+-$(RM) $(MISC)$/$(@:b).list
|
2000-09-20 08:43:26 -05:00
|
|
|
@+-$(RM) $(MISC)$/$(@:b).cmd
|
2001-03-11 23:50:17 -06:00
|
|
|
@+-$(RM) $(MISC)$/$(@:b).strip
|
2001-03-06 12:20:33 -06:00
|
|
|
@+echo $(STDSLO) $(APP$(TNR)OBJS:s/.obj/.o/) \
|
|
|
|
`cat /dev/null $(APP$(TNR)LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)$/$(@:b).list
|
2005-03-15 02:56:34 -06:00
|
|
|
@+echo $(APP$(TNR)LINKER) $(APP$(TNR)LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) -o $@ \
|
2006-04-20 08:14:11 -05:00
|
|
|
`macosx-dylib-link-list $(PRJNAME) $(SOLARVERSION)$/$(INPATH)$/lib $(PRJ)$/$(INPATH)$/lib $(APP$(TNR)STDLIBS) $(APP$(TNR)STDLIB) $(STDLIB$(TNR))` \
|
2005-03-15 02:56:34 -06:00
|
|
|
$(APP$(TNR)LINKTYPEFLAG) $(APP$(TNR)STDLIBS) $(APP$(TNR)STDLIB) $(STDLIB$(TNR)) -filelist $(MISC)$/$(@:b).list > $(MISC)$/$(@:b).cmd
|
2000-09-20 08:43:26 -05:00
|
|
|
@cat $(MISC)$/$(@:b).cmd
|
|
|
|
@source $(MISC)$/$(@:b).cmd
|
2001-03-11 23:50:17 -06:00
|
|
|
# Need to strip __objcInit symbol to avoid duplicate symbols when loading
|
|
|
|
# libraries at runtime
|
2003-06-04 04:39:52 -05:00
|
|
|
@+-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)$/$(@:b).strip
|
2001-03-12 00:34:45 -06:00
|
|
|
@strip -i -R $(MISC)$/$(@:b).strip -X $@
|
2000-09-20 08:43:26 -05:00
|
|
|
@ls -l $@
|
2000-10-08 21:01:25 -05:00
|
|
|
.IF "$(TARGETTYPE)"=="GUI"
|
2000-10-25 20:52:11 -05:00
|
|
|
@echo "Making: $@.app"
|
2006-04-20 08:14:11 -05:00
|
|
|
@macosx-create-bundle $@
|
2000-10-08 21:01:25 -05:00
|
|
|
.ENDIF # "$(TARGETTYPE)"=="GUI"
|
2001-03-06 12:20:33 -06:00
|
|
|
.ELSE # "$(OS)"=="MACOSX"
|
|
|
|
@+echo unx
|
|
|
|
@+-$(RM) $(MISC)$/$(@:b).cmd
|
2005-03-15 02:56:34 -06:00
|
|
|
@+echo $(APP$(TNR)LINKER) $(APP$(TNR)LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)$/$(INPATH)$/lib $(SOLARLIB) $(STDSLO) \
|
2006-07-05 15:57:28 -05:00
|
|
|
$(APP$(TNR)OBJS:s/.obj/.o/) '\' > $(MISC)$/$(@:b).cmd
|
2002-01-15 05:14:36 -06:00
|
|
|
@cat $(mktmp /dev/null $(APP$(TNR)LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)$/$(@:b).cmd
|
2005-03-15 02:56:34 -06:00
|
|
|
@+echo $(APP$(TNR)LINKTYPEFLAG) $(APP$(TNR)LIBSALCPPRT) $(APP$(TNR)STDLIBS) $(APP$(TNR)STDLIB) $(STDLIB$(TNR)) -o $@ >> $(MISC)$/$(@:b).cmd
|
2002-01-15 05:14:36 -06:00
|
|
|
cat $(MISC)$/$(@:b).cmd
|
2001-03-06 12:20:33 -06:00
|
|
|
@source $(MISC)$/$(@:b).cmd
|
|
|
|
@ls -l $@
|
2000-10-08 21:01:25 -05:00
|
|
|
.ENDIF # "$(OS)"=="MACOSX"
|
2000-09-20 08:43:26 -05:00
|
|
|
.ENDIF
|
|
|
|
.IF "$(GUI)" == "WNT"
|
|
|
|
@+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
|
|
|
|
.IF "$(APP$(TNR)LINKRES)" != ""
|
|
|
|
@+-$(RM) $(MISC)$/$(APP$(TNR)LINKRES:b).rc >& $(NULLDEV)
|
|
|
|
.IF "$(APP$(TNR)ICON)" != ""
|
2005-03-18 03:21:27 -06:00
|
|
|
.IF "$(USE_SHELL)"=="4nt"
|
2003-03-27 04:48:49 -06:00
|
|
|
@-+echo 1 ICON "$(APP$(TNR)ICON:s/\/\\/)" >> $(MISC)$/$(APP$(TNR)LINKRES:b).rc
|
2002-04-10 05:34:35 -05:00
|
|
|
.ELSE # "$(USE_SHELL)"=="4nt"
|
2005-03-18 03:21:27 -06:00
|
|
|
@-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP$(TNR)ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)$/$(APP$(TNR)LINKRES:b).rc
|
2002-04-10 05:34:35 -05:00
|
|
|
.ENDIF # "$(USE_SHELL)"=="4nt"
|
2005-03-18 03:21:27 -06:00
|
|
|
.ENDIF # "$(APP$(TNR)ICON)" != ""
|
|
|
|
.IF "$(APP$(TNR)VERINFO)" != ""
|
|
|
|
@-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)$/$(APP$(TNR)LINKRES:b).rc
|
|
|
|
@-+echo $(EMQ)#include $(EMQ)"$(APP$(TNR)VERINFO)$(EMQ)" >> $(MISC)$/$(APP$(TNR)LINKRES:b).rc
|
|
|
|
.ENDIF # "$(APP$(TNR)VERINFO)" != ""
|
2005-04-29 02:49:48 -05:00
|
|
|
$(RC) -DWIN32 $(APP$(TNR)PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(APP$(TNR)LINKRES:b).rc
|
2000-09-20 08:43:26 -05:00
|
|
|
.ENDIF # "$(APP$(TNR)LINKRES)" != ""
|
|
|
|
.IF "$(linkinc)" == ""
|
2005-03-15 02:56:34 -06:00
|
|
|
$(APP$(TNR)LINKER) @$(mktmp \
|
|
|
|
$(APP$(TNR)LINKFLAGS) \
|
2000-09-20 08:43:26 -05:00
|
|
|
$(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
|
|
|
|
$(APP$(TNR)STACKN) \
|
|
|
|
-out:$@ \
|
2005-10-19 08:30:51 -05:00
|
|
|
-map:$(MISC)$/{$(subst,$/,_ $(APP$(TNR)TARGET)).map} \
|
2000-09-20 08:43:26 -05:00
|
|
|
$(STDOBJ) \
|
|
|
|
$(APP$(TNR)LINKRES) \
|
2004-06-25 10:12:43 -05:00
|
|
|
$(APP$(TNR)RES) \
|
2000-09-20 08:43:26 -05:00
|
|
|
$(APP$(TNR)OBJS) \
|
|
|
|
$(APP$(TNR)LIBS) \
|
|
|
|
$(APP$(TNR)STDLIBS) \
|
2005-03-15 02:56:34 -06:00
|
|
|
$(APP$(TNR)STDLIB) $(STDLIB$(TNR)) \
|
2000-09-20 08:43:26 -05:00
|
|
|
)
|
|
|
|
.ELSE
|
|
|
|
+-$(RM) $(MISC)\$(APP$(TNR)TARGET).lnk
|
|
|
|
+-$(RM) $(MISC)\$(APP$(TNR)TARGET).lst
|
|
|
|
+-$(RM) $(MISC)\linkobj.lst
|
|
|
|
+for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
|
|
|
|
type $(mktmp,$(MISC)\$(APP$(TNR)TARGET).lst
|
2005-03-15 02:56:34 -06:00
|
|
|
$(APP$(TNR)LINKFLAGS) \
|
2000-09-20 08:43:26 -05:00
|
|
|
$(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
|
|
|
|
$(APP$(TNR)STACKN) \
|
|
|
|
-out:$@ \
|
|
|
|
$(STDOBJ) \
|
|
|
|
$(APP$(TNR)LINKRES) \
|
2004-06-25 10:12:43 -05:00
|
|
|
$(APP$(TNR)RES) \
|
2000-09-20 08:43:26 -05:00
|
|
|
$(APP$(TNR)OBJS) \
|
|
|
|
$(APP$(TNR)LIBS) \
|
|
|
|
$(APP$(TNR)STDLIBS) \
|
2005-03-15 02:56:34 -06:00
|
|
|
$(APP$(TNR)STDLIB) $(STDLIB$(TNR)))
|
2005-03-18 03:21:27 -06:00
|
|
|
$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP$(TNR)TARGETN:b)_linkobj.lst >> $(MISC)\$(APP$(TNR)TARGET).lst
|
2006-07-05 15:57:28 -05:00
|
|
|
+$(IFEXIST) $(MISC)$/$(APP$(TNR)TARGET).lst $(THEN) type $(MISC)$/$(APP$(TNR)TARGET).lst >> $(MISC)$/$(APP$(TNR)TARGET).lnk $(FI)
|
2005-03-15 02:56:34 -06:00
|
|
|
$(APP$(TNR)LINKER) @$(MISC)\$(APP$(TNR)TARGET).lnk
|
2000-09-20 08:43:26 -05:00
|
|
|
.ENDIF # "$(linkinc)" == ""
|
|
|
|
.IF "$(APP$(TNR)TARGET)" == "loader"
|
2000-11-09 07:18:00 -06:00
|
|
|
+$(PERL) loader.pl $@
|
2002-04-10 05:34:35 -05:00
|
|
|
.IF "$(USE_SHELL)"=="4nt"
|
2000-09-20 08:43:26 -05:00
|
|
|
+$(COPY) /b $(@)+$(@:d)unloader.exe $(@:d)_new.exe
|
2002-04-10 05:34:35 -05:00
|
|
|
.ELSE # "$(USE_SHELL)"=="4nt"
|
|
|
|
+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
|
|
|
|
.ENDIF # "$(USE_SHELL)"=="4nt"
|
2000-09-20 08:43:26 -05:00
|
|
|
+$(RM) $@
|
|
|
|
+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
|
|
|
|
.ENDIF # "$(TARGET)" == "setup"
|
|
|
|
|
|
|
|
.ENDIF # "$(GUI)" == "WNT"
|
|
|
|
|
|
|
|
.ENDIF # "$(APP$(TNR)TARGETN)"!=""
|
|
|
|
|
|
|
|
|
2001-06-20 02:58:57 -05:00
|
|
|
# Instruction for linking
|
2000-09-20 08:43:26 -05:00
|
|
|
# unroll end
|
|
|
|
#######################################################
|
|
|
|
|