Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / ure / source / uretest / Makefile
blob1ba97fd7959387ab2193cbcb7785cad82fbffb15
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 # The following variable can be set, if necessary (see README):
20 #GCCS_COMPAT := LD_PRELOAD=/lib/libgcc_s.so.1
23 .DELETE_ON_ERROR:
26 PRJ = $(OO_SDK_HOME)
28 include $(PRJ)/settings/settings.mk
29 include $(PRJ)/settings/std.mk
31 ifeq "$(PLATFORM)" "windows"
32 qt = "
33 qt2 =
34 cwd = $(subst \,/,$(shell cd))
35 link_output_switch = -out:
36 ure_java_url = $(subst $(subst .,., ),%%20,$(subst \,/,$(URLPREFIX)$(OO_SDK_URE_JAVA_DIR)))
37 else
38 qt = '
39 qt2 = '
40 cwd = $(PWD)
41 link_output_switch = $(subst .,.,-o )
42 ure_java_url = $(URLPREFIX)$(OO_SDK_URE_JAVA_DIR)
43 endif
46 .PHONY: ALL
47 ALL: check
49 include $(PRJ)/settings/stdtarget.mk
52 .PHONY: check
53 check: test-cpptest test-javatest test-javanative test-clientserver
55 .PHONY: test-cpptest
56 test-cpptest: out.sdk/cppmain.uno.$(SHAREDLIB_EXT) out.sdk/types.rdb \
57 out.sdk/services.rdb
58 $(GCCS_COMPAT) uno \
59 -c test.cpp.cppmain.Component -l $(URLPREFIX)$(cwd)/$< \
60 -env:URE_MORE_TYPES=$(URLPREFIX)$(cwd)/out.sdk/types.rdb \
61 -env:URE_MORE_SERVICES=$(URLPREFIX)$(cwd)/out.sdk/services.rdb
63 .PHONY: test-javatest
64 test-javatest: out.sdk/javamain.uno.jar out.sdk/types.rdb out.sdk/services.rdb
65 $(GCCS_COMPAT) uno \
66 -c test.java.javamain.Component -l $(URLPREFIX)$(cwd)/$< \
67 -env:URE_MORE_TYPES=$(URLPREFIX)$(cwd)/out.sdk/types.rdb \
68 -env:URE_MORE_SERVICES=$(URLPREFIX)$(cwd)/out.sdk/services.rdb
70 ifeq "$(PLATFORM)" "windows"
71 set_vars = set URE_MORE_TYPES=$(URLPREFIX)$(cwd)/out.sdk/types.rdb && \
72 set URE_MORE_SERVICES=$(URLPREFIX)$(cwd)/out.sdk/services.rdb &&
73 else
74 set_vars = URE_MORE_TYPES=$(URLPREFIX)$(cwd)/out.sdk/types.rdb \
75 URE_MORE_SERVICES=$(URLPREFIX)$(cwd)/out.sdk/services.rdb
76 endif
77 .PHONY: test-javanative
78 test-javanative: out.sdk/runner.jar out.sdk/javanative.jar \
79 out.sdk/services.rdb out.sdk/types.rdb
80 $(set_vars) $(GCCS_COMPAT) $(SDK_JAVA) -jar out.sdk/runner.jar \
81 $(ure_java_url)/ $(URLPREFIX)$(cwd)/out.sdk/javanative.jar
83 do_server = $(GCCS_COMPAT) uno -c test.cpp.cppserver.Component \
84 -l $(URLPREFIX)$(cwd)/out.sdk/cppserver.uno.$(SHAREDLIB_EXT) \
85 -env:URE_MORE_TYPES=$(URLPREFIX)$(cwd)/out.sdk/types.rdb \
86 -env:URE_MORE_SERVICES=$(URLPREFIX)$(cwd)/out.sdk/services.rdb \
87 -u "uno:pipe,name=ure_test;urp;server" --singleaccept
88 do_client = $(SDK_JAVA) -jar out.sdk/runner.jar $(ure_java_url)/ \
89 $(URLPREFIX)$(cwd)/out.sdk/javaclient.jar \
90 "uno:pipe,name=ure_test;urp;server"
91 .PHONY: test-clientserver
92 test-clientserver: out.sdk/cppserver.uno.$(SHAREDLIB_EXT) out.sdk/types.rdb \
93 out.sdk/services.rdb out.sdk/runner.jar out.sdk/javaclient.jar
94 ifeq "$(PLATFORM)" "windows"
95 echo $(subst %,%%,$(do_server)) > out.sdk/server.bat
96 echo $(subst %,%%,$(do_client)) > out.sdk/client.bat
97 @ echo Execute test-clientserver manually: start out.sdk\server.bat
98 @ echo and then simultaneously start out.sdk\client.bat
99 else
100 $(do_server) &
101 sleep 5 && $(do_client)
102 endif
105 .PHONY: clean
106 clean:
107 $(DELRECURSIVE) $(subst /,$(PS),out.sdk)
110 out.sdk/cppmain.uno.$(SHAREDLIB_EXT): out.sdk/cppmain.$(OBJ_EXT) | out.sdk
111 $(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
112 $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(SALHELPERLIB) \
113 $(LIBO_SDK_LDFLAGS_STDLIBS)
115 out.sdk/cppmain.$(OBJ_EXT): cppmain.cc out.sdk/cpputypes.cppumaker.flag \
116 out.sdk/types.cppumaker.flag | out.sdk
117 $(CC) $(CC_FLAGS) $(CC_OUTPUT_SWITCH)$@ $(CC_INCLUDES) \
118 -Iout.sdk/include/cpputypes -Iout.sdk/include/types $(CC_DEFINES) $<
121 out.sdk/cpptest.uno.$(SHAREDLIB_EXT): out.sdk/cpptest.$(OBJ_EXT) | out.sdk
122 $(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
123 $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(LIBO_SDK_LDFLAGS_STDLIBS)
125 out.sdk/cpptest.$(OBJ_EXT): cpptest.cc out.sdk/cpputypes.cppumaker.flag \
126 out.sdk/types.cppumaker.flag | out.sdk
127 $(CC) $(CC_FLAGS) $(CC_OUTPUT_SWITCH)$@ $(CC_INCLUDES) \
128 -Iout.sdk/include/cpputypes -Iout.sdk/include/types $(CC_DEFINES) $<
131 out.sdk/cppserver.uno.$(SHAREDLIB_EXT): out.sdk/cppserver.$(OBJ_EXT) | out.sdk
132 $(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
133 $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(LIBO_SDK_LDFLAGS_STDLIBS)
135 out.sdk/cppserver.$(OBJ_EXT): cppserver.cc out.sdk/cpputypes.cppumaker.flag \
136 out.sdk/types.cppumaker.flag | out.sdk
137 $(CC) $(CC_FLAGS) $(CC_OUTPUT_SWITCH)$@ $(CC_INCLUDES) \
138 -Iout.sdk/include/cpputypes -Iout.sdk/include/types $(CC_DEFINES) $<
141 out.sdk/cpputypes.cppumaker.flag: | out.sdk
142 $(CPPUMAKER) -O./out.sdk/include/cpputypes \
143 "-Tcom.sun.star.beans.Introspection;com.sun.star.beans.theIntrospection;com.sun.star.bridge.BridgeFactory;com.sun.star.bridge.UnoUrlResolver;com.sun.star.connection.Acceptor;com.sun.star.connection.Connector;com.sun.star.io.Pipe;com.sun.star.io.TextInputStream;com.sun.star.io.TextOutputStream;com.sun.star.java.JavaVirtualMachine;com.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.loader.Java;com.sun.star.loader.SharedLibrary;com.sun.star.reflection.ProxyFactory;com.sun.star.registry.ImplementationRegistration;com.sun.star.registry.SimpleRegistry;com.sun.star.registry.XRegistryKey;com.sun.star.script.Converter;com.sun.star.script.Invocation;com.sun.star.security.AccessController;com.sun.star.security.Policy;com.sun.star.uno.DeploymentException;com.sun.star.uno.Exception;com.sun.star.uno.NamingService;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;com.sun.star.uri.ExternalUriReferenceTranslator;com.sun.star.uri.UriReferenceFactory;com.sun.star.uri.VndSunStarPkgUrlReferenceFactory;com.sun.star.util.theMacroExpander" \
144 "$(URE_TYPES)"
145 touch $@
147 out.sdk/types.cppumaker.flag: out.sdk/types.rdb | out.sdk
148 $(CPPUMAKER) -O./out.sdk/include/types ./$< "-X$(URE_TYPES)"
149 touch $@
152 out.sdk/javamain.uno.jar: \
153 out.sdk/class/javamain/test/java/javamain/JavaMain.class \
154 out.sdk/javamain.mf | out.sdk
155 $(SDK_JAR) cfm $@ out.sdk/javamain.mf -C out.sdk/class/javamain test
157 out.sdk/javamain.mf: javamain.mf.template | out.sdk
158 sed -e $(qt)s~^Class-Path:$$~& tester.jar~$(qt) \
159 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
161 out.sdk/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \
162 out.sdk/tester.jar | out.sdk/class
163 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javamain)
164 $(MKDIR) $(subst /,$(PS),out.sdk/class/javamain)
165 $(SDK_JAVAC) $(JAVAC_FLAGS) \
166 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/tester.jar" \
167 -sourcepath . -d out.sdk/class/javamain $<
170 out.sdk/runner.jar: out.sdk/class/runner/test/java/runner/Runner.class \
171 out.sdk/runner.mf | out.sdk
172 $(SDK_JAR) cfm $@ out.sdk/runner.mf -C out.sdk/class/runner test
174 out.sdk/runner.mf: runner.mf.template | out.sdk
175 sed -e \
176 $(qt)s~^Class-Path:$$~& $(ure_java_url)/unoloader.jar~$(qt) \
177 -e $(qt)s~^UNO-Type-Path:$$~& ~$(qt) $< > $@
179 out.sdk/class/runner/test/java/runner/Runner.class: Runner.java | out.sdk/class
180 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/runner)
181 $(MKDIR) $(subst /,$(PS),out.sdk/class/runner)
182 $(SDK_JAVAC) $(JAVAC_FLAGS) -sourcepath . -d out.sdk/class/runner $<
185 out.sdk/tester.jar: out.sdk/class/tester/test/java/tester/Tester.class \
186 out.sdk/tester.mf | out.sdk
187 $(SDK_JAR) cfm $@ out.sdk/tester.mf -C out.sdk/class/tester test
189 out.sdk/tester.mf: tester.mf.template | out.sdk
190 sed -e $(qt)s~^Class-Path:$$~& types.jar~$(qt) \
191 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
193 out.sdk/class/tester/test/java/tester/Tester.class: Tester.java \
194 out.sdk/types.jar | out.sdk/class
195 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/tester)
196 $(MKDIR) $(subst /,$(PS),out.sdk/class/tester)
197 $(SDK_JAVAC) $(JAVAC_FLAGS) \
198 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/types.jar" \
199 -sourcepath . -d out.sdk/class/tester $<
202 out.sdk/javatest.uno.jar: \
203 out.sdk/class/javatest/test/java/javatest/JavaTest.class \
204 out.sdk/javatest.mf | out.sdk
205 $(SDK_JAR) cfm $@ out.sdk/javatest.mf -C out.sdk/class/javatest test
207 out.sdk/javatest.mf: javatest.mf.template | out.sdk
208 sed -e $(qt)s~^Class-Path:$$~& types.jar~$(qt) \
209 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
211 out.sdk/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \
212 out.sdk/types.jar | out.sdk/class
213 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javatest)
214 $(MKDIR) $(subst /,$(PS),out.sdk/class/javatest)
215 $(SDK_JAVAC) $(JAVAC_FLAGS) \
216 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/types.jar" \
217 -sourcepath . -d out.sdk/class/javatest $<
220 out.sdk/javanative.jar: \
221 out.sdk/class/javanative/test/java/javanative/JavaNative.class \
222 out.sdk/javanative.mf | out.sdk
223 $(SDK_JAR) cfm $@ out.sdk/javanative.mf -C out.sdk/class/javanative test
225 out.sdk/javanative.mf: javanative.mf.template | out.sdk
226 sed -e $(qt)s~^Class-Path:$$~& tester.jar~$(qt) \
227 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
229 out.sdk/class/javanative/test/java/javanative/JavaNative.class: \
230 JavaNative.java out.sdk/tester.jar | out.sdk/class
231 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javanative)
232 $(MKDIR) $(subst /,$(PS),out.sdk/class/javanative)
233 $(SDK_JAVAC) $(JAVAC_FLAGS) \
234 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/tester.jar" \
235 -sourcepath . -d out.sdk/class/javanative $<
238 out.sdk/javaclient.jar: \
239 out.sdk/class/javaclient/test/java/javaclient/JavaClient.class \
240 out.sdk/javaclient.mf | out.sdk
241 $(SDK_JAR) cfm $@ out.sdk/javaclient.mf -C out.sdk/class/javaclient test
243 out.sdk/javaclient.mf: javaclient.mf.template | out.sdk
244 sed -e $(qt)s~^Class-Path:$$~& types.jar~$(qt) \
245 -e $(qt)s~^UNO-Type-Path:$$~& types.jar~$(qt) $< > $@
247 out.sdk/class/javaclient/test/java/javaclient/JavaClient.class: \
248 JavaClient.java out.sdk/types.jar | out.sdk/class
249 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/javaclient)
250 $(MKDIR) $(subst /,$(PS),out.sdk/class/javaclient)
251 $(SDK_JAVAC) $(JAVAC_FLAGS) \
252 -classpath "$(CLASSPATH)$(PATH_SEPARATOR)out.sdk/types.jar" \
253 -sourcepath . -d out.sdk/class/javaclient $<
256 out.sdk/types.jar: out.sdk/types.javamaker.flag out.sdk/types.mf | out.sdk
257 $(SDK_JAR) cfm $@ out.sdk/types.mf -C out.sdk/class/types test
259 out.sdk/types.mf: types.mf.template | out.sdk
260 sed -e $(qt)s~^Class-Path:$$~& ~$(qt) \
261 -e $(qt)s~^UNO-Type-Path:$$~& \<\>~$(qt) $< > $@
263 out.sdk/types.javamaker.flag: out.sdk/types.rdb | out.sdk out.sdk/class
264 - $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/types)
265 $(JAVAMAKER) -O./out.sdk/class/types ./$< "-X$(URE_TYPES)"
266 touch $@
269 out.sdk/types.rdb: types.idl | out.sdk
270 $(UNOIDLWRITE) $(URE_TYPES) $< $@
273 out.sdk/services.rdb: services.rdb.in | out.sdk/cpptest.uno.$(SHAREDLIB_EXT) \
274 out.sdk/javatest.uno.jar out.sdk
275 $(DEL) $(subst /,$(PS),$@)
276 sed -e s/@SHAREDLIB_EXT@/$(SHAREDLIB_EXT)/ < $^ > $@
279 out.sdk:
280 $(MKDIR) $(subst /,$(PS),$@)
282 out.sdk/class: | out.sdk
283 $(MKDIR) $(subst /,$(PS),$@)