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