xref: /trunk/main/testtools/source/bridgetest/pyuno/makefile.mk (revision 07bf101f834a97b3f151039891fd55b8274bbfc4)
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
23
24PRJ=..$/..$/..
25
26PRJNAME=pyuno
27TARGET=test
28LIBTARGET=NO
29TARGETTYPE=CUI
30ENABLE_EXCEPTIONS=TRUE
31
32my_components = component/pyuno/source/loader/pythonloader
33
34# --- Settings -----------------------------------------------------
35
36.INCLUDE :  settings.mk
37# --- Files --------------------------------------------------------
38.IF "$(L10N_framework)"==""
39PYEXC=$(DLLDEST)$/python$(EXECPOST)
40REGEXC=$(DLLDEST)$/regcomp$(EXECPOST)
41
42.IF "$(SYSTEM_PYTHON)"!="YES"
43PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python
44.ELSE                   # "$(SYSTEM_PYTHON)"!="YES"
45# PYTHON_BIN is the interpreter configure located and checked against the
46# 3.11 floor; fall back to PATH only if the environment does not carry it.
47.IF "$(PYTHON_BIN)"==""
48PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python3
49.ELSE                   # "$(PYTHON_BIN)"==""
50PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(PYTHON_BIN)
51.ENDIF                  # "$(PYTHON_BIN)"==""
52.ENDIF                  # "$(SYSTEM_PYTHON)"!="YES"
53.IF "$(GUI)"=="WNT"
54PYTHONPATH:=$(SOLARLIBDIR)$/pyuno;$(PWD);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload
55.ELSE                   # "$(GUI)"=="WNT"
56PYTHONPATH:=$(SOLARLIBDIR)$/pyuno:$(PWD):$(SOLARLIBDIR):$(SOLARLIBDIR)$/python:$(SOLARLIBDIR)$/python$/lib-dynload
57.ENDIF                  # "$(GUI)"=="WNT"
58.EXPORT: PYTHONPATH
59
60.IF "$(GUI)"!="WNT" && "$(GUI)"!="OS2"
61TEST_ENV=export FOO=file://$(shell @pwd)$/$(DLLDEST) \
62    UNO_TYPES=uno_types.rdb UNO_SERVICES=pyuno_services.rdb
63.ELSE # "$(GUI)" != "WNT"
64# aaaaaa, how to get the current working directory on windows ???
65CWD_TMP=$(strip $(shell @echo "import os;print os.getcwd()" | $(PYTHON)))
66TEST_ENV=export FOO=file:///$(strip $(subst,\,/ $(CWD_TMP)$/$(DLLDEST))) && \
67        export UNO_TYPES=uno_types.rdb && export UNO_SERVICES=pyuno_services.rdb
68.ENDIF  # "$(GUI)"!="WNT"
69PYFILES = \
70    $(DLLDEST)$/core.py         \
71    $(DLLDEST)$/importer.py         \
72    $(DLLDEST)$/main.py         \
73    $(DLLDEST)$/impl.py         \
74    $(DLLDEST)$/samplecomponent.py      \
75    $(DLLDEST)$/testcomp.py         \
76
77PYCOMPONENTS = \
78    samplecomponent
79
80ALL :   \
81    $(PYFILES)              \
82    $(DLLDEST)/pyuno_services.rdb \
83    doc                 \
84    ALLTAR
85.ENDIF # L10N_framework
86
87.INCLUDE :  target.mk
88.IF "$(L10N_framework)"==""
89$(DLLDEST)$/%.py: %.py
90    cp $? $@
91
92$(DLLDEST)$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST)
93    cp $? $@
94
95$(DLLDEST)$/regcomp$(EXECPOST) : $(SOLARBINDIR)$/regcomp$(EXECPOST)
96    cp $? $@
97
98$(DLLDEST)$/pyuno_services.rdb .ERRREMOVE : \
99        $(SOLARENV)/bin/packcomponents.xslt $(MISC)/pyuno_services.input \
100        $(my_components:^"$(SOLARXMLDIR)/":+".component")
101    $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
102        $(SOLARENV)/bin/packcomponents.xslt $(MISC)/pyuno_services.input
103
104$(MISC)/pyuno_services.input :
105    echo \
106        '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
107        > $@
108
109doc .PHONY:
110    @echo start test with  dmake runtest
111
112runtest : ALL
113    cd $(DLLDEST) && $(TEST_ENV) && $(PYTHON) main.py
114.ENDIF # L10N_framework
115