update dev300-m58
[ooovba.git] / ure / source / uretest / Makefile.pln
blob8a46d00a1acbf163e236c72d69de3f67e805da2a
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.pln,v $
11 # $Revision: 1.7.10.1 $
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 must be set (see README):
33 #SDK_HOME := /opt/openoffice.org/basis3.1/sdk
35 # The following variables can be set, if necessary (see README):
36 #URE_HOME := /opt/openoffice.org/ure
37 #GXX_INCLUDE_PATH := /usr/include/g++
38 #GCCS_COMPAT := LD_PRELOAD=/lib/libgcc_s.so.1
41 URE_HOME ?= /opt/openoffice.org/ure
42 GXX_INCLUDE_PATH ?= /usr/include/g++
44 .DELETE_ON_ERROR:
47 .PHONY: test
48 test: test-regview test-cpptest test-javatest test-javanative test-clientserver
50 .PHONY: test-regview
51 test-regview: out.pln/services.rdb
52         $(URE_HOME)/bin/regview $< > /dev/null
54 .PHONY: test-cpptest
55 test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb
56         $(GCCS_COMPAT) $(URE_HOME)/bin/uno \
57             -c test.cpp.cppmain.Component -l file://$(PWD)/$< \
58             -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \
59             -ro $(URE_HOME)/share/misc/services.rdb -ro out.pln/services.rdb
61 .PHONY: test-javatest
62 test-javatest: out.pln/javamain.uno.jar out.pln/types.rdb out.pln/services.rdb
63         $(GCCS_COMPAT) $(URE_HOME)/bin/uno \
64             -c test.java.javamain.Component -l file://$(PWD)/$< \
65             -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \
66             -ro $(URE_HOME)/share/misc/services.rdb -ro out.pln/services.rdb
68 .PHONY: test-javanative
69 test-javanative: out.pln/runner.jar out.pln/javanative.jar \
70             out.pln/javanative.rc out.pln/services.rdb out.pln/types.rdb
71         $(GCCS_COMPAT) LD_LIBRARY_PATH=$(URE_HOME)/lib java \
72             -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \
73             file://$(PWD)/out.pln/javanative.jar \
74             file://$(PWD)/out.pln/javanative.rc
76 .PHONY: test-clientserver
77 test-clientserver: out.pln/cppserver.uno.so out.pln/runner.jar \
78             out.pln/javaclient.jar
79         $(GCCS_COMPAT) $(URE_HOME)/bin/uno -c test.cpp.cppserver.Component \
80             -l file://$(PWD)/out.pln/cppserver.uno.so \
81             -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \
82             -ro $(URE_HOME)/share/misc/services.rdb \
83             -u 'uno:pipe,name=ure_test;urp;server' --singleaccept &
84         sleep 5 && \
85             java -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \
86             file://$(PWD)/out.pln/javaclient.jar \
87             'uno:pipe,name=ure_test;urp;server'
90 .PHONY: clean
91 clean:
92         rm -rf out.pln
95 out.pln/cppmain.uno.so: out.pln/cppmain.o version.map | out.pln \
96             out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
97             out.pln/lib/libuno_sal.so out.pln/lib/libuno_salhelpergcc3.so \
98             out.pln/lib/libstlport_gcc.so
99         g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
100             -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
101             -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3 -lstlport_gcc
103 out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \
104             out.pln/types.cppumaker.flag | out.pln
105         g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
106             -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
107             -I out.pln/include/types -DCPPU_ENV=gcc3 \
108             -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
111 out.pln/cpptest.uno.so: out.pln/cpptest.o version.map | out.pln \
112             out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
113             out.pln/lib/libuno_sal.so
114         g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
115             -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
116             -luno_cppuhelpergcc3 -luno_sal
118 out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \
119             out.pln/types.cppumaker.flag | out.pln
120         g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
121             -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
122             -I out.pln/include/types -DCPPU_ENV=gcc3 \
123             -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
126 out.pln/cppserver.uno.so: out.pln/cppserver.o version.map | out.pln \
127             out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
128             out.pln/lib/libuno_sal.so
129         g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
130             -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
131             -luno_cppuhelpergcc3 -luno_sal
133 out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \
134             out.pln/types.cppumaker.flag | out.pln
135         g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
136             -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
137             -I out.pln/include/types -DCPPU_ENV=gcc3 \
138             -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
141 out.pln/cpputypes.cppumaker.flag: | out.pln
142         LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
143             -O./out.pln/include/cpputypes \
144             '-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' \
145             -B/UCR $(URE_HOME)/share/misc/types.rdb
146         touch $@
148 out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln
149         LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
150             -O./out.pln/include/types -B/UCR $< \
151             -X$(URE_HOME)/share/misc/types.rdb
152         touch $@
155 out.pln/javamain.uno.jar: \
156             out.pln/class/javamain/test/java/javamain/JavaMain.class \
157             out.pln/javamain.mf | out.pln
158         jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test
160 out.pln/javamain.mf: javamain.mf.template | out.pln
161         sed -e 's~^Class-Path:$$~& tester.jar~' \
162             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
164 out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \
165             out.pln/tester.jar | out.pln/class
166         rm -rf out.pln/class/javamain
167         mkdir out.pln/class/javamain
168         javac -classpath \
169             $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \
170             -sourcepath . -d out.pln/class/javamain $<
173 out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \
174             out.pln/runner.mf | out.pln
175         jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test
177 out.pln/runner.mf: runner.mf.template | out.pln
178         sed -e \
179             's~^Class-Path:$$~& file://$(URE_HOME)/share/java/unoloader.jar~' \
180             -e 's~^UNO-Type-Path:$$~& ~' $< > $@
182 out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class
183         rm -rf out.pln/class/runner
184         mkdir out.pln/class/runner
185         javac -classpath $(URE_HOME)/share/java/unoloader.jar -sourcepath . \
186             -d out.pln/class/runner $<
189 out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \
190             out.pln/tester.mf | out.pln
191         jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test
193 out.pln/tester.mf: tester.mf.template | out.pln
194         sed -e 's~^Class-Path:$$~& types.jar~' \
195             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
197 out.pln/class/tester/test/java/tester/Tester.class: Tester.java \
198             out.pln/types.jar | out.pln/class
199         rm -rf out.pln/class/tester
200         mkdir out.pln/class/tester
201         javac -classpath $(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
202             -sourcepath . -d out.pln/class/tester $<
205 out.pln/javatest.uno.jar: \
206             out.pln/class/javatest/test/java/javatest/JavaTest.class \
207             out.pln/javatest.mf | out.pln
208         jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test
210 out.pln/javatest.mf: javatest.mf.template | out.pln
211         sed -e 's~^Class-Path:$$~& types.jar~' \
212             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
214 out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \
215             out.pln/types.jar | out.pln/class
216         rm -rf out.pln/class/javatest
217         mkdir out.pln/class/javatest
218         javac -classpath \
219             $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
220             -sourcepath . -d out.pln/class/javatest $<
223 out.pln/javanative.jar: \
224             out.pln/class/javanative/test/java/javanative/JavaNative.class \
225             out.pln/javanative.mf | out.pln
226         jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test
228 out.pln/javanative.mf: javanative.mf.template | out.pln
229         sed -e 's~^Class-Path:$$~& tester.jar~' \
230             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
232 out.pln/class/javanative/test/java/javanative/JavaNative.class: \
233             JavaNative.java out.pln/tester.jar | out.pln/class
234         rm -rf out.pln/class/javanative
235         mkdir out.pln/class/javanative
236         javac -classpath \
237             $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \
238             -sourcepath . -d out.pln/class/javanative $<
240 out.pln/javanative.rc: | out.pln
241         echo 'URE_INTERNAL_LIB_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_LIB_DIR}' > $@
242         echo 'URE_INTERNAL_JAVA_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_JAVA_DIR}' >> $@
243         echo 'UNO_TYPES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_TYPES} file://$(PWD)/out.pln/types.rdb' >> $@
244         echo 'UNO_SERVICES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_SERVICES} file://$(PWD)/out.pln/services.rdb' >> $@
247 out.pln/javaclient.jar: \
248             out.pln/class/javaclient/test/java/javaclient/JavaClient.class \
249             out.pln/javaclient.mf | out.pln
250         jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test
252 out.pln/javaclient.mf: javaclient.mf.template | out.pln
253         sed -e 's~^Class-Path:$$~& types.jar~' \
254             -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
256 out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \
257             JavaClient.java out.pln/types.jar | out.pln/class
258         rm -rf out.pln/class/javaclient
259         mkdir out.pln/class/javaclient
260         javac -classpath \
261             $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
262             -sourcepath . -d out.pln/class/javaclient $<
265 out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln
266         jar cfm $@ out.pln/types.mf -C out.pln/class/types test
268 out.pln/types.mf: types.mf.template | out.pln
269         sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@
271 out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class
272         rm -rf out.pln/class/types
273         LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/javamaker \
274             -O./out.pln/class/types -B/UCR $< -X$(URE_HOME)/share/misc/types.rdb
275         touch $@
278 out.pln/types.rdb: out.pln/types.urd | out.pln
279         $(URE_HOME)/bin/regmerge $@ /UCR $<
281 out.pln/types.urd: types.idl | out.pln
282         LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/idlc -O$(@D) \
283             -I$(SDK_HOME)/idl -cid -we $<
286 out.pln/services.rdb: out.pln/cpptest.uno.so out.pln/javatest.uno.jar | out.pln
287         rm -f $@
288         $(URE_HOME)/bin/regcomp -register -r $@ \
289             -c file://$(PWD)/out.pln/cpptest.uno.so
290         $(URE_HOME)/bin/regcomp -register \
291             -br $(URE_HOME)/share/misc/types.rdb \
292             -br $(URE_HOME)/share/misc/services.rdb -r $@ \
293             -c file://$(PWD)/out.pln/javatest.uno.jar
296 out.pln/lib/libuno_cppu.so: | out.pln/lib
297         ln -fs $(URE_HOME)/lib/libuno_cppu.so.3 $@
299 out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib
300         ln -fs $(URE_HOME)/lib/libuno_cppuhelpergcc3.so.3 $@
302 out.pln/lib/libuno_sal.so: | out.pln/lib
303         ln -fs $(URE_HOME)/lib/libuno_sal.so.3 $@
305 out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib
306         ln -fs $(URE_HOME)/lib/libuno_salhelpergcc3.so.3 $@
308 out.pln/lib/libstlport_gcc.so: | out.pln/lib
309         ln -fs $(URE_HOME)/lib/libstlport_gcc.so $@
312 out.pln:
313         mkdir $@
315 out.pln/class: | out.pln
316         mkdir $@
318 out.pln/lib: | out.pln
319         mkdir $@