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/openoffice.org/basis3.1/sdk
22 # The following variables can be set, if necessary (see README):
23 #URE_HOME := /opt/openoffice.org/ure
24 #GCCS_COMPAT := LD_PRELOAD=/lib/libgcc_s.so.1
27 URE_HOME ?= /opt/openoffice.org/ure
33 check: test-regview test-cpptest test-javatest test-javanative test-clientserver
36 test-regview: out.pln/types.rdb
37 $(URE_HOME)/bin/regview $< > /dev/null
40 test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb
41 $(GCCS_COMPAT) $(URE_HOME)/bin/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)/bin/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)/lib java \
59 -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \
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)/bin/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)/share/java/ \
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 \
92 -DHAVE_GCC_VISIBILITY_FEATURE -DLINUX -DUNX $<
95 out.pln/cpptest.uno.so: out.pln/cpptest.o | out.pln out.pln/lib/libuno_cppu.so \
96 out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so
97 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
98 -luno_cppu -luno_cppuhelpergcc3 -luno_sal
100 out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \
101 out.pln/types.cppumaker.flag | out.pln
102 g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
103 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
104 -I out.pln/include/types -DCPPU_ENV=gcc3 \
105 -DHAVE_GCC_VISIBILITY_FEATURE -DLINUX -DUNX $<
108 out.pln/cppserver.uno.so: out.pln/cppserver.o | out.pln \
109 out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
110 out.pln/lib/libuno_sal.so
111 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
112 -luno_cppu -luno_cppuhelpergcc3 -luno_sal
114 out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \
115 out.pln/types.cppumaker.flag | out.pln
116 g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
117 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
118 -I out.pln/include/types -DCPPU_ENV=gcc3 \
119 -DHAVE_GCC_VISIBILITY_FEATURE -DLINUX -DUNX $<
122 out.pln/cpputypes.cppumaker.flag: | out.pln
123 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
124 -O./out.pln/include/cpputypes \
125 '-Tcom.sun.star.beans.Introspection;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' \
126 $(URE_HOME)/share/misc/types.rdb
129 out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln
130 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
131 -O./out.pln/include/types $< -X$(URE_HOME)/share/misc/types.rdb
135 out.pln/javamain.uno.jar: \
136 out.pln/class/javamain/test/java/javamain/JavaMain.class \
137 out.pln/javamain.mf | out.pln
138 jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test
140 out.pln/javamain.mf: javamain.mf.template | out.pln
141 sed -e 's~^Class-Path:$$~& tester.jar~' \
142 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
144 out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \
145 out.pln/tester.jar | out.pln/class
146 rm -rf out.pln/class/javamain
147 mkdir out.pln/class/javamain
149 $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \
150 -sourcepath . -d out.pln/class/javamain $<
153 out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \
154 out.pln/runner.mf | out.pln
155 jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test
157 out.pln/runner.mf: runner.mf.template | out.pln
159 's~^Class-Path:$$~& file://$(URE_HOME)/share/java/unoloader.jar~' \
160 -e 's~^UNO-Type-Path:$$~& ~' $< > $@
162 out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class
163 rm -rf out.pln/class/runner
164 mkdir out.pln/class/runner
165 javac -classpath $(URE_HOME)/share/java/unoloader.jar -sourcepath . \
166 -d out.pln/class/runner $<
169 out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \
170 out.pln/tester.mf | out.pln
171 jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test
173 out.pln/tester.mf: tester.mf.template | out.pln
174 sed -e 's~^Class-Path:$$~& types.jar~' \
175 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
177 out.pln/class/tester/test/java/tester/Tester.class: Tester.java \
178 out.pln/types.jar | out.pln/class
179 rm -rf out.pln/class/tester
180 mkdir out.pln/class/tester
181 javac -classpath $(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
182 -sourcepath . -d out.pln/class/tester $<
185 out.pln/javatest.uno.jar: \
186 out.pln/class/javatest/test/java/javatest/JavaTest.class \
187 out.pln/javatest.mf | out.pln
188 jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test
190 out.pln/javatest.mf: javatest.mf.template | out.pln
191 sed -e 's~^Class-Path:$$~& types.jar~' \
192 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
194 out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \
195 out.pln/types.jar | out.pln/class
196 rm -rf out.pln/class/javatest
197 mkdir out.pln/class/javatest
199 $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
200 -sourcepath . -d out.pln/class/javatest $<
203 out.pln/javanative.jar: \
204 out.pln/class/javanative/test/java/javanative/JavaNative.class \
205 out.pln/javanative.mf | out.pln
206 jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test
208 out.pln/javanative.mf: javanative.mf.template | out.pln
209 sed -e 's~^Class-Path:$$~& tester.jar~' \
210 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
212 out.pln/class/javanative/test/java/javanative/JavaNative.class: \
213 JavaNative.java out.pln/tester.jar | out.pln/class
214 rm -rf out.pln/class/javanative
215 mkdir out.pln/class/javanative
217 $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \
218 -sourcepath . -d out.pln/class/javanative $<
221 out.pln/javaclient.jar: \
222 out.pln/class/javaclient/test/java/javaclient/JavaClient.class \
223 out.pln/javaclient.mf | out.pln
224 jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test
226 out.pln/javaclient.mf: javaclient.mf.template | out.pln
227 sed -e 's~^Class-Path:$$~& types.jar~' \
228 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
230 out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \
231 JavaClient.java out.pln/types.jar | out.pln/class
232 rm -rf out.pln/class/javaclient
233 mkdir out.pln/class/javaclient
235 $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
236 -sourcepath . -d out.pln/class/javaclient $<
239 out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln
240 jar cfm $@ out.pln/types.mf -C out.pln/class/types test
242 out.pln/types.mf: types.mf.template | out.pln
243 sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@
245 out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class
246 rm -rf out.pln/class/types
247 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/javamaker \
248 -O./out.pln/class/types $< -X$(URE_HOME)/share/misc/types.rdb
252 out.pln/types.rdb: out.pln/types.urd | out.pln
253 $(URE_HOME)/bin/regmerge $@ /UCR $<
255 out.pln/types.urd: types.idl | out.pln
256 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/idlc -O$(@D) \
257 -I$(SDK_HOME)/idl -cid -we $<
260 out.pln/services.rdb: services.rdb.in | out.pln/cpptest.uno.so \
261 out.pln/javatest.uno.jar out.pln
262 sed -e s/@SHAREDLIB_EXT@/so/ < $^ > $@
265 out.pln/lib/libuno_cppu.so: | out.pln/lib
266 ln -fs $(URE_HOME)/lib/libuno_cppu.so.3 $@
268 out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib
269 ln -fs $(URE_HOME)/lib/libuno_cppuhelpergcc3.so.3 $@
271 out.pln/lib/libuno_sal.so: | out.pln/lib
272 ln -fs $(URE_HOME)/lib/libuno_sal.so.3 $@
274 out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib
275 ln -fs $(URE_HOME)/lib/libuno_salhelpergcc3.so.3 $@
281 out.pln/class: | out.pln
284 out.pln/lib: | out.pln