Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / ure / source / uretest / Makefile.pln
blob37025d7acb39429ab7ee6beb4ad5145b493454df
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 must be set (see README):
20 #SDK_HOME := /opt/libreoffice/basis3.1/sdk
22 # The following variables can be set, if necessary (see README):
23 #URE_HOME := /opt/libreoffice
24 #GCCS_COMPAT := LD_PRELOAD=/lib/libgcc_s.so.1
27 URE_HOME ?= /opt/libreoffice
29 .DELETE_ON_ERROR:
32 .PHONY: check
33 check: test-cpptest test-javatest test-javanative test-clientserver
35 .PHONY: test-cpptest
36 test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb
37         $(GCCS_COMPAT) $(URE_HOME)/program/uno \
38             -c test.cpp.cppmain.Component -l file://$(PWD)/$< \
39             -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
40             -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb
42 .PHONY: test-javatest
43 test-javatest: out.pln/javamain.uno.jar out.pln/types.rdb out.pln/services.rdb
44         $(GCCS_COMPAT) $(URE_HOME)/program/uno \
45             -c test.java.javamain.Component -l file://$(PWD)/$< \
46             -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
47             -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb
49 .PHONY: test-javanative
50 test-javanative: out.pln/runner.jar out.pln/javanative.jar \
51             out.pln/types.rdb out.pln/services.rdb
52         URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
53             URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb \
54             $(GCCS_COMPAT) LD_LIBRARY_PATH=$(URE_HOME)/program java \
55             -jar out.pln/runner.jar file://$(URE_HOME)/program/classes/ \
56             file://$(PWD)/out.pln/javanative.jar
58 .PHONY: test-clientserver
59 test-clientserver: out.pln/cppserver.uno.so out.pln/types.rdb \
60             out.pln/services.rdb out.pln/runner.jar out.pln/javaclient.jar
61         $(GCCS_COMPAT) $(URE_HOME)/program/uno -c test.cpp.cppserver.Component \
62             -l file://$(PWD)/out.pln/cppserver.uno.so \
63             -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
64             -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb \
65             -u 'uno:pipe,name=ure_test;urp;server' --singleaccept &
66         sleep 5 && \
67             java -jar out.pln/runner.jar file://$(URE_HOME)/program/classes/ \
68             file://$(PWD)/out.pln/javaclient.jar \
69             'uno:pipe,name=ure_test;urp;server'
72 .PHONY: clean
73 clean:
74         rm -rf out.pln
77 out.pln/cppmain.uno.so: out.pln/cppmain.o | out.pln out.pln/lib/libuno_cppu.so \
78             out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so \
79             out.pln/lib/libuno_salhelpergcc3.so
80         g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
81             -luno_cppu -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3
83 out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \
84             out.pln/types.cppumaker.flag | out.pln
85         g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
86             -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
87             -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $<
90 out.pln/cpptest.uno.so: out.pln/cpptest.o | out.pln out.pln/lib/libuno_cppu.so \
91             out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so
92         g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
93             -luno_cppu -luno_cppuhelpergcc3 -luno_sal
95 out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \
96             out.pln/types.cppumaker.flag | out.pln
97         g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
98             -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
99             -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $<
102 out.pln/cppserver.uno.so: out.pln/cppserver.o | out.pln \
103             out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
104             out.pln/lib/libuno_sal.so
105         g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
106             -luno_cppu -luno_cppuhelpergcc3 -luno_sal
108 out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \
109             out.pln/types.cppumaker.flag | out.pln
110         g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
111             -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
112             -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $<
115 out.pln/cpputypes.cppumaker.flag: | out.pln
116         LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/cppumaker \
117             -O./out.pln/include/cpputypes \
118             '-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' \
119             $(URE_HOME)/program/types.rdb
120         touch $@
122 out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln
123         LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/cppumaker \
124             -O./out.pln/include/types ./$< -X$(URE_HOME)/program/types.rdb
125         touch $@
128 out.pln/javamain.uno.jar: \
129             out.pln/class/javamain/test/java/javamain/JavaMain.class \
130             out.pln/javamain.mf | out.pln
131         jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test
133 out.pln/javamain.mf: javamain.mf.template | out.pln
134         sed -e 's~^Class-Path:$$~& tester.jar~' \
135             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
137 out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \
138             out.pln/tester.jar | out.pln/class
139         rm -rf out.pln/class/javamain
140         mkdir out.pln/class/javamain
141         javac -classpath \
142             $(URE_HOME)/program/classes/libreoffice.jar:out.pln/tester.jar \
143             -sourcepath . -d out.pln/class/javamain $<
146 out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \
147             out.pln/runner.mf | out.pln
148         jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test
150 out.pln/runner.mf: runner.mf.template | out.pln
151         sed -e \
152             's~^Class-Path:$$~& file://$(URE_HOME)/program/classes/unoloader.jar~' \
153             -e 's~^UNO-Type-Path:$$~& ~' $< > $@
155 out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class
156         rm -rf out.pln/class/runner
157         mkdir out.pln/class/runner
158         javac -classpath $(URE_HOME)/program/classes/unoloader.jar \
159             -sourcepath . -d out.pln/class/runner $<
162 out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \
163             out.pln/tester.mf | out.pln
164         jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test
166 out.pln/tester.mf: tester.mf.template | out.pln
167         sed -e 's~^Class-Path:$$~& types.jar~' \
168             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
170 out.pln/class/tester/test/java/tester/Tester.class: Tester.java \
171             out.pln/types.jar | out.pln/class
172         rm -rf out.pln/class/tester
173         mkdir out.pln/class/tester
174         javac -classpath \
175             $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \
176             -sourcepath . -d out.pln/class/tester $<
179 out.pln/javatest.uno.jar: \
180             out.pln/class/javatest/test/java/javatest/JavaTest.class \
181             out.pln/javatest.mf | out.pln
182         jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test
184 out.pln/javatest.mf: javatest.mf.template | out.pln
185         sed -e 's~^Class-Path:$$~& types.jar~' \
186             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
188 out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \
189             out.pln/types.jar | out.pln/class
190         rm -rf out.pln/class/javatest
191         mkdir out.pln/class/javatest
192         javac -classpath \
193             $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \
194             -sourcepath . -d out.pln/class/javatest $<
197 out.pln/javanative.jar: \
198             out.pln/class/javanative/test/java/javanative/JavaNative.class \
199             out.pln/javanative.mf | out.pln
200         jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test
202 out.pln/javanative.mf: javanative.mf.template | out.pln
203         sed -e 's~^Class-Path:$$~& tester.jar~' \
204             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
206 out.pln/class/javanative/test/java/javanative/JavaNative.class: \
207             JavaNative.java out.pln/tester.jar | out.pln/class
208         rm -rf out.pln/class/javanative
209         mkdir out.pln/class/javanative
210         javac -classpath \
211             $(URE_HOME)/program/classes/libreoffice.jar:out.pln/tester.jar \
212             -sourcepath . -d out.pln/class/javanative $<
215 out.pln/javaclient.jar: \
216             out.pln/class/javaclient/test/java/javaclient/JavaClient.class \
217             out.pln/javaclient.mf | out.pln
218         jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test
220 out.pln/javaclient.mf: javaclient.mf.template | out.pln
221         sed -e 's~^Class-Path:$$~& types.jar~' \
222             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
224 out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \
225             JavaClient.java out.pln/types.jar | out.pln/class
226         rm -rf out.pln/class/javaclient
227         mkdir out.pln/class/javaclient
228         javac -classpath \
229             $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \
230             -sourcepath . -d out.pln/class/javaclient $<
233 out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln
234         jar cfm $@ out.pln/types.mf -C out.pln/class/types test
236 out.pln/types.mf: types.mf.template | out.pln
237         sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@
239 out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class
240         rm -rf out.pln/class/types
241         LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/javamaker \
242             -O./out.pln/class/types ./$< -X$(URE_HOME)/program/types.rdb
243         touch $@
246 out.pln/types.rdb: types.idl | out.pln
247         LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/unoidl-write \
248             $(URE_HOME)/program/types.rdb $< $@
251 out.pln/services.rdb: services.rdb.in | out.pln/cpptest.uno.so \
252             out.pln/javatest.uno.jar out.pln
253         sed -e s/@SHAREDLIB_EXT@/so/ < $^ > $@
256 out.pln/lib/libuno_cppu.so: | out.pln/lib
257         ln -fs $(URE_HOME)/program/libuno_cppu.so.3 $@
259 out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib
260         ln -fs $(URE_HOME)/program/libuno_cppuhelpergcc3.so.3 $@
262 out.pln/lib/libuno_sal.so: | out.pln/lib
263         ln -fs $(URE_HOME)/program/libuno_sal.so.3 $@
265 out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib
266         ln -fs $(URE_HOME)/program/libuno_salhelpergcc3.so.3 $@
269 out.pln:
270         mkdir $@
272 out.pln/class: | out.pln
273         mkdir $@
275 out.pln/lib: | out.pln
276         mkdir $@