1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
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.
14#
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).
20#
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.
25#
26#*************************************************************************
27
28PRJ=..$/..$/..
29
30PRJNAME=pyuno
31TARGET=test
32LIBTARGET=NO
33TARGETTYPE=CUI
34ENABLE_EXCEPTIONS=TRUE
35
36my_components = pythonloader
37
38# --- Settings -----------------------------------------------------
39
40.INCLUDE :  settings.mk
41# --- Files --------------------------------------------------------
42.IF "$(L10N_framework)"==""
43PYEXC=$(DLLDEST)$/python$(EXECPOST)
44REGEXC=$(DLLDEST)$/regcomp$(EXECPOST)
45
46.IF "$(SYSTEM_PYTHON)"!="YES"
47PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python
48.ELSE                   # "$(SYSTEM_PYTHON)"!="YES"
49PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python
50.ENDIF                  # "$(SYSTEM_PYTHON)"!="YES"
51.IF "$(GUI)"=="WNT"
52PYTHONPATH:=$(SOLARLIBDIR)$/pyuno;$(PWD);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload
53.ELSE                   # "$(GUI)"=="WNT"
54PYTHONPATH:=$(SOLARLIBDIR)$/pyuno:$(PWD):$(SOLARLIBDIR):$(SOLARLIBDIR)$/python:$(SOLARLIBDIR)$/python$/lib-dynload
55.ENDIF                  # "$(GUI)"=="WNT"
56.EXPORT: PYTHONPATH
57
58.IF "$(GUI)"!="WNT" && "$(GUI)"!="OS2"
59TEST_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 ???
63CWD_TMP=$(strip $(shell @echo "import os;print os.getcwd()" | $(PYTHON)))
64TEST_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"
67PYFILES = \
68	$(DLLDEST)$/core.py			\
69	$(DLLDEST)$/importer.py			\
70	$(DLLDEST)$/main.py			\
71	$(DLLDEST)$/impl.py			\
72	$(DLLDEST)$/samplecomponent.py		\
73	$(DLLDEST)$/testcomp.py			\
74
75PYCOMPONENTS = \
76	samplecomponent
77
78ALL : 	\
79	$(PYFILES)				\
80    $(DLLDEST)/pyuno_services.rdb \
81	doc					\
82	ALLTAR
83.ENDIF # L10N_framework
84
85.INCLUDE :  target.mk
86.IF "$(L10N_framework)"==""
87$(DLLDEST)$/%.py: %.py
88	cp $? $@
89
90$(DLLDEST)$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST)
91	cp $? $@
92
93$(DLLDEST)$/regcomp$(EXECPOST) : $(SOLARBINDIR)$/regcomp$(EXECPOST)
94	cp $? $@
95
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
101
102$(MISC)/pyuno_services.input :
103    echo \
104        '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
105        > $@
106
107doc .PHONY:
108	@echo start test with  dmake runtest
109
110runtest : ALL
111    cd $(DLLDEST) && $(TEST_ENV) && $(PYTHON) main.py
112.ENDIF # L10N_framework
113
114