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#GXX_INCLUDE_PATH := /usr/include/g++ 28 29 30URE_HOME ?= /opt/openoffice.org/ure 31GXX_INCLUDE_PATH ?= /usr/include/g++ 32 33.DELETE_ON_ERROR: 34 35 36.PHONY: test 37test: test-regview test-cpptest test-javatest test-javanative test-clientserver 38 39.PHONY: test-regview 40test-regview: out.pln/services.rdb 41 $(URE_HOME)/bin/regview $< > /dev/null 42 43.PHONY: test-cpptest 44test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb 45 $(URE_HOME)/bin/uno \ 46 -c test.cpp.cppmain.Component -l file://$(PWD)/$< \ 47 -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \ 48 -ro $(URE_HOME)/share/misc/services.rdb -ro out.pln/services.rdb 49 50.PHONY: test-javatest 51test-javatest: out.pln/javamain.uno.jar out.pln/types.rdb out.pln/services.rdb 52 $(URE_HOME)/bin/uno \ 53 -c test.java.javamain.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-javanative 58test-javanative: out.pln/runner.jar out.pln/javanative.jar \ 59 out.pln/javanative.rc out.pln/services.rdb out.pln/types.rdb 60 LD_LIBRARY_PATH=$(URE_HOME)/lib java \ 61 -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \ 62 file://$(PWD)/out.pln/javanative.jar \ 63 file://$(PWD)/out.pln/javanative.rc 64 65.PHONY: test-clientserver 66test-clientserver: out.pln/cppserver.uno.so out.pln/runner.jar \ 67 out.pln/javaclient.jar 68 $(URE_HOME)/bin/uno -c test.cpp.cppserver.Component \ 69 -l file://$(PWD)/out.pln/cppserver.uno.so \ 70 -ro $(URE_HOME)/share/misc/types.rdb -ro out.pln/types.rdb \ 71 -ro $(URE_HOME)/share/misc/services.rdb \ 72 -u 'uno:pipe,name=ure_test;urp;server' --singleaccept & 73 sleep 5 && \ 74 java -jar out.pln/runner.jar file://$(URE_HOME)/share/java/ \ 75 file://$(PWD)/out.pln/javaclient.jar \ 76 'uno:pipe,name=ure_test;urp;server' 77 78 79.PHONY: clean 80clean: 81 rm -rf out.pln 82 83 84out.pln/cppmain.uno.so: out.pln/cppmain.o version.map | out.pln \ 85 out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \ 86 out.pln/lib/libuno_sal.so out.pln/lib/libuno_salhelpergcc3.so 87 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \ 88 -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \ 89 -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3 90 91out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \ 92 out.pln/types.cppumaker.flag | out.pln 93 g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \ 94 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \ 95 -I out.pln/include/types -DCPPU_ENV=gcc3 \ 96 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $< 97 98 99out.pln/cpptest.uno.so: out.pln/cpptest.o version.map | out.pln \ 100 out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \ 101 out.pln/lib/libuno_sal.so 102 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \ 103 -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \ 104 -luno_cppuhelpergcc3 -luno_sal 105 106out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \ 107 out.pln/types.cppumaker.flag | out.pln 108 g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \ 109 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \ 110 -I out.pln/include/types -DCPPU_ENV=gcc3 \ 111 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $< 112 113 114out.pln/cppserver.uno.so: out.pln/cppserver.o version.map | out.pln \ 115 out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \ 116 out.pln/lib/libuno_sal.so 117 g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \ 118 -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \ 119 -luno_cppuhelpergcc3 -luno_sal 120 121out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \ 122 out.pln/types.cppumaker.flag | out.pln 123 g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \ 124 -I $(SDK_HOME)/include -I out.pln/include/cpputypes \ 125 -I out.pln/include/types -DCPPU_ENV=gcc3 \ 126 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $< 127 128 129out.pln/cpputypes.cppumaker.flag: | out.pln 130 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \ 131 -O./out.pln/include/cpputypes \ 132 '-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' \ 133 -B/UCR $(URE_HOME)/share/misc/types.rdb 134 touch $@ 135 136out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln 137 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \ 138 -O./out.pln/include/types -B/UCR $< \ 139 -X$(URE_HOME)/share/misc/types.rdb 140 touch $@ 141 142 143out.pln/javamain.uno.jar: \ 144 out.pln/class/javamain/test/java/javamain/JavaMain.class \ 145 out.pln/javamain.mf | out.pln 146 jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test 147 148out.pln/javamain.mf: javamain.mf.template | out.pln 149 sed -e 's~^Class-Path:$$~& tester.jar~' \ 150 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 151 152out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \ 153 out.pln/tester.jar | out.pln/class 154 rm -rf out.pln/class/javamain 155 mkdir out.pln/class/javamain 156 javac -classpath \ 157 $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \ 158 -sourcepath . -d out.pln/class/javamain $< 159 160 161out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \ 162 out.pln/runner.mf | out.pln 163 jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test 164 165out.pln/runner.mf: runner.mf.template | out.pln 166 sed -e \ 167 's~^Class-Path:$$~& file://$(URE_HOME)/share/java/unoloader.jar~' \ 168 -e 's~^UNO-Type-Path:$$~& ~' $< > $@ 169 170out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class 171 rm -rf out.pln/class/runner 172 mkdir out.pln/class/runner 173 javac -classpath $(URE_HOME)/share/java/unoloader.jar -sourcepath . \ 174 -d out.pln/class/runner $< 175 176 177out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \ 178 out.pln/tester.mf | out.pln 179 jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test 180 181out.pln/tester.mf: tester.mf.template | out.pln 182 sed -e 's~^Class-Path:$$~& types.jar~' \ 183 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 184 185out.pln/class/tester/test/java/tester/Tester.class: Tester.java \ 186 out.pln/types.jar | out.pln/class 187 rm -rf out.pln/class/tester 188 mkdir out.pln/class/tester 189 javac -classpath $(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \ 190 -sourcepath . -d out.pln/class/tester $< 191 192 193out.pln/javatest.uno.jar: \ 194 out.pln/class/javatest/test/java/javatest/JavaTest.class \ 195 out.pln/javatest.mf | out.pln 196 jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test 197 198out.pln/javatest.mf: javatest.mf.template | out.pln 199 sed -e 's~^Class-Path:$$~& types.jar~' \ 200 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 201 202out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \ 203 out.pln/types.jar | out.pln/class 204 rm -rf out.pln/class/javatest 205 mkdir out.pln/class/javatest 206 javac -classpath \ 207 $(URE_HOME)/share/java/jurt.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \ 208 -sourcepath . -d out.pln/class/javatest $< 209 210 211out.pln/javanative.jar: \ 212 out.pln/class/javanative/test/java/javanative/JavaNative.class \ 213 out.pln/javanative.mf | out.pln 214 jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test 215 216out.pln/javanative.mf: javanative.mf.template | out.pln 217 sed -e 's~^Class-Path:$$~& tester.jar~' \ 218 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 219 220out.pln/class/javanative/test/java/javanative/JavaNative.class: \ 221 JavaNative.java out.pln/tester.jar | out.pln/class 222 rm -rf out.pln/class/javanative 223 mkdir out.pln/class/javanative 224 javac -classpath \ 225 $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/tester.jar \ 226 -sourcepath . -d out.pln/class/javanative $< 227 228out.pln/javanative.rc: | out.pln 229 echo 'URE_INTERNAL_LIB_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_LIB_DIR}' > $@ 230 echo 'URE_INTERNAL_JAVA_DIR=$${file\u003A//$(URE_HOME)/lib/unorc:URE_INTERNAL_JAVA_DIR}' >> $@ 231 echo 'UNO_TYPES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_TYPES} file://$(PWD)/out.pln/types.rdb' >> $@ 232 echo 'UNO_SERVICES=$${file\u003A//$(URE_HOME)/lib/unorc:UNO_SERVICES} file://$(PWD)/out.pln/services.rdb' >> $@ 233 234 235out.pln/javaclient.jar: \ 236 out.pln/class/javaclient/test/java/javaclient/JavaClient.class \ 237 out.pln/javaclient.mf | out.pln 238 jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test 239 240out.pln/javaclient.mf: javaclient.mf.template | out.pln 241 sed -e 's~^Class-Path:$$~& types.jar~' \ 242 -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ 243 244out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \ 245 JavaClient.java out.pln/types.jar | out.pln/class 246 rm -rf out.pln/class/javaclient 247 mkdir out.pln/class/javaclient 248 javac -classpath \ 249 $(URE_HOME)/share/java/juh.jar:$(URE_HOME)/share/java/ridl.jar:out.pln/types.jar \ 250 -sourcepath . -d out.pln/class/javaclient $< 251 252 253out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln 254 jar cfm $@ out.pln/types.mf -C out.pln/class/types test 255 256out.pln/types.mf: types.mf.template | out.pln 257 sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@ 258 259out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class 260 rm -rf out.pln/class/types 261 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/javamaker \ 262 -O./out.pln/class/types -B/UCR $< -X$(URE_HOME)/share/misc/types.rdb 263 touch $@ 264 265 266out.pln/types.rdb: out.pln/types.urd | out.pln 267 $(URE_HOME)/bin/regmerge $@ /UCR $< 268 269out.pln/types.urd: types.idl | out.pln 270 LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/idlc -O$(@D) \ 271 -I$(SDK_HOME)/idl -cid -we $< 272 273 274out.pln/services.rdb: out.pln/cpptest.uno.so out.pln/javatest.uno.jar | out.pln 275 rm -f $@ 276 $(URE_HOME)/bin/regcomp -register -r $@ \ 277 -c file://$(PWD)/out.pln/cpptest.uno.so 278 $(URE_HOME)/bin/regcomp -register \ 279 -br $(URE_HOME)/share/misc/types.rdb \ 280 -br $(URE_HOME)/share/misc/services.rdb -r $@ \ 281 -c file://$(PWD)/out.pln/javatest.uno.jar 282 283 284out.pln/lib/libuno_cppu.so: | out.pln/lib 285 ln -fs $(URE_HOME)/lib/libuno_cppu.so.3 $@ 286 287out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib 288 ln -fs $(URE_HOME)/lib/libuno_cppuhelpergcc3.so.3 $@ 289 290out.pln/lib/libuno_sal.so: | out.pln/lib 291 ln -fs $(URE_HOME)/lib/libuno_sal.so.3 $@ 292 293out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib 294 ln -fs $(URE_HOME)/lib/libuno_salhelpergcc3.so.3 $@ 295 296 297out.pln: 298 mkdir $@ 299 300out.pln/class: | out.pln 301 mkdir $@ 302 303out.pln/lib: | out.pln 304 mkdir $@ 305