diff options
Diffstat (limited to 'ure/source/uretest/Makefile.pln')
-rw-r--r-- | ure/source/uretest/Makefile.pln | 283 |
1 files changed, 283 insertions, 0 deletions
diff --git a/ure/source/uretest/Makefile.pln b/ure/source/uretest/Makefile.pln new file mode 100644 index 000000000..3ea8c3482 --- /dev/null +++ b/ure/source/uretest/Makefile.pln @@ -0,0 +1,283 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# The following variable must be set (see README): +#SDK_HOME := /opt/libreoffice/basis3.1/sdk + +# The following variables can be set, if necessary (see README): +#URE_HOME := /opt/libreoffice +#GCCS_COMPAT := LD_PRELOAD=/lib/libgcc_s.so.1 + + +URE_HOME ?= /opt/libreoffice + +.DELETE_ON_ERROR: + + +.PHONY: check +check: test-regview test-cpptest test-javatest test-javanative test-clientserver + +.PHONY: test-regview +test-regview: out.pln/types.rdb + $(URE_HOME)/program/regview $< > /dev/null + +.PHONY: test-cpptest +test-cpptest: out.pln/cppmain.uno.so out.pln/types.rdb out.pln/services.rdb + $(GCCS_COMPAT) $(URE_HOME)/program/uno \ + -c test.cpp.cppmain.Component -l file://$(PWD)/$< \ + -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \ + -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb + +.PHONY: test-javatest +test-javatest: out.pln/javamain.uno.jar out.pln/types.rdb out.pln/services.rdb + $(GCCS_COMPAT) $(URE_HOME)/program/uno \ + -c test.java.javamain.Component -l file://$(PWD)/$< \ + -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \ + -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb + +.PHONY: test-javanative +test-javanative: out.pln/runner.jar out.pln/javanative.jar \ + out.pln/types.rdb out.pln/services.rdb + URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \ + URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb \ + $(GCCS_COMPAT) LD_LIBRARY_PATH=$(URE_HOME)/program java \ + -jar out.pln/runner.jar file://$(URE_HOME)/program/classes/ \ + file://$(PWD)/out.pln/javanative.jar + +.PHONY: test-clientserver +test-clientserver: out.pln/cppserver.uno.so out.pln/types.rdb \ + out.pln/services.rdb out.pln/runner.jar out.pln/javaclient.jar + $(GCCS_COMPAT) $(URE_HOME)/program/uno -c test.cpp.cppserver.Component \ + -l file://$(PWD)/out.pln/cppserver.uno.so \ + -env:URE_MORE_TYPES=file://$(PWD)/out.pln/types.rdb \ + -env:URE_MORE_SERVICES=file://$(PWD)/out.pln/services.rdb \ + -u 'uno:pipe,name=ure_test;urp;server' --singleaccept & + sleep 5 && \ + java -jar out.pln/runner.jar file://$(URE_HOME)/program/classes/ \ + file://$(PWD)/out.pln/javaclient.jar \ + 'uno:pipe,name=ure_test;urp;server' + + +.PHONY: clean +clean: + rm -rf out.pln + + +out.pln/cppmain.uno.so: out.pln/cppmain.o | out.pln out.pln/lib/libuno_cppu.so \ + out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so \ + out.pln/lib/libuno_salhelpergcc3.so + g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \ + -luno_cppu -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3 + +out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \ + out.pln/types.cppumaker.flag | out.pln + g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \ + -I $(SDK_HOME)/include -I out.pln/include/cpputypes \ + -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $< + + +out.pln/cpptest.uno.so: out.pln/cpptest.o | out.pln out.pln/lib/libuno_cppu.so \ + out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so + g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \ + -luno_cppu -luno_cppuhelpergcc3 -luno_sal + +out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \ + out.pln/types.cppumaker.flag | out.pln + g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \ + -I $(SDK_HOME)/include -I out.pln/include/cpputypes \ + -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $< + + +out.pln/cppserver.uno.so: out.pln/cppserver.o | out.pln \ + out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \ + out.pln/lib/libuno_sal.so + g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \ + -luno_cppu -luno_cppuhelpergcc3 -luno_sal + +out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \ + out.pln/types.cppumaker.flag | out.pln + g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \ + -I $(SDK_HOME)/include -I out.pln/include/cpputypes \ + -I out.pln/include/types -DCPPU_ENV=gcc3 -DLINUX -DUNX $< + + +out.pln/cpputypes.cppumaker.flag: | out.pln + LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/cppumaker \ + -O./out.pln/include/cpputypes \ + '-Tcom.sun.star.beans.Introspection;com.sun.star.beans.theIntrospection;com.sun.star.bridge.BridgeFactory;com.sun.star.bridge.UnoUrlResolver;com.sun.star.connection.Acceptor;com.sun.star.connection.Connector;com.sun.star.io.Pipe;com.sun.star.io.TextInputStream;com.sun.star.io.TextOutputStream;com.sun.star.java.JavaVirtualMachine;com.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.loader.Java;com.sun.star.loader.SharedLibrary;com.sun.star.reflection.ProxyFactory;com.sun.star.registry.ImplementationRegistration;com.sun.star.registry.SimpleRegistry;com.sun.star.registry.XRegistryKey;com.sun.star.script.Converter;com.sun.star.script.Invocation;com.sun.star.security.AccessController;com.sun.star.security.Policy;com.sun.star.uno.DeploymentException;com.sun.star.uno.Exception;com.sun.star.uno.NamingService;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;com.sun.star.uri.ExternalUriReferenceTranslator;com.sun.star.uri.UriReferenceFactory;com.sun.star.uri.VndSunStarPkgUrlReferenceFactory;com.sun.star.util.theMacroExpander' \ + $(URE_HOME)/program/types.rdb + touch $@ + +out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln + LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/cppumaker \ + -O./out.pln/include/types $< -X$(URE_HOME)/program/types.rdb + touch $@ + + +out.pln/javamain.uno.jar: \ + out.pln/class/javamain/test/java/javamain/JavaMain.class \ + out.pln/javamain.mf | out.pln + jar cfm $@ out.pln/javamain.mf -C out.pln/class/javamain test + +out.pln/javamain.mf: javamain.mf.template | out.pln + sed -e 's~^Class-Path:$$~& tester.jar~' \ + -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ + +out.pln/class/javamain/test/java/javamain/JavaMain.class: JavaMain.java \ + out.pln/tester.jar | out.pln/class + rm -rf out.pln/class/javamain + mkdir out.pln/class/javamain + javac -classpath \ + $(URE_HOME)/program/classes/libreoffice.jar:out.pln/tester.jar \ + -sourcepath . -d out.pln/class/javamain $< + + +out.pln/runner.jar: out.pln/class/runner/test/java/runner/Runner.class \ + out.pln/runner.mf | out.pln + jar cfm $@ out.pln/runner.mf -C out.pln/class/runner test + +out.pln/runner.mf: runner.mf.template | out.pln + sed -e \ + 's~^Class-Path:$$~& file://$(URE_HOME)/program/classes/unoloader.jar~' \ + -e 's~^UNO-Type-Path:$$~& ~' $< > $@ + +out.pln/class/runner/test/java/runner/Runner.class: Runner.java | out.pln/class + rm -rf out.pln/class/runner + mkdir out.pln/class/runner + javac -classpath $(URE_HOME)/program/classes/unoloader.jar \ + -sourcepath . -d out.pln/class/runner $< + + +out.pln/tester.jar: out.pln/class/tester/test/java/tester/Tester.class \ + out.pln/tester.mf | out.pln + jar cfm $@ out.pln/tester.mf -C out.pln/class/tester test + +out.pln/tester.mf: tester.mf.template | out.pln + sed -e 's~^Class-Path:$$~& types.jar~' \ + -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ + +out.pln/class/tester/test/java/tester/Tester.class: Tester.java \ + out.pln/types.jar | out.pln/class + rm -rf out.pln/class/tester + mkdir out.pln/class/tester + javac -classpath \ + $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \ + -sourcepath . -d out.pln/class/tester $< + + +out.pln/javatest.uno.jar: \ + out.pln/class/javatest/test/java/javatest/JavaTest.class \ + out.pln/javatest.mf | out.pln + jar cfm $@ out.pln/javatest.mf -C out.pln/class/javatest test + +out.pln/javatest.mf: javatest.mf.template | out.pln + sed -e 's~^Class-Path:$$~& types.jar~' \ + -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ + +out.pln/class/javatest/test/java/javatest/JavaTest.class: JavaTest.java \ + out.pln/types.jar | out.pln/class + rm -rf out.pln/class/javatest + mkdir out.pln/class/javatest + javac -classpath \ + $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \ + -sourcepath . -d out.pln/class/javatest $< + + +out.pln/javanative.jar: \ + out.pln/class/javanative/test/java/javanative/JavaNative.class \ + out.pln/javanative.mf | out.pln + jar cfm $@ out.pln/javanative.mf -C out.pln/class/javanative test + +out.pln/javanative.mf: javanative.mf.template | out.pln + sed -e 's~^Class-Path:$$~& tester.jar~' \ + -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ + +out.pln/class/javanative/test/java/javanative/JavaNative.class: \ + JavaNative.java out.pln/tester.jar | out.pln/class + rm -rf out.pln/class/javanative + mkdir out.pln/class/javanative + javac -classpath \ + $(URE_HOME)/program/classes/libreoffice.jar:out.pln/tester.jar \ + -sourcepath . -d out.pln/class/javanative $< + + +out.pln/javaclient.jar: \ + out.pln/class/javaclient/test/java/javaclient/JavaClient.class \ + out.pln/javaclient.mf | out.pln + jar cfm $@ out.pln/javaclient.mf -C out.pln/class/javaclient test + +out.pln/javaclient.mf: javaclient.mf.template | out.pln + sed -e 's~^Class-Path:$$~& types.jar~' \ + -e 's~^UNO-Type-Path:$$~& types.jar~' $< > $@ + +out.pln/class/javaclient/test/java/javaclient/JavaClient.class: \ + JavaClient.java out.pln/types.jar | out.pln/class + rm -rf out.pln/class/javaclient + mkdir out.pln/class/javaclient + javac -classpath \ + $(URE_HOME)/program/classes/libreoffice.jar:out.pln/types.jar \ + -sourcepath . -d out.pln/class/javaclient $< + + +out.pln/types.jar: out.pln/types.javamaker.flag out.pln/types.mf | out.pln + jar cfm $@ out.pln/types.mf -C out.pln/class/types test + +out.pln/types.mf: types.mf.template | out.pln + sed -e 's~^Class-Path:$$~& ~' -e 's~^UNO-Type-Path:$$~& \<\>~' $< > $@ + +out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class + rm -rf out.pln/class/types + LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/javamaker \ + -O./out.pln/class/types $< -X$(URE_HOME)/program/types.rdb + touch $@ + + +out.pln/types.rdb: out.pln/types.urd | out.pln + $(URE_HOME)/program/regmerge $@ /UCR $< + +out.pln/types.urd: types.idl | out.pln + LD_LIBRARY_PATH=$(URE_HOME)/program $(SDK_HOME)/bin/idlc -O$(@D) \ + -I$(SDK_HOME)/idl -cid -we $< + + +out.pln/services.rdb: services.rdb.in | out.pln/cpptest.uno.so \ + out.pln/javatest.uno.jar out.pln + sed -e s/@SHAREDLIB_EXT@/so/ < $^ > $@ + + +out.pln/lib/libuno_cppu.so: | out.pln/lib + ln -fs $(URE_HOME)/program/libuno_cppu.so.3 $@ + +out.pln/lib/libuno_cppuhelpergcc3.so: | out.pln/lib + ln -fs $(URE_HOME)/program/libuno_cppuhelpergcc3.so.3 $@ + +out.pln/lib/libuno_sal.so: | out.pln/lib + ln -fs $(URE_HOME)/program/libuno_sal.so.3 $@ + +out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib + ln -fs $(URE_HOME)/program/libuno_salhelpergcc3.so.3 $@ + + +out.pln: + mkdir $@ + +out.pln/class: | out.pln + mkdir $@ + +out.pln/lib: | out.pln + mkdir $@ |