update dev300-m58
[ooovba.git] / testtools / source / bridgetest / makefile.mk
blobbad0d2f7650674186c95c1780a6895bd6a509a5c
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
11 # $Revision: 1.37.18.1 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 PRJ=..$/..
34 PRJNAME=testtools
35 TARGET=bridgetest
36 USE_DEFFILE=TRUE
37 ENABLE_EXCEPTIONS=TRUE
38 LIBTARGET=NO
40 .INCLUDE: settings.mk
42 DLLPRE = # no leading "lib" on .so files
44 .IF "$(GUI)"=="WNT"
45 BATCH_SUFFIX=.bat
46 GIVE_EXEC_RIGHTS=@echo
47 MY_URE_INTERNAL_JAVA_DIR=$(strip $(subst,\,/ file:///$(shell @$(WRAPCMD) echo $(SOLARBINDIR))))
48 MY_LOCAL_CLASSDIR=$(strip $(subst,\,/ file:///$(shell $(WRAPCMD) echo $(PWD)$/$(CLASSDIR))))
49 .ELIF "$(GUI)"=="OS2"
50 BATCH_SUFFIX=.cmd
51 GIVE_EXEC_RIGHTS=@echo
52 MY_URE_INTERNAL_JAVA_DIR=$(strip $(subst,\,/ file:///$(shell @$(WRAPCMD) echo $(SOLARBINDIR))))
53 MY_LOCAL_CLASSDIR=$(strip $(subst,\,/ file:///$(shell $(WRAPCMD) echo $(PWD)$/$(CLASSDIR))))
54 .ELSE
55 BATCH_INPROCESS=bridgetest_inprocess
56 GIVE_EXEC_RIGHTS=chmod +x
57 MY_URE_INTERNAL_JAVA_DIR=file://$(SOLARBINDIR)
58 MY_LOCAL_CLASSDIR=file://$(PWD)$/$(CLASSDIR)
59 .ENDIF
61 .IF "$(GUI)"=="WNT"
62 .IF "$(compcheck)" != ""
63 CFLAGSCXX += -DCOMPCHECK
64 .ENDIF
65 .ENDIF
67 SLOFILES = \
68 $(SLO)$/bridgetest.obj \
69 $(SLO)$/cppobj.obj \
70 $(SLO)$/currentcontextchecker.obj \
71 $(SLO)$/multi.obj
73 # ---- test ----
75 LIB1TARGET=$(SLB)$/cppobj.lib
76 LIB1OBJFILES= \
77 $(SLO)$/cppobj.obj $(SLO)$/currentcontextchecker.obj $(SLO)$/multi.obj
79 SHL1TARGET = cppobj.uno
80 SHL1STDLIBS= \
81 $(CPPULIB) \
82 $(CPPUHELPERLIB) \
83 $(SALLIB)
85 SHL1LIBS= $(LIB1TARGET)
86 SHL1DEF= $(MISC)$/$(SHL1TARGET).def
87 DEF1NAME= $(SHL1TARGET)
88 .IF "$(COMNAME)" == "gcc3"
89 SHL1VERSIONMAP = component.gcc3.map
90 .ELSE
91 SHL1VERSIONMAP = component.map
92 .ENDIF
94 # ---- test object ----
96 LIB2TARGET=$(SLB)$/bridgetest.lib
97 LIB2OBJFILES= \
98 $(SLO)$/bridgetest.obj \
99 $(SLO)$/currentcontextchecker.obj \
100 $(SLO)$/multi.obj
102 SHL2TARGET = bridgetest.uno
103 SHL2STDLIBS= \
104 $(CPPULIB) \
105 $(CPPUHELPERLIB) \
106 $(SALLIB)
108 SHL2LIBS= $(LIB2TARGET)
109 SHL2DEF= $(MISC)$/$(SHL2TARGET).def
110 DEF2NAME= $(SHL2TARGET)
111 .IF "$(COMNAME)" == "gcc3"
112 SHL2VERSIONMAP = component.gcc3.map
113 .ELSE
114 SHL2VERSIONMAP = component.map
115 .ENDIF
117 SHL3TARGET = constructors.uno
118 SHL3OBJS = $(SLO)$/constructors.obj
119 SHL3STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB)
120 SHL3VERSIONMAP = component.map
121 SHL3IMPLIB = i$(SHL3TARGET)
122 DEF3NAME = $(SHL3TARGET)
124 .IF "$(SOLAR_JAVA)" != ""
125 JARFILES = java_uno.jar jurt.jar ridl.jar
126 JAVATARGETS=\
127 $(DLLDEST)$/bridgetest_javaserver$(BATCH_SUFFIX) \
128 $(DLLDEST)$/bridgetest_inprocess_java$(BATCH_SUFFIX)
129 .ENDIF
131 # --- Targets ------------------------------------------------------
133 .INCLUDE : target.mk
135 ALLTAR: \
136 test \
137 $(DLLDEST)$/uno_types.rdb \
138 $(DLLDEST)$/uno_services.rdb \
139 $(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) \
140 $(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) \
141 $(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) \
142 $(JAVATARGETS)
144 #################################################################
146 test:
147 echo $(compcheck)
149 $(DLLDEST)$/uno_types.rdb : $(SOLARBINDIR)$/udkapi.rdb
150 echo $(DLLDEST)
151 $(GNUCOPY) $? $@
152 $(REGMERGE) $@ / $(BIN)$/bridgetest.rdb
154 $(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
155 .IF "$(USE_SHELL)" == "bash"
156 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
157 -s com.sun.star.test.bridge.BridgeTest -- \
158 com.sun.star.test.bridge.CppTestObject > $@
159 .ELSE
160 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
161 .ENDIF
162 $(GIVE_EXEC_RIGHTS) $@
164 $(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
165 .IF "$(USE_SHELL)" == "bash"
166 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
167 -s com.sun.star.test.bridge.BridgeTest -- \
168 -u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' > $@
169 .ELSE
170 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
171 .ENDIF
172 $(GIVE_EXEC_RIGHTS) $@
174 $(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
175 .IF "$(USE_SHELL)" == "bash"
176 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
177 -s com.sun.star.test.bridge.CppTestObject \
178 -u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' --singleaccept \
179 > $@
180 .ELSE
181 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
182 .ENDIF
183 $(GIVE_EXEC_RIGHTS) $@
186 .IF "$(SOLAR_JAVA)" != ""
187 # jar-files, which regcomp needs so that it can use java
188 MY_JARS=java_uno.jar ridl.jar jurt.jar juh.jar
190 # CLASSPATH, which regcomp needs to be run
191 MY_CLASSPATH_TMP=$(foreach,i,$(MY_JARS) $(SOLARBINDIR)$/$i)$(PATH_SEPERATOR)$(XCLASSPATH)
192 MY_CLASSPATH=$(strip $(subst,!,$(PATH_SEPERATOR) $(MY_CLASSPATH_TMP:s/ /!/)))$(PATH_SEPERATOR)..$/class
194 # Use "127.0.0.1" instead of "localhost", see #i32281#:
195 $(DLLDEST)$/bridgetest_javaserver$(BATCH_SUFFIX) : makefile.mk
196 -rm -f $@
197 echo java -classpath "$(MY_CLASSPATH)$(PATH_SEPERATOR)..$/class$/testComponent.jar" \
198 com.sun.star.comp.bridge.TestComponentMain \""uno:socket,host=127.0.0.1,port=2002;urp;test"\" singleaccept > $@
199 $(GIVE_EXEC_RIGHTS) $@
201 $(DLLDEST)$/bridgetest_inprocess_java$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
202 .IF "$(USE_SHELL)" == "bash"
203 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
204 -s com.sun.star.test.bridge.BridgeTest \
205 -env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) \
206 -- com.sun.star.test.bridge.JavaTestObject noCurrentContext > $@
207 .ELSE
208 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
209 .ENDIF
210 $(GIVE_EXEC_RIGHTS) $@
211 .ENDIF
213 $(DLLDEST)$/uno_services.rdb .ERRREMOVE: $(DLLDEST)$/uno_types.rdb \
214 $(DLLDEST)$/bridgetest.uno$(DLLPOST) $(DLLDEST)$/cppobj.uno$(DLLPOST) \
215 $(MISC)$/$(TARGET)$/bootstrap.rdb $(SHL3TARGETN)
216 - $(MKDIR) $(@:d)
217 $(REGCOMP) -register -br $(DLLDEST)$/uno_types.rdb \
218 -r $(DLLDEST)$/uno_services.rdb -wop \
219 -c acceptor.uno$(DLLPOST) \
220 -c bridgefac.uno$(DLLPOST) \
221 -c connector.uno$(DLLPOST) \
222 -c remotebridge.uno$(DLLPOST) \
223 -c uuresolver.uno$(DLLPOST) \
224 -c stocservices.uno$(DLLPOST)
225 cd $(DLLDEST) && $(REGCOMP) -register -br uno_types.rdb \
226 -r uno_services.rdb -wop=./ \
227 -c .$/bridgetest.uno$(DLLPOST) \
228 -c .$/cppobj.uno$(DLLPOST) \
229 -c .$/$(SHL3TARGETN:f)
230 .IF "$(SOLAR_JAVA)" != ""
231 $(REGCOMP) -register -br $(DLLDEST)$/uno_types.rdb -r $@ \
232 -c javaloader.uno$(DLLPOST) -c javavm.uno$(DLLPOST)
233 $(REGCOMP) -register -br $(MISC)$/$(TARGET)$/bootstrap.rdb -r $@ -c \
234 $(MY_LOCAL_CLASSDIR)/testComponent.jar \
235 -env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR)
236 .ENDIF
238 $(MISC)$/$(TARGET)$/bootstrap.rdb .ERRREMOVE:
239 - $(MKDIR) $(@:d)
240 $(COPY) $(SOLARBINDIR)$/types.rdb $@
241 .IF "$(SOLAR_JAVA)" != ""
242 $(REGCOMP) -register -r $@ -c javaloader.uno$(DLLPOST) \
243 -c javavm.uno$(DLLPOST) -c stocservices.uno$(DLLPOST)
244 .ENDIF