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
33 check: test-regview test-cpptest test-javatest test-javanative test-clientserver
36 test-regview: out.pln/types.rdb
37 $(URE_HOME)/program/regview $< > /dev/null
40 test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb
41 $(GCCS_COMPAT) $(URE_HOME)/program/uno \
42 -c test.cpp.cppmain.Component -l file://$(PWD)/$< \
43 -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
44 -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb
47 test-javatest: out.pln/javamain.uno.jar out.pln/types.rdb out.pln/services.rdb
48 $(GCCS_COMPAT) $(URE_HOME)/program/uno \
49 -c test.java.javamain.Component -l file://$(PWD)/$< \
50 -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
51 -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb
53 .PHONY: test-javanative
54 test-javanative: out.pln/runner.jar out.pln/javanative.jar \
55 out.pln/types.rdb out.pln/services.rdb
56 URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
57 URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb \
58 $(GCCS_COMPAT) LD_LIBRARY_PATH=$(URE_HOME)/program java \
59 -jar out.pln/runner.jar file://$(URE_HOME)/program/classes/ \
60 file://$(PWD)/out.pln/javanative.jar
62 .PHONY: test-clientserver
63 test-clientserver: out.pln/cppserver.uno.so out.pln/types.rdb \
64 out.pln/services.rdb out.pln/runner.jar out.pln/javaclient.jar
65 $(GCCS_COMPAT) $(URE_HOME)/program/uno -c test.cpp.cppserver.Component \
66 -l file://$(PWD)/out.pln/cppserver.uno.so \
67 -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \
68 -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb \
69 -u 'uno:pipe,name=ure_test;urp;server' --singleaccept &
71 java -jar out.pln/runner.jar file://$(URE_HOME)/program/classes/ \
72 file://$(PWD)/out.pln/javaclient.jar \
73 'uno:pipe,name=ure_test;urp;server'
81 out.pln/cppmain.uno.so: out.pln/cppmain.o | out.pln out.pln/lib/libuno_cppu.so \
82 out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so \
83 out.pln/lib/libuno_salhelpergcc3.so
84 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
85 -luno_cppu -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3
87 out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \
88 out.pln/types.cppumaker.flag | out.pln
89 g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
90 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
91 -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $<
94 out.pln/cpptest.uno.so: out.pln/cpptest.o | out.pln out.pln/lib/libuno_cppu.so \
95 out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so
96 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
97 -luno_cppu -luno_cppuhelpergcc3 -luno_sal
99 out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \
100 out.pln/types.cppumaker.flag | out.pln
101 g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
102 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
103 -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $<
106 out.pln/cppserver.uno.so: out.pln/cppserver.o | out.pln \
107 out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
108 out.pln/lib/libuno_sal.so
109 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
110 -luno_cppu -luno_cppuhelpergcc3 -luno_sal
112 out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \
113 out.pln/types.cppumaker.flag | out.pln
114 g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
115 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
116 -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $<
119 out.pln/cpputypes.cppumaker.flag: | out.pln
120 LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/cppumaker \
121 -O./out.pln/include/cpputypes \
122 '-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' \
123 $(URE_HOME)/program/types.rdb
126 out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln
127 LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/cppumaker \
128 -O./out.pln/include/types ./$< -X$(URE_HOME)/program/types.rdb
132 out.pln/javamain.uno.jar: \
133 out.pln/class/javamain/test/java/javamain/JavaMain.class \
134 out.pln/javamain.mf | out.pln
135 jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test
137 out.pln/javamain.mf: javamain.mf.template | out.pln
138 sed -e 's~^Class-Path:$$~& tester.jar~' \
139 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
141 out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \
142 out.pln/tester.jar | out.pln/class
143 rm -rf out.pln/class/javamain
144 mkdir out.pln/class/javamain
146 $(URE_HOME)/program/classes/libreoffice.jar:out.pln/tester.jar \
147 -sourcepath . -d out.pln/class/javamain $<
150 out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \
151 out.pln/runner.mf | out.pln
152 jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test
154 out.pln/runner.mf: runner.mf.template | out.pln
156 's~^Class-Path:$$~& file://$(URE_HOME)/program/classes/unoloader.jar~' \
157 -e 's~^UNO-Type-Path:$$~& ~' $< > $@
159 out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class
160 rm -rf out.pln/class/runner
161 mkdir out.pln/class/runner
162 javac -classpath $(URE_HOME)/program/classes/unoloader.jar \
163 -sourcepath . -d out.pln/class/runner $<
166 out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \
167 out.pln/tester.mf | out.pln
168 jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test
170 out.pln/tester.mf: tester.mf.template | out.pln
171 sed -e 's~^Class-Path:$$~& types.jar~' \
172 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
174 out.pln/class/tester/test/java/tester/Tester.class: Tester.java \
175 out.pln/types.jar | out.pln/class
176 rm -rf out.pln/class/tester
177 mkdir out.pln/class/tester
179 $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \
180 -sourcepath . -d out.pln/class/tester $<
183 out.pln/javatest.uno.jar: \
184 out.pln/class/javatest/test/java/javatest/JavaTest.class \
185 out.pln/javatest.mf | out.pln
186 jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test
188 out.pln/javatest.mf: javatest.mf.template | out.pln
189 sed -e 's~^Class-Path:$$~& types.jar~' \
190 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
192 out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \
193 out.pln/types.jar | out.pln/class
194 rm -rf out.pln/class/javatest
195 mkdir out.pln/class/javatest
197 $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \
198 -sourcepath . -d out.pln/class/javatest $<
201 out.pln/javanative.jar: \
202 out.pln/class/javanative/test/java/javanative/JavaNative.class \
203 out.pln/javanative.mf | out.pln
204 jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test
206 out.pln/javanative.mf: javanative.mf.template | out.pln
207 sed -e 's~^Class-Path:$$~& tester.jar~' \
208 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
210 out.pln/class/javanative/test/java/javanative/JavaNative.class: \
211 JavaNative.java out.pln/tester.jar | out.pln/class
212 rm -rf out.pln/class/javanative
213 mkdir out.pln/class/javanative
215 $(URE_HOME)/program/classes/libreoffice.jar:out.pln/tester.jar \
216 -sourcepath . -d out.pln/class/javanative $<
219 out.pln/javaclient.jar: \
220 out.pln/class/javaclient/test/java/javaclient/JavaClient.class \
221 out.pln/javaclient.mf | out.pln
222 jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test
224 out.pln/javaclient.mf: javaclient.mf.template | out.pln
225 sed -e 's~^Class-Path:$$~& types.jar~' \
226 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
228 out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \
229 JavaClient.java out.pln/types.jar | out.pln/class
230 rm -rf out.pln/class/javaclient
231 mkdir out.pln/class/javaclient
233 $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \
234 -sourcepath . -d out.pln/class/javaclient $<
237 out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln
238 jar cfm $@ out.pln/types.mf -C out.pln/class/types test
240 out.pln/types.mf: types.mf.template | out.pln
241 sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@
243 out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class
244 rm -rf out.pln/class/types
245 LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/javamaker \
246 -O./out.pln/class/types ./$< -X$(URE_HOME)/program/types.rdb
250 out.pln/types.rdb: out.pln/types.urd | out.pln
251 $(URE_HOME)/program/regmerge $@ /UCR $<
253 out.pln/types.urd: types.idl | out.pln
254 LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/idlc -O$(@D) \
255 -I$(SDK_HOME)/idl -cid -we $<
258 out.pln/services.rdb: services.rdb.in | out.pln/cpptest.uno.so \
259 out.pln/javatest.uno.jar out.pln
260 sed -e s/@SHAREDLIB_EXT@/so/ < $^ > $@
263 out.pln/lib/libuno_cppu.so: | out.pln/lib
264 ln -fs $(URE_HOME)/program/libuno_cppu.so.3 $@
266 out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib
267 ln -fs $(URE_HOME)/program/libuno_cppuhelpergcc3.so.3 $@
269 out.pln/lib/libuno_sal.so: | out.pln/lib
270 ln -fs $(URE_HOME)/program/libuno_sal.so.3 $@
272 out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib
273 ln -fs $(URE_HOME)/program/libuno_salhelpergcc3.so.3 $@
279 out.pln/class: | out.pln
282 out.pln/lib: | out.pln