1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance 9# with the License. You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, 14# software distributed under the License is distributed on an 15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16# KIND, either express or implied. See the License for the 17# specific language governing permissions and limitations 18# under the License. 19# 20#************************************************************** 21 22# The following variable must be set (see README): 23#SDK_HOME := /opt/openoffice.org/basis3.1/sdk 24 25# The following variables can be set, if necessary (see README): 26#URE_HOME := /opt/openoffice.org/ure 27 28URE_HOME ?= /opt/openoffice.org/ure 29 30.DELETE_ON_ERROR: 31 32 33.PHONY: test 34test: test-regview test-cpptest test-javatest test-javanative test-clientserver 35 36.PHONY: test-regview 37test-regview: out.pln/services.rdb 38 $(URE_HOME)/bin/regview $< > /dev/null 39 40.PHONY: test-cpptest 41test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb 42 $(URE_HOME)/bin/uno \ 43 -c test.cpp.cppmain.Component -l file://$(PWD)/$< \ 44 -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \ 45 -ro $(URE_HOME)/share/misc/services.rdb -ro out.pln/services.rdb 46 47.PHONY: test-javatest 48test-javatest: out.pln/javamain.uno.jar out.pln/types.rdb out.pln/services.rdb 49 $(URE_HOME)/bin/uno \ 50 -c test.java.javamain.Component -l file://$(PWD)/$< \ 51 -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \ 52 -ro $(URE_HOME)/share/misc/services.rdb -ro out.pln/services.rdb 53 54.PHONY: test-javanative 55test-javanative: out.pln/runner.jar out.pln/javanative.jar \ 56 out.pln/javanative.rc out.pln/services.rdb out.pln/types.rdb 57 LD_LIBRARY_PATH=$(URE_HOME)/lib java \ 58 -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \ 59 file://$(PWD)/out.pln/javanative.jar \ 60 file://$(PWD)/out.pln/javanative.rc 61 62.PHONY: test-clientserver 63test-clientserver: out.pln/cppserver.uno.so out.pln/runner.jar \ 64 out.pln/javaclient.jar 65 $(URE_HOME)/bin/uno -c test.cpp.cppserver.Component \ 66 -l file://$(PWD)/out.pln/cppserver.uno.so \ 67 -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \ 68 -ro $(URE_HOME)/share/misc/services.rdb \ 69 -u 'uno:pipe,name=ure_test;urp;server' --singleaccept & 70 sleep 5 && \ 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' 74 75 76.PHONY: clean 77clean: 78 rm -rf out.pln 79 80 81out.pln/cppmain.uno.so: out.pln/cppmain.o version.map | out.pln \ 82 out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \ 83 out.pln/lib/libuno_sal.so out.pln/lib/libuno_salhelpergcc3.so 84 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \ 85 -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \ 86 -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3 87 88out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \ 89 out.pln/types.cppumaker.flag | out.pln 90 g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \ 91 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \ 92 -I out.pln/include/types -DCPPU_ENV=gcc3 \ 93 -DLINUX -DUNX $< 94 95 96out.pln/cpptest.uno.so: out.pln/cpptest.o version.map | out.pln \ 97 out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \ 98 out.pln/lib/libuno_sal.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 102 103out.pln/cpptest.o: cpptest.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 -DLINUX -DUNX $< 109 110 111out.pln/cppserver.uno.so: out.pln/cppserver.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 117 118out.pln/cppserver.o: cppserver.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 -DLINUX -DUNX $< 124 125 126out.pln/cpputypes.cppumaker.flag: | out.pln 127 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \ 128 -O./out.pln/include/cpputypes \ 129 '-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' \ 130 -B/UCR $(URE_HOME)/share/misc/types.rdb 131 touch $@ 132 133out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln 134 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \ 135 -O./out.pln/include/types -B/UCR $< \ 136 -X$(URE_HOME)/share/misc/types.rdb 137 touch $@ 138 139 140out.pln/javamain.uno.jar: \ 141 out.pln/class/javamain/test/java/javamain/JavaMain.class \ 142 out.pln/javamain.mf | out.pln 143 jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test 144 145out.pln/javamain.mf: javamain.mf.template | out.pln 146 sed -e 's~^Class-Path:$$~& tester.jar~' \ 147 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 148 149out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \ 150 out.pln/tester.jar | out.pln/class 151 rm -rf out.pln/class/javamain 152 mkdir out.pln/class/javamain 153 javac -classpath \ 154 $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \ 155 -sourcepath . -d out.pln/class/javamain $< 156 157 158out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \ 159 out.pln/runner.mf | out.pln 160 jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test 161 162out.pln/runner.mf: runner.mf.template | out.pln 163 sed -e \ 164 's~^Class-Path:$$~& file://$(URE_HOME)/share/java/unoloader.jar~' \ 165 -e 's~^UNO-Type-Path:$$~& ~' $< > $@ 166 167out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class 168 rm -rf out.pln/class/runner 169 mkdir out.pln/class/runner 170 javac -classpath $(URE_HOME)/share/java/unoloader.jar -sourcepath . \ 171 -d out.pln/class/runner $< 172 173 174out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \ 175 out.pln/tester.mf | out.pln 176 jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test 177 178out.pln/tester.mf: tester.mf.template | out.pln 179 sed -e 's~^Class-Path:$$~& types.jar~' \ 180 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 181 182out.pln/class/tester/test/java/tester/Tester.class: Tester.java \ 183 out.pln/types.jar | out.pln/class 184 rm -rf out.pln/class/tester 185 mkdir out.pln/class/tester 186 javac -classpath $(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \ 187 -sourcepath . -d out.pln/class/tester $< 188 189 190out.pln/javatest.uno.jar: \ 191 out.pln/class/javatest/test/java/javatest/JavaTest.class \ 192 out.pln/javatest.mf | out.pln 193 jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test 194 195out.pln/javatest.mf: javatest.mf.template | out.pln 196 sed -e 's~^Class-Path:$$~& types.jar~' \ 197 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 198 199out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \ 200 out.pln/types.jar | out.pln/class 201 rm -rf out.pln/class/javatest 202 mkdir out.pln/class/javatest 203 javac -classpath \ 204 $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \ 205 -sourcepath . -d out.pln/class/javatest $< 206 207 208out.pln/javanative.jar: \ 209 out.pln/class/javanative/test/java/javanative/JavaNative.class \ 210 out.pln/javanative.mf | out.pln 211 jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test 212 213out.pln/javanative.mf: javanative.mf.template | out.pln 214 sed -e 's~^Class-Path:$$~& tester.jar~' \ 215 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 216 217out.pln/class/javanative/test/java/javanative/JavaNative.class: \ 218 JavaNative.java out.pln/tester.jar | out.pln/class 219 rm -rf out.pln/class/javanative 220 mkdir out.pln/class/javanative 221 javac -classpath \ 222 $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \ 223 -sourcepath . -d out.pln/class/javanative $< 224 225out.pln/javanative.rc: | out.pln 226 echo 'URE_INTERNAL_LIB_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_LIB_DIR}' > $@ 227 echo 'URE_INTERNAL_JAVA_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_JAVA_DIR}' >> $@ 228 echo 'UNO_TYPES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_TYPES} file://$(PWD)/out.pln/types.rdb' >> $@ 229 echo 'UNO_SERVICES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_SERVICES} file://$(PWD)/out.pln/services.rdb' >> $@ 230 231 232out.pln/javaclient.jar: \ 233 out.pln/class/javaclient/test/java/javaclient/JavaClient.class \ 234 out.pln/javaclient.mf | out.pln 235 jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test 236 237out.pln/javaclient.mf: javaclient.mf.template | out.pln 238 sed -e 's~^Class-Path:$$~& types.jar~' \ 239 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 240 241out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \ 242 JavaClient.java out.pln/types.jar | out.pln/class 243 rm -rf out.pln/class/javaclient 244 mkdir out.pln/class/javaclient 245 javac -classpath \ 246 $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \ 247 -sourcepath . -d out.pln/class/javaclient $< 248 249 250out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln 251 jar cfm $@ out.pln/types.mf -C out.pln/class/types test 252 253out.pln/types.mf: types.mf.template | out.pln 254 sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@ 255 256out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class 257 rm -rf out.pln/class/types 258 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/javamaker \ 259 -O./out.pln/class/types -B/UCR $< -X$(URE_HOME)/share/misc/types.rdb 260 touch $@ 261 262 263out.pln/types.rdb: out.pln/types.urd | out.pln 264 $(URE_HOME)/bin/regmerge $@ /UCR $< 265 266out.pln/types.urd: types.idl | out.pln 267 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/idlc -O$(@D) \ 268 -I$(SDK_HOME)/idl -cid -we $< 269 270 271out.pln/services.rdb: out.pln/cpptest.uno.so out.pln/javatest.uno.jar | out.pln 272 rm -f $@ 273 $(URE_HOME)/bin/regcomp -register -r $@ \ 274 -c file://$(PWD)/out.pln/cpptest.uno.so 275 $(URE_HOME)/bin/regcomp -register \ 276 -br $(URE_HOME)/share/misc/types.rdb \ 277 -br $(URE_HOME)/share/misc/services.rdb -r $@ \ 278 -c file://$(PWD)/out.pln/javatest.uno.jar 279 280 281out.pln/lib/libuno_cppu.so: | out.pln/lib 282 ln -fs $(URE_HOME)/lib/libuno_cppu.so.3 $@ 283 284out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib 285 ln -fs $(URE_HOME)/lib/libuno_cppuhelpergcc3.so.3 $@ 286 287out.pln/lib/libuno_sal.so: | out.pln/lib 288 ln -fs $(URE_HOME)/lib/libuno_sal.so.3 $@ 289 290out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib 291 ln -fs $(URE_HOME)/lib/libuno_salhelpergcc3.so.3 $@ 292 293 294out.pln: 295 mkdir $@ 296 297out.pln/class: | out.pln 298 mkdir $@ 299 300out.pln/lib: | out.pln 301 mkdir $@ 302