jl165 merging heads
[LibreOffice.git] / testtools / source / bridgetest / pyuno / makefile.mk
blobded3cdbc7931f5e4d0487405ae6c71ca3e2283a4
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 PRJ=..$/..$/..
30 PRJNAME=pyuno
31 TARGET=test
32 LIBTARGET=NO
33 TARGETTYPE=CUI
34 ENABLE_EXCEPTIONS=TRUE
36 my_components = pythonloader
38 # --- Settings -----------------------------------------------------
40 .INCLUDE : settings.mk
41 # --- Files --------------------------------------------------------
42 .IF "$(L10N_framework)"==""
43 PYEXC=$(DLLDEST)$/python$(EXECPOST)
44 REGEXC=$(DLLDEST)$/regcomp$(EXECPOST)
46 .IF "$(SYSTEM_PYTHON)"!="YES"
47 PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python
48 .ELSE # "$(SYSTEM_PYTHON)"!="YES"
49 PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python
50 .ENDIF # "$(SYSTEM_PYTHON)"!="YES"
51 .IF "$(GUI)"=="WNT"
52 PYTHONPATH:=$(SOLARLIBDIR)$/pyuno;$(PWD);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload
53 .ELSE # "$(GUI)"=="WNT"
54 PYTHONPATH:=$(SOLARLIBDIR)$/pyuno:$(PWD):$(SOLARLIBDIR):$(SOLARLIBDIR)$/python:$(SOLARLIBDIR)$/python$/lib-dynload
55 .ENDIF # "$(GUI)"=="WNT"
56 .EXPORT: PYTHONPATH
58 .IF "$(GUI)"!="WNT" && "$(GUI)"!="OS2"
59 TEST_ENV=export FOO=file://$(shell @pwd)$/$(DLLDEST) \
60 UNO_TYPES=uno_types.rdb UNO_SERVICES=pyuno_services.rdb
61 .ELSE # "$(GUI)" != "WNT"
62 # aaaaaa, how to get the current working directory on windows ???
63 CWD_TMP=$(strip $(shell @echo "import os;print os.getcwd()" | $(PYTHON)))
64 TEST_ENV=export FOO=file:///$(strip $(subst,\,/ $(CWD_TMP)$/$(DLLDEST))) && \
65 export UNO_TYPES=uno_types.rdb && export UNO_SERVICES=pyuno_services.rdb
66 .ENDIF # "$(GUI)"!="WNT"
67 PYFILES = \
68 $(DLLDEST)$/core.py \
69 $(DLLDEST)$/importer.py \
70 $(DLLDEST)$/main.py \
71 $(DLLDEST)$/impl.py \
72 $(DLLDEST)$/samplecomponent.py \
73 $(DLLDEST)$/testcomp.py \
75 PYCOMPONENTS = \
76 samplecomponent
78 ALL : \
79 $(PYFILES) \
80 $(DLLDEST)/pyuno_services.rdb \
81 doc \
82 ALLTAR
83 .ENDIF # L10N_framework
85 .INCLUDE : target.mk
86 .IF "$(L10N_framework)"==""
87 $(DLLDEST)$/%.py: %.py
88 cp $? $@
90 $(DLLDEST)$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST)
91 cp $? $@
93 $(DLLDEST)$/regcomp$(EXECPOST) : $(SOLARBINDIR)$/regcomp$(EXECPOST)
94 cp $? $@
96 $(DLLDEST)$/pyuno_services.rdb .ERRREMOVE : \
97 $(SOLARENV)/bin/packcomponents.xslt $(MISC)/pyuno_services.input \
98 $(my_components:^"$(SOLARXMLDIR)/":+".component")
99 $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
100 $(SOLARENV)/bin/packcomponents.xslt $(MISC)/pyuno_services.input
102 $(MISC)/pyuno_services.input :
103 echo \
104 '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
105 > $@
107 doc .PHONY:
108 @echo start test with dmake runtest
110 runtest : ALL
111 cd $(DLLDEST) && $(TEST_ENV) && $(PYTHON) main.py
112 .ENDIF # L10N_framework