xref: /aoo41x/main/ure/source/uretest/Makefile.pln (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28# The following variable must be set (see README):
29#SDK_HOME := /opt/openoffice.org/basis3.1/sdk
30
31# The following variables can be set, if necessary (see README):
32#URE_HOME := /opt/openoffice.org/ure
33#GXX_INCLUDE_PATH := /usr/include/g++
34#GCCS_COMPAT := LD_PRELOAD=/lib/libgcc_s.so.1
35
36
37URE_HOME ?= /opt/openoffice.org/ure
38GXX_INCLUDE_PATH ?= /usr/include/g++
39
40.DELETE_ON_ERROR:
41
42
43.PHONY: test
44test: test-regview test-cpptest test-javatest test-javanative test-clientserver
45
46.PHONY: test-regview
47test-regview: out.pln/services.rdb
48	$(URE_HOME)/bin/regview $< > /dev/null
49
50.PHONY: test-cpptest
51test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb
52	$(GCCS_COMPAT) $(URE_HOME)/bin/uno \
53            -c test.cpp.cppmain.Component -l file://$(PWD)/$< \
54            -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \
55            -ro $(URE_HOME)/share/misc/services.rdb -ro out.pln/services.rdb
56
57.PHONY: test-javatest
58test-javatest: out.pln/javamain.uno.jar out.pln/types.rdb out.pln/services.rdb
59	$(GCCS_COMPAT) $(URE_HOME)/bin/uno \
60            -c test.java.javamain.Component -l file://$(PWD)/$< \
61            -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \
62            -ro $(URE_HOME)/share/misc/services.rdb -ro out.pln/services.rdb
63
64.PHONY: test-javanative
65test-javanative: out.pln/runner.jar out.pln/javanative.jar \
66            out.pln/javanative.rc out.pln/services.rdb out.pln/types.rdb
67	$(GCCS_COMPAT) LD_LIBRARY_PATH=$(URE_HOME)/lib java \
68            -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \
69            file://$(PWD)/out.pln/javanative.jar \
70            file://$(PWD)/out.pln/javanative.rc
71
72.PHONY: test-clientserver
73test-clientserver: out.pln/cppserver.uno.so out.pln/runner.jar \
74            out.pln/javaclient.jar
75	$(GCCS_COMPAT) $(URE_HOME)/bin/uno -c test.cpp.cppserver.Component \
76            -l file://$(PWD)/out.pln/cppserver.uno.so \
77            -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \
78            -ro $(URE_HOME)/share/misc/services.rdb \
79            -u 'uno:pipe,name=ure_test;urp;server' --singleaccept &
80	sleep 5 && \
81            java -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \
82            file://$(PWD)/out.pln/javaclient.jar \
83            'uno:pipe,name=ure_test;urp;server'
84
85
86.PHONY: clean
87clean:
88	rm -rf out.pln
89
90
91out.pln/cppmain.uno.so: out.pln/cppmain.o version.map | out.pln \
92            out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
93            out.pln/lib/libuno_sal.so out.pln/lib/libuno_salhelpergcc3.so \
94            out.pln/lib/libstlport_gcc.so
95	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
96            -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
97            -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3 -lstlport_gcc
98
99out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \
100            out.pln/types.cppumaker.flag | out.pln
101	g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
102            -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
103            -I out.pln/include/types -DCPPU_ENV=gcc3 \
104            -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
105
106
107out.pln/cpptest.uno.so: out.pln/cpptest.o version.map | out.pln \
108            out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
109            out.pln/lib/libuno_sal.so
110	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
111            -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
112            -luno_cppuhelpergcc3 -luno_sal
113
114out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \
115            out.pln/types.cppumaker.flag | out.pln
116	g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
117            -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
118            -I out.pln/include/types -DCPPU_ENV=gcc3 \
119            -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
120
121
122out.pln/cppserver.uno.so: out.pln/cppserver.o version.map | out.pln \
123            out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
124            out.pln/lib/libuno_sal.so
125	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
126            -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
127            -luno_cppuhelpergcc3 -luno_sal
128
129out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \
130            out.pln/types.cppumaker.flag | out.pln
131	g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
132            -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
133            -I out.pln/include/types -DCPPU_ENV=gcc3 \
134            -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
135
136
137out.pln/cpputypes.cppumaker.flag: | out.pln
138	LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
139            -O./out.pln/include/cpputypes \
140            '-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' \
141            -B/UCR $(URE_HOME)/share/misc/types.rdb
142	touch $@
143
144out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln
145	LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
146            -O./out.pln/include/types -B/UCR $< \
147            -X$(URE_HOME)/share/misc/types.rdb
148	touch $@
149
150
151out.pln/javamain.uno.jar: \
152            out.pln/class/javamain/test/java/javamain/JavaMain.class \
153            out.pln/javamain.mf | out.pln
154	jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test
155
156out.pln/javamain.mf: javamain.mf.template | out.pln
157	sed -e 's~^Class-Path:$$~& tester.jar~' \
158            -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
159
160out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \
161            out.pln/tester.jar | out.pln/class
162	rm -rf out.pln/class/javamain
163	mkdir out.pln/class/javamain
164	javac -classpath \
165            $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \
166            -sourcepath . -d out.pln/class/javamain $<
167
168
169out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \
170            out.pln/runner.mf | out.pln
171	jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test
172
173out.pln/runner.mf: runner.mf.template | out.pln
174	sed -e \
175            's~^Class-Path:$$~& file://$(URE_HOME)/share/java/unoloader.jar~' \
176            -e 's~^UNO-Type-Path:$$~& ~' $< > $@
177
178out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class
179	rm -rf out.pln/class/runner
180	mkdir out.pln/class/runner
181	javac -classpath $(URE_HOME)/share/java/unoloader.jar -sourcepath . \
182            -d out.pln/class/runner $<
183
184
185out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \
186            out.pln/tester.mf | out.pln
187	jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test
188
189out.pln/tester.mf: tester.mf.template | out.pln
190	sed -e 's~^Class-Path:$$~& types.jar~' \
191            -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
192
193out.pln/class/tester/test/java/tester/Tester.class: Tester.java \
194            out.pln/types.jar | out.pln/class
195	rm -rf out.pln/class/tester
196	mkdir out.pln/class/tester
197	javac -classpath $(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
198            -sourcepath . -d out.pln/class/tester $<
199
200
201out.pln/javatest.uno.jar: \
202            out.pln/class/javatest/test/java/javatest/JavaTest.class \
203            out.pln/javatest.mf | out.pln
204	jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test
205
206out.pln/javatest.mf: javatest.mf.template | out.pln
207	sed -e 's~^Class-Path:$$~& types.jar~' \
208            -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
209
210out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \
211            out.pln/types.jar | out.pln/class
212	rm -rf out.pln/class/javatest
213	mkdir out.pln/class/javatest
214	javac -classpath \
215            $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
216            -sourcepath . -d out.pln/class/javatest $<
217
218
219out.pln/javanative.jar: \
220            out.pln/class/javanative/test/java/javanative/JavaNative.class \
221            out.pln/javanative.mf | out.pln
222	jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test
223
224out.pln/javanative.mf: javanative.mf.template | out.pln
225	sed -e 's~^Class-Path:$$~& tester.jar~' \
226            -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
227
228out.pln/class/javanative/test/java/javanative/JavaNative.class: \
229            JavaNative.java out.pln/tester.jar | out.pln/class
230	rm -rf out.pln/class/javanative
231	mkdir out.pln/class/javanative
232	javac -classpath \
233            $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \
234            -sourcepath . -d out.pln/class/javanative $<
235
236out.pln/javanative.rc: | out.pln
237	echo 'URE_INTERNAL_LIB_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_LIB_DIR}' > $@
238	echo 'URE_INTERNAL_JAVA_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_JAVA_DIR}' >> $@
239	echo 'UNO_TYPES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_TYPES} file://$(PWD)/out.pln/types.rdb' >> $@
240	echo 'UNO_SERVICES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_SERVICES} file://$(PWD)/out.pln/services.rdb' >> $@
241
242
243out.pln/javaclient.jar: \
244            out.pln/class/javaclient/test/java/javaclient/JavaClient.class \
245            out.pln/javaclient.mf | out.pln
246	jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test
247
248out.pln/javaclient.mf: javaclient.mf.template | out.pln
249	sed -e 's~^Class-Path:$$~& types.jar~' \
250            -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@
251
252out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \
253            JavaClient.java out.pln/types.jar | out.pln/class
254	rm -rf out.pln/class/javaclient
255	mkdir out.pln/class/javaclient
256	javac -classpath \
257            $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \
258            -sourcepath . -d out.pln/class/javaclient $<
259
260
261out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln
262	jar cfm $@ out.pln/types.mf -C out.pln/class/types test
263
264out.pln/types.mf: types.mf.template | out.pln
265	sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@
266
267out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class
268	rm -rf out.pln/class/types
269	LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/javamaker \
270            -O./out.pln/class/types -B/UCR $< -X$(URE_HOME)/share/misc/types.rdb
271	touch $@
272
273
274out.pln/types.rdb: out.pln/types.urd | out.pln
275	$(URE_HOME)/bin/regmerge $@ /UCR $<
276
277out.pln/types.urd: types.idl | out.pln
278	LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/idlc -O$(@D) \
279            -I$(SDK_HOME)/idl -cid -we $<
280
281
282out.pln/services.rdb: out.pln/cpptest.uno.so out.pln/javatest.uno.jar | out.pln
283	rm -f $@
284	$(URE_HOME)/bin/regcomp -register -r $@ \
285            -c file://$(PWD)/out.pln/cpptest.uno.so
286	$(URE_HOME)/bin/regcomp -register \
287            -br $(URE_HOME)/share/misc/types.rdb \
288            -br $(URE_HOME)/share/misc/services.rdb -r $@ \
289            -c file://$(PWD)/out.pln/javatest.uno.jar
290
291
292out.pln/lib/libuno_cppu.so: | out.pln/lib
293	ln -fs $(URE_HOME)/lib/libuno_cppu.so.3 $@
294
295out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib
296	ln -fs $(URE_HOME)/lib/libuno_cppuhelpergcc3.so.3 $@
297
298out.pln/lib/libuno_sal.so: | out.pln/lib
299	ln -fs $(URE_HOME)/lib/libuno_sal.so.3 $@
300
301out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib
302	ln -fs $(URE_HOME)/lib/libuno_salhelpergcc3.so.3 $@
303
304out.pln/lib/libstlport_gcc.so: | out.pln/lib
305	ln -fs $(URE_HOME)/lib/libstlport_gcc.so $@
306
307
308out.pln:
309	mkdir $@
310
311out.pln/class: | out.pln
312	mkdir $@
313
314out.pln/lib: | out.pln
315	mkdir $@
316