Update ooo320-m1
[ooovba.git] / testtools / source / bridgetest / makefile.mk
blob3dfb18c7dd4d771776534edcd37a1f0add2d4574
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
41 .IF "$(L10N_framework)"==""
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 ------------------------------------------------------
132 .ENDIF # L10N_framework
134 .INCLUDE : target.mk
135 .IF "$(L10N_framework)"==""
136 ALLTAR: \
137 test \
138 $(DLLDEST)$/uno_types.rdb \
139 $(DLLDEST)$/uno_services.rdb \
140 $(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) \
141 $(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) \
142 $(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) \
143 $(JAVATARGETS)
145 #################################################################
147 test:
148 echo $(compcheck)
150 $(DLLDEST)$/uno_types.rdb : $(SOLARBINDIR)$/udkapi.rdb
151 echo $(DLLDEST)
152 $(GNUCOPY) $? $@
153 $(REGMERGE) $@ / $(BIN)$/bridgetest.rdb
155 $(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
156 .IF "$(USE_SHELL)" == "bash"
157 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
158 -s com.sun.star.test.bridge.BridgeTest -- \
159 com.sun.star.test.bridge.CppTestObject > $@
160 .ELSE
161 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
162 .ENDIF
163 $(GIVE_EXEC_RIGHTS) $@
165 $(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
166 .IF "$(USE_SHELL)" == "bash"
167 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
168 -s com.sun.star.test.bridge.BridgeTest -- \
169 -u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' > $@
170 .ELSE
171 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
172 .ENDIF
173 $(GIVE_EXEC_RIGHTS) $@
175 $(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
176 .IF "$(USE_SHELL)" == "bash"
177 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
178 -s com.sun.star.test.bridge.CppTestObject \
179 -u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' --singleaccept \
180 > $@
181 .ELSE
182 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
183 .ENDIF
184 $(GIVE_EXEC_RIGHTS) $@
187 .IF "$(SOLAR_JAVA)" != ""
188 # jar-files, which regcomp needs so that it can use java
189 MY_JARS=java_uno.jar ridl.jar jurt.jar juh.jar
191 # CLASSPATH, which regcomp needs to be run
192 MY_CLASSPATH_TMP=$(foreach,i,$(MY_JARS) $(SOLARBINDIR)$/$i)$(PATH_SEPERATOR)$(XCLASSPATH)
193 MY_CLASSPATH=$(strip $(subst,!,$(PATH_SEPERATOR) $(MY_CLASSPATH_TMP:s/ /!/)))$(PATH_SEPERATOR)..$/class
195 # Use "127.0.0.1" instead of "localhost", see #i32281#:
196 $(DLLDEST)$/bridgetest_javaserver$(BATCH_SUFFIX) : makefile.mk
197 -rm -f $@
198 echo java -classpath "$(MY_CLASSPATH)$(PATH_SEPERATOR)..$/class$/testComponent.jar" \
199 com.sun.star.comp.bridge.TestComponentMain \""uno:socket,host=127.0.0.1,port=2002;urp;test"\" singleaccept > $@
200 $(GIVE_EXEC_RIGHTS) $@
202 $(DLLDEST)$/bridgetest_inprocess_java$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
203 .IF "$(USE_SHELL)" == "bash"
204 echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
205 -s com.sun.star.test.bridge.BridgeTest \
206 -env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) \
207 -- com.sun.star.test.bridge.JavaTestObject noCurrentContext > $@
208 .ELSE
209 echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
210 .ENDIF
211 $(GIVE_EXEC_RIGHTS) $@
212 .ENDIF
214 $(DLLDEST)$/uno_services.rdb .ERRREMOVE: $(DLLDEST)$/uno_types.rdb \
215 $(DLLDEST)$/bridgetest.uno$(DLLPOST) $(DLLDEST)$/cppobj.uno$(DLLPOST) \
216 $(MISC)$/$(TARGET)$/bootstrap.rdb $(SHL3TARGETN)
217 - $(MKDIR) $(@:d)
218 $(REGCOMP) -register -br $(DLLDEST)$/uno_types.rdb \
219 -r $(DLLDEST)$/uno_services.rdb -wop \
220 -c acceptor.uno$(DLLPOST) \
221 -c bridgefac.uno$(DLLPOST) \
222 -c connector.uno$(DLLPOST) \
223 -c remotebridge.uno$(DLLPOST) \
224 -c uuresolver.uno$(DLLPOST) \
225 -c stocservices.uno$(DLLPOST)
226 cd $(DLLDEST) && $(REGCOMP) -register -br uno_types.rdb \
227 -r uno_services.rdb -wop=./ \
228 -c .$/bridgetest.uno$(DLLPOST) \
229 -c .$/cppobj.uno$(DLLPOST) \
230 -c .$/$(SHL3TARGETN:f)
231 .IF "$(SOLAR_JAVA)" != ""
232 $(REGCOMP) -register -br $(DLLDEST)$/uno_types.rdb -r $@ \
233 -c javaloader.uno$(DLLPOST) -c javavm.uno$(DLLPOST)
234 $(REGCOMP) -register -br $(MISC)$/$(TARGET)$/bootstrap.rdb -r $@ -c \
235 $(MY_LOCAL_CLASSDIR)/testComponent.jar \
236 -env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR)
237 .ENDIF
239 $(MISC)$/$(TARGET)$/bootstrap.rdb .ERRREMOVE:
240 - $(MKDIR) $(@:d)
241 $(COPY) $(SOLARBINDIR)$/types.rdb $@
242 .IF "$(SOLAR_JAVA)" != ""
243 $(REGCOMP) -register -r $@ -c javaloader.uno$(DLLPOST) \
244 -c javavm.uno$(DLLPOST) -c stocservices.uno$(DLLPOST)
245 .ENDIF
246 .ENDIF # L10N_framework