update dev300-m58
[ooovba.git] / ure / source / uretest / Makefile
blob8387eee274fdd03c2aab3606a95ef41fb996162a
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,v $
11 # $Revision: 1.9 $
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 # The following variable can be set, if necessary (see README):
33 #GCCS_COMPAT := LD_PRELOAD=/lib/libgcc_s.so.1
36 .DELETE_ON_ERROR:
39 PRJ = $(OO_SDK_HOME)
41 include $(PRJ)/settings/settings.mk
42 include $(PRJ)/settings/std.mk
44 ifeq "$(PLATFORM)" "windows"
45 qt = "
46 qt2 =
47 cwd = $(subst \,/,$(shell cd))
48 link_output_switch = -out:
49 link_std_libs = kernel32.lib msvcrt.lib
50 ure_java_url = $(subst $(subst .,., ),%%20,$(subst \,/,$(URLPREFIX)$(OO_SDK_URE_JAVA_DIR)))
51 ure_unorc_url = $(subst $(subst .,., ),%%20,$(subst \,/,$(URLPREFIX)$(OO_SDK_URE_LIB_DIR)/uno.ini))
52 else
53 qt = '
54 qt2 = '
55 cwd = $(PWD)
56 link_output_switch = $(subst .,.,-o )
57 link_std_libs =
58 ure_java_url = $(URLPREFIX)$(OO_SDK_URE_JAVA_DIR)
59 ure_unorc_url = $(URLPREFIX)$(OO_SDK_URE_LIB_DIR)/unorc
60 endif
63 .PHONY: ALL
64 ALL: test
66 include $(PRJ)/settings/stdtarget.mk
69 .PHONY: test
70 test: test-cpptest test-javatest test-javanative test-clientserver
72 .PHONY: test-cpptest
73 test-cpptest: out.sdk/cppmain.uno.$(SHAREDLIB_EXT) out.sdk/types.rdb \
74 out.sdk/services.rdb
75 $(GCCS_COMPAT) uno \
76 -c test.cpp.cppmain.Component -l $(URLPREFIX)$(cwd)/$< \
77 -ro "$(subst \,/,$(URLPREFIX)$(URE_TYPES))" -ro out.sdk/types.rdb \
78 -ro "$(subst \,/,$(URLPREFIX)$(URE_SERVICES))" \
79 -ro out.sdk/services.rdb
81 .PHONY: test-javatest
82 test-javatest: out.sdk/javamain.uno.jar out.sdk/types.rdb out.sdk/services.rdb
83 $(GCCS_COMPAT) uno \
84 -c test.java.javamain.Component -l $(URLPREFIX)$(cwd)/$< \
85 -ro "$(subst \,/,$(URLPREFIX)$(URE_TYPES))" -ro out.sdk/types.rdb \
86 -ro "$(subst \,/,$(URLPREFIX)$(URE_SERVICES))" \
87 -ro out.sdk/services.rdb
89 .PHONY: test-javanative
90 test-javanative: out.sdk/runner.jar out.sdk/javanative.jar \
91 out.sdk/javanative.rc out.sdk/services.rdb out.sdk/types.rdb
92 $(GCCS_COMPAT) $(SDK_JAVA) -jar out.sdk/runner.jar $(ure_java_url)/ \
93 $(URLPREFIX)$(cwd)/out.sdk/javanative.jar \
94 $(URLPREFIX)$(cwd)/out.sdk/javanative.rc
96 do_server = $(GCCS_COMPAT) uno -c test.cpp.cppserver.Component \
97 -l $(URLPREFIX)$(cwd)/out.sdk/cppserver.uno.$(SHAREDLIB_EXT) \
98 -ro "$(subst \,/,$(URLPREFIX)$(URE_TYPES))" -ro out.sdk/types.rdb \
99 -ro "$(subst \,/,$(URLPREFIX)$(URE_SERVICES))" -ro out.sdk/services.rdb \
100 -u "uno:pipe,name=ure_test;urp;server" --singleaccept
101 do_client = $(SDK_JAVA) -jar out.sdk/runner.jar $(ure_java_url)/ \
102 $(URLPREFIX)$(cwd)/out.sdk/javaclient.jar \
103 "uno:pipe,name=ure_test;urp;server"
104 .PHONY: test-clientserver
105 test-clientserver: out.sdk/cppserver.uno.$(SHAREDLIB_EXT) out.sdk/runner.jar \
106 out.sdk/javaclient.jar
107 ifeq "$(PLATFORM)" "windows"
108 echo $(subst %,%%,$(do_server)) > out.sdk/server.bat
109 echo $(subst %,%%,$(do_client)) > out.sdk/client.bat
110 @ echo Execute test-clientserver manually: start out.sdk\server.bat
111 @ echo and then simultaneously start out.sdk\client.bat
112 else
113 $(do_server) &
114 sleep 5 && $(do_client)
115 endif
118 .PHONY: clean
119 clean:
120 $(DELRECURSIVE) $(subst /,$(PS),out.sdk)
123 out.sdk/cppmain.uno.$(SHAREDLIB_EXT): out.sdk/cppmain.$(OBJ_EXT) version.map | \
124 out.sdk
125 $(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
126 $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(SALHELPERLIB) \
127 $(STLPORTLIB) $(link_std_libs)
129 out.sdk/cppmain.$(OBJ_EXT): cppmain.cc out.sdk/cpputypes.cppumaker.flag \
130 out.sdk/types.cppumaker.flag | out.sdk
131 $(CC) $(CC_FLAGS) $(CC_OUTPUT_SWITCH)$@ -I$(PRJ)/include/stl \
132 $(CC_INCLUDES) -Iout.sdk/include/cpputypes -Iout.sdk/include/types \
133 $(CC_DEFINES) $<
136 out.sdk/cpptest.uno.$(SHAREDLIB_EXT): out.sdk/cpptest.$(OBJ_EXT) version.map | \
137 out.sdk
138 $(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
139 $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(link_std_libs)
141 out.sdk/cpptest.$(OBJ_EXT): cpptest.cc out.sdk/cpputypes.cppumaker.flag \
142 out.sdk/types.cppumaker.flag | out.sdk
143 $(CC) $(CC_FLAGS) $(CC_OUTPUT_SWITCH)$@ -I$(PRJ)/include/stl \
144 $(CC_INCLUDES) -Iout.sdk/include/cpputypes -Iout.sdk/include/types \
145 $(CC_DEFINES) $<
148 out.sdk/cppserver.uno.$(SHAREDLIB_EXT): out.sdk/cppserver.$(OBJ_EXT) \
149 version.map | out.sdk
150 $(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
151 $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(link_std_libs)
153 out.sdk/cppserver.$(OBJ_EXT): cppserver.cc out.sdk/cpputypes.cppumaker.flag \
154 out.sdk/types.cppumaker.flag | out.sdk
155 $(CC) $(CC_FLAGS) $(CC_OUTPUT_SWITCH)$@ -I$(PRJ)/include/stl \
156 $(CC_INCLUDES) -Iout.sdk/include/cpputypes -Iout.sdk/include/types \
157 $(CC_DEFINES) $<
160 out.sdk/cpputypes.cppumaker.flag: | out.sdk
161 $(CPPUMAKER) -O./out.sdk/include/cpputypes \
162 "-Tcom.sun.star.lang.DisposedException;com.sun.star.lang.EventObject;com.sun.star.lang.XMain;com.sun.star.lang.XMultiComponentFactory;com.sun.star.lang.XMultiServiceFactory;com.sun.star.lang.XSingleComponentFactory;com.sun.star.lang.XSingleServiceFactory;com.sun.star.lang.XTypeProvider;com.sun.star.registry.XRegistryKey;com.sun.star.uno.DeploymentException;com.sun.star.uno.Exception;com.sun.star.uno.RuntimeException;com.sun.star.uno.XAggregation;com.sun.star.uno.XComponentContext;com.sun.star.uno.XCurrentContext;com.sun.star.uno.XInterface;com.sun.star.uno.XWeak" \
163 -B/UCR "$(URE_TYPES)"
164 touch $@
166 out.sdk/types.cppumaker.flag: out.sdk/types.rdb | out.sdk
167 $(CPPUMAKER) -O./out.sdk/include/types -B/UCR $< "-X$(URE_TYPES)"
168 touch $@
171 out.sdk/javamain.uno.jar: \
172 out.sdk/class/javamain/test/java/javamain/JavaMain.class \
173 out.sdk/javamain.mf | out.sdk
174 $(SDK_JAR) cfm $@ out.sdk/javamain.mf -C out.sdk/class/javamain test
176 out.sdk/javamain.mf: javamain.mf.template | out.sdk
177 sed -e $(qt)s~^Class-Path:$$~& tester.jar~$(qt) \
178 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
180 out.sdk/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \
181 out.sdk/tester.jar | out.sdk/class
182 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javamain)
183 $(MKDIR) $(subst /,$(PS),out.sdk/class/javamain)
184 $(SDK_JAVAC) $(JAVAC_FLAGS) \
185 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/tester.jar" \
186 -sourcepath . -d out.sdk/class/javamain $<
189 out.sdk/runner.jar: out.sdk/class/runner/test/java/runner/Runner.class \
190 out.sdk/runner.mf | out.sdk
191 $(SDK_JAR) cfm $@ out.sdk/runner.mf -C out.sdk/class/runner test
193 out.sdk/runner.mf: runner.mf.template | out.sdk
194 sed -e \
195 $(qt)s~^Class-Path:$$~& $(ure_java_url)/unoloader.jar~$(qt) \
196 -e $(qt)s~^UNO-Type-Path:$$~& ~$(qt) $< > $@
198 out.sdk/class/runner/test/java/runner/Runner.class: Runner.java | out.sdk/class
199 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/runner)
200 $(MKDIR) $(subst /,$(PS),out.sdk/class/runner)
201 $(SDK_JAVAC) $(JAVAC_FLAGS) -sourcepath . -d out.sdk/class/runner $<
204 out.sdk/tester.jar: out.sdk/class/tester/test/java/tester/Tester.class \
205 out.sdk/tester.mf | out.sdk
206 $(SDK_JAR) cfm $@ out.sdk/tester.mf -C out.sdk/class/tester test
208 out.sdk/tester.mf: tester.mf.template | out.sdk
209 sed -e $(qt)s~^Class-Path:$$~& types.jar~$(qt) \
210 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
212 out.sdk/class/tester/test/java/tester/Tester.class: Tester.java \
213 out.sdk/types.jar | out.sdk/class
214 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/tester)
215 $(MKDIR) $(subst /,$(PS),out.sdk/class/tester)
216 $(SDK_JAVAC) $(JAVAC_FLAGS) \
217 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/types.jar" \
218 -sourcepath . -d out.sdk/class/tester $<
221 out.sdk/javatest.uno.jar: \
222 out.sdk/class/javatest/test/java/javatest/JavaTest.class \
223 out.sdk/javatest.mf | out.sdk
224 $(SDK_JAR) cfm $@ out.sdk/javatest.mf -C out.sdk/class/javatest test
226 out.sdk/javatest.mf: javatest.mf.template | out.sdk
227 sed -e $(qt)s~^Class-Path:$$~& types.jar~$(qt) \
228 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
230 out.sdk/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \
231 out.sdk/types.jar | out.sdk/class
232 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javatest)
233 $(MKDIR) $(subst /,$(PS),out.sdk/class/javatest)
234 $(SDK_JAVAC) $(JAVAC_FLAGS) \
235 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/types.jar" \
236 -sourcepath . -d out.sdk/class/javatest $<
239 out.sdk/javanative.jar: \
240 out.sdk/class/javanative/test/java/javanative/JavaNative.class \
241 out.sdk/javanative.mf | out.sdk
242 $(SDK_JAR) cfm $@ out.sdk/javanative.mf -C out.sdk/class/javanative test
244 out.sdk/javanative.mf: javanative.mf.template | out.sdk
245 sed -e $(qt)s~^Class-Path:$$~& tester.jar~$(qt) \
246 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
248 out.sdk/class/javanative/test/java/javanative/JavaNative.class: \
249 JavaNative.java out.sdk/tester.jar | out.sdk/class
250 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javanative)
251 $(MKDIR) $(subst /,$(PS),out.sdk/class/javanative)
252 $(SDK_JAVAC) $(JAVAC_FLAGS) \
253 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/tester.jar" \
254 -sourcepath . -d out.sdk/class/javanative $<
256 out.sdk/javanative.rc: | out.sdk
257 echo $(qt2)URE_INTERNAL_LIB_DIR=$${$(subst :,\u003A,$(ure_unorc_url)):URE_INTERNAL_LIB_DIR}$(qt2) > $@
258 echo $(qt2)URE_INTERNAL_JAVA_DIR=$${$(subst :,\u003A,$(ure_unorc_url)):URE_INTERNAL_JAVA_DIR}$(qt2) >> $@
259 echo $(qt2)UNO_TYPES=$${$(subst :,\u003A,$(ure_unorc_url)):UNO_TYPES} $(URLPREFIX)$(cwd)/out.sdk/types.rdb$(qt2) >> $@
260 echo $(qt2)UNO_SERVICES=$${$(subst :,\u003A,$(ure_unorc_url)):UNO_SERVICES} $(URLPREFIX)$(cwd)/out.sdk/services.rdb$(qt2) >> $@
263 out.sdk/javaclient.jar: \
264 out.sdk/class/javaclient/test/java/javaclient/JavaClient.class \
265 out.sdk/javaclient.mf | out.sdk
266 $(SDK_JAR) cfm $@ out.sdk/javaclient.mf -C out.sdk/class/javaclient test
268 out.sdk/javaclient.mf: javaclient.mf.template | out.sdk
269 sed -e $(qt)s~^Class-Path:$$~& types.jar~$(qt) \
270 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
272 out.sdk/class/javaclient/test/java/javaclient/JavaClient.class: \
273 JavaClient.java out.sdk/types.jar | out.sdk/class
274 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javaclient)
275 $(MKDIR) $(subst /,$(PS),out.sdk/class/javaclient)
276 $(SDK_JAVAC) $(JAVAC_FLAGS) \
277 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/types.jar" \
278 -sourcepath . -d out.sdk/class/javaclient $<
281 out.sdk/types.jar: out.sdk/types.javamaker.flag out.sdk/types.mf | out.sdk
282 $(SDK_JAR) cfm $@ out.sdk/types.mf -C out.sdk/class/types test
284 out.sdk/types.mf: types.mf.template | out.sdk
285 sed -e $(qt)s~^Class-Path:$$~& ~$(qt) \
286 -e $(qt)s~^UNO-Type-Path:$$~& \<\>~$(qt) $< > $@
288 out.sdk/types.javamaker.flag: out.sdk/types.rdb | out.sdk out.sdk/class
289 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/types)
290 $(JAVAMAKER) -O./out.sdk/class/types -B/UCR $< "-X$(URE_TYPES)"
291 touch $@
294 out.sdk/types.rdb: out.sdk/types.urd | out.sdk
295 $(REGMERGE) $@ /UCR $<
297 out.sdk/types.urd: types.idl | out.sdk
298 $(IDLC) -O$(@D) -I$(IDL_DIR) -cid -we $<
301 out.sdk/services.rdb: out.sdk/cpptest.uno.$(SHAREDLIB_EXT) \
302 out.sdk/javatest.uno.jar | out.sdk
303 $(DEL) $(subst /,$(PS),$@)
304 $(REGCOMP) -register -r $@ \
305 -c $(URLPREFIX)$(cwd)/out.sdk/cpptest.uno.$(SHAREDLIB_EXT)
306 $(REGCOMP) -register -br "$(URE_TYPES)" -br "$(URE_SERVICES)" -r $@ \
307 -c $(URLPREFIX)$(cwd)/out.sdk/javatest.uno.jar
310 out.sdk:
311 $(MKDIR) $(subst /,$(PS),$@)
313 out.sdk/class: | out.sdk
314 $(MKDIR) $(subst /,$(PS),$@)