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