xref: /aoo41x/main/pyuno/demo/makefile.mk (revision d71964d5)
1*d71964d5SAndrew Rist# *************************************************************
2*d71964d5SAndrew Rist#
3*d71964d5SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*d71964d5SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*d71964d5SAndrew Rist#  distributed with this work for additional information
6*d71964d5SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*d71964d5SAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*d71964d5SAndrew Rist#  "License"); you may not use this file except in compliance
9*d71964d5SAndrew Rist#  with the License.  You may obtain a copy of the License at
10*d71964d5SAndrew Rist#
11*d71964d5SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*d71964d5SAndrew Rist#
13*d71964d5SAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*d71964d5SAndrew Rist#  software distributed under the License is distributed on an
15*d71964d5SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d71964d5SAndrew Rist#  KIND, either express or implied.  See the License for the
17*d71964d5SAndrew Rist#  specific language governing permissions and limitations
18*d71964d5SAndrew Rist#  under the License.
19*d71964d5SAndrew Rist#
20*d71964d5SAndrew Rist# *************************************************************
21cdf0e10cSrcweirPRJNAME=pyuno
22cdf0e10cSrcweirPRJ=..
23cdf0e10cSrcweir
24cdf0e10cSrcweir.INCLUDE : settings.mk
25cdf0e10cSrcweir.INCLUDE : pyversion.mk
26cdf0e10cSrcweir
27cdf0e10cSrcweirROOT=$(MISC)$/pyuno-doc
28cdf0e10cSrcweir
29cdf0e10cSrcweir
30cdf0e10cSrcweirFILES=\
31cdf0e10cSrcweir	$(ROOT)$/python-bridge.html 		\
32cdf0e10cSrcweir	$(ROOT)$/customized_setup.png 		\
33cdf0e10cSrcweir	$(ROOT)$/mode_component.png 		\
34cdf0e10cSrcweir	$(ROOT)$/mode_ipc.png			\
35cdf0e10cSrcweir	$(ROOT)$/modes.sxd			\
36cdf0e10cSrcweir	$(ROOT)$/optional_components.png       	\
37cdf0e10cSrcweir	$(ROOT)$/samples$/swriter.py		\
38cdf0e10cSrcweir	$(ROOT)$/samples$/swritercomp.py	\
39cdf0e10cSrcweir	$(ROOT)$/samples$/ooextract.py		\
40cdf0e10cSrcweir	$(ROOT)$/samples$/biblioaccess.py	\
41cdf0e10cSrcweir	$(ROOT)$/samples$/swritercompclient.py	\
42cdf0e10cSrcweir	$(ROOT)$/samples$/hello_world_pyuno.zip
43cdf0e10cSrcweir
44cdf0e10cSrcweir
45cdf0e10cSrcweir
46cdf0e10cSrcweir$(MISC)$/pyuno-doc.zip : dirs $(FILES)
47cdf0e10cSrcweir	-rm -f $@
48cdf0e10cSrcweir	cd $(MISC) && zip -r pyuno-doc.zip pyuno-doc
49cdf0e10cSrcweirdirs .PHONY :
50cdf0e10cSrcweir	-mkdir $(ROOT)
51cdf0e10cSrcweir	-mkdir $(ROOT)$/samples
52cdf0e10cSrcweir
53cdf0e10cSrcweir
54cdf0e10cSrcweir$(ROOT)$/samples$/hello_world_pyuno.zip : hello_world_comp.py Addons.xcu
55cdf0e10cSrcweir	-rm -f $@
56cdf0e10cSrcweir	zip $@ hello_world_comp.py Addons.xcu
57cdf0e10cSrcweir
58cdf0e10cSrcweir$(ROOT)$/samples$/% : %
59cdf0e10cSrcweir	-rm -f $@
60cdf0e10cSrcweir	cat $? > $@
61cdf0e10cSrcweir
62cdf0e10cSrcweir$(ROOT)$/% : ..$/doc$/%
63cdf0e10cSrcweir	-rm -f $@
64cdf0e10cSrcweir	cat $? > $@
65cdf0e10cSrcweir
66cdf0e10cSrcweir#VERSION=0.9.4
67cdf0e10cSrcweir#PYDIRNAME=python-$(PYVERSION)
68cdf0e10cSrcweir#.IF "$(GUI)"=="WNT"
69cdf0e10cSrcweir#INISUFFIX=.ini
70cdf0e10cSrcweir#BATCHSUFFIX=.bat
71cdf0e10cSrcweir#ENVSUFFIX=.bat
72cdf0e10cSrcweir#PLATFORM=win32
73cdf0e10cSrcweir#EXESUFFIX=.exe
74cdf0e10cSrcweir#PACKSUFFIX=.zip
75cdf0e10cSrcweir#MYCOPY=copy
76cdf0e10cSrcweir#DOLLAR_SIGN=$$
77cdf0e10cSrcweir#.ELSE
78cdf0e10cSrcweir#DOLLAR_SIGN=\$$
79cdf0e10cSrcweir#PACKSUFFIX=.tar.gz
80cdf0e10cSrcweir#MYCOPY=cp
81cdf0e10cSrcweir#BATCHSUFFIX=.sh
82cdf0e10cSrcweir#ENVSUFFIX=.tcsh
83cdf0e10cSrcweir#INISUFFIX=rc
84cdf0e10cSrcweir#PYUNOMODULE=$(DESTROOT)$/program$/pyuno$(DLLPOST)
85cdf0e10cSrcweir#PYTHONLIBRARY=$(DESTROOT)$/program$/$(DLLPRE)python$(DLLPOST).$(PYVERSION)
86cdf0e10cSrcweir#PYRUNTIMELINK=$(DESTROOT)$/program$/python
87cdf0e10cSrcweir#PYRUNTIMELIBLINK1=$(DESTROOT)$/program$/libpython.so.2
88cdf0e10cSrcweir#PYRUNTIMELIBLINK2=$(DESTROOT)$/program$/libpython.so
89cdf0e10cSrcweir#
90cdf0e10cSrcweir#.IF "$(OS)$(CPU)"=="SOLARISS"
91cdf0e10cSrcweir#PLATFORM=solaris-sparc
92cdf0e10cSrcweir#.ELIF "$(OS)$(CPU)"=="SOLARISI"
93cdf0e10cSrcweir#PLATFORM=solaris-x86
94cdf0e10cSrcweir#.ELIF "$(OS)$(CPU)"=="LINUXI"
95cdf0e10cSrcweir#PLATFORM=linux-x86
96cdf0e10cSrcweir#.ELIF "$(OS)$(CPU)"=="LINUXP"
97cdf0e10cSrcweir#PLATFORM=linux-ppc
98cdf0e10cSrcweir#.ELSE
99cdf0e10cSrcweir#error please add your platform
100cdf0e10cSrcweir#.ENDIF
101cdf0e10cSrcweir#
102cdf0e10cSrcweir#.ENDIF
103cdf0e10cSrcweir#
104cdf0e10cSrcweir#DESTROOT=$(BIN)$/root
105cdf0e10cSrcweir#
106cdf0e10cSrcweir#FINDDIRS=$(subst,/,$/ $(shell +cd $(SOLARLIBDIR)$/python && $(FIND) . -type d))
107cdf0e10cSrcweir#FINDLIBFILES=$(subst,/,$/ $(shell +cd $(SOLARLIBDIR)$/python && $(FIND) . -type f))
108cdf0e10cSrcweir#
109cdf0e10cSrcweir#PYRUNTIME_DIRS=\
110cdf0e10cSrcweir#	$(DESTROOT)				\
111cdf0e10cSrcweir#	$(DESTROOT)$/program			\
112cdf0e10cSrcweir#	$(DESTROOT)$/program/pydemo		\
113cdf0e10cSrcweir#	$(DESTROOT)$/program$/$(PYDIRNAME) 	\
114cdf0e10cSrcweir#	$(DESTROOT)$/program$/$(PYDIRNAME)$/bin 	\
115cdf0e10cSrcweir#	$(DESTROOT)$/program$/$(PYDIRNAME)$/lib 	\
116cdf0e10cSrcweir#	$(foreach,i,$(FINDDIRS) $(DESTROOT)$/program$/$(PYDIRNAME)$/lib$/$(i))
117cdf0e10cSrcweir#
118cdf0e10cSrcweir#
119cdf0e10cSrcweir#FILES=\
120cdf0e10cSrcweir#	$(DESTROOT)$/program$/$(DLLPRE)pyuno$(DLLPOST) 		\
121cdf0e10cSrcweir#	$(DESTROOT)$/program$/pythonloader.uno$(DLLPOST)	\
122cdf0e10cSrcweir#	$(DESTROOT)$/program$/pyuno$(INISUFFIX)			\
123cdf0e10cSrcweir#	$(DESTROOT)$/program$/uno.py				\
124cdf0e10cSrcweir#	$(DESTROOT)$/program$/unohelper.py			\
125cdf0e10cSrcweir#	$(DESTROOT)$/program$/pythonloader.py			\
126cdf0e10cSrcweir#	$(DESTROOT)$/program$/pyuno_setup$(BATCHSUFFIX)		\
127cdf0e10cSrcweir#	$(DESTROOT)$/program$/regcomp$(EXESUFFIX)		\
128cdf0e10cSrcweir#	$(DESTROOT)$/program$/pyunoenv$(ENVSUFFIX)		\
129cdf0e10cSrcweir#	$(DESTROOT)$/program$/pydemo$/biblioaccess.py		\
130cdf0e10cSrcweir#	$(DESTROOT)$/program$/pydemo$/ooextract.py		\
131cdf0e10cSrcweir#	$(DESTROOT)$/program$/pydemo$/swriter.py		\
132cdf0e10cSrcweir#	$(DESTROOT)$/program$/pydemo$/swritercomp.py		\
133cdf0e10cSrcweir#	$(DESTROOT)$/program$/pydemo$/swritercompclient.py	\
134cdf0e10cSrcweir#	$(DESTROOT)$/program$/pydemo$/swritercompclient.py	\
135cdf0e10cSrcweir#	$(DESTROOT)$/program$/pydemo$/python-bridge.html	\
136cdf0e10cSrcweir#	$(PYUNOMODULE)						\
137cdf0e10cSrcweir#	$(PYTHONLIBRARY)					\
138cdf0e10cSrcweir#	$(DESTROOT)$/program$/$(PYDIRNAME)$/bin$/python$(EXESUFFIX)	\
139cdf0e10cSrcweir#	$(foreach,i,$(FINDLIBFILES) $(DESTROOT)$/program$/$(PYDIRNAME)$/lib$/$(i)) \
140cdf0e10cSrcweir#	$(PYRUNTIMELINK)					\
141cdf0e10cSrcweir#	$(PYRUNTIMELIBLINK1)					\
142cdf0e10cSrcweir#	$(PYRUNTIMELIBLINK2)
143cdf0e10cSrcweir#
144cdf0e10cSrcweir#
145cdf0e10cSrcweir#
146cdf0e10cSrcweir#$(BIN)$/pyuno-$(PLATFORM)-$(PYVERSION)$(PACKSUFFIX) : makefile.mk dirs $(FILES)
147cdf0e10cSrcweir#	-rm $@
148cdf0e10cSrcweir#.IF "$(GUI)"=="WNT"
149cdf0e10cSrcweir#	+cd $(DESTROOT) && zip -r ..$/pyuno-$(PLATFORM)-$(VERSION)$(PACKSUFFIX) program
150cdf0e10cSrcweir#.ELSE
151cdf0e10cSrcweir#	$(FIND) $(DESTROOT) -name '*.so' | xargs strip
152cdf0e10cSrcweir#	cd $(DESTROOT) && tar -cO program | gzip - > ..$/pyuno-$(PLATFORM)-$(VERSION)$(PACKSUFFIX)
153cdf0e10cSrcweir#.ENDIF
154cdf0e10cSrcweir#
155cdf0e10cSrcweir#
156cdf0e10cSrcweir#dirs .PHONY:
157cdf0e10cSrcweir#	-mkdir $(PYRUNTIME_DIRS)
158cdf0e10cSrcweir#
159cdf0e10cSrcweir## Some symbolic links for unix
160cdf0e10cSrcweir#.IF "$(GUI)" == "UNX"
161cdf0e10cSrcweir#$(PYRUNTIMELINK) : makefile.mk
162cdf0e10cSrcweir#	-rm -f $@
163cdf0e10cSrcweir#	cd $(DESTROOT)$/program && ln -s $(PYDIRNAME) python
164cdf0e10cSrcweir#
165cdf0e10cSrcweir#$(PYRUNTIMELIBLINK1) : makefile.mk
166cdf0e10cSrcweir#	-rm -f $@
167cdf0e10cSrcweir#	cd $(DESTROOT)$/program && ln -s $(DLLPRE)python$(DLLPOST).$(PYVERSION) $(DLLPRE)python$(DLLPOST).$(PYMAJOR)
168cdf0e10cSrcweir#
169cdf0e10cSrcweir#$(PYRUNTIMELIBLINK2) : makefile.mk
170cdf0e10cSrcweir#	-rm -f $@
171cdf0e10cSrcweir#	cd $(DESTROOT)$/program && ln -s $(DLLPRE)python$(DLLPOST).$(PYVERSION) $(DLLPRE)python$(DLLPOST)
172cdf0e10cSrcweir#.ENDIF
173cdf0e10cSrcweir#
174cdf0e10cSrcweir#$(DESTROOT)$/program$/regcomp$(EXESUFFIX) : $(SOLARBINDIR)$/regcomp$(EXESUFFIX)
175cdf0e10cSrcweir#	cp $? $@
176cdf0e10cSrcweir#.IF "$(GUI)" == "UNX"
177cdf0e10cSrcweir#	strip $@
178cdf0e10cSrcweir#	chmod +x $@
179cdf0e10cSrcweir#.ENDIF
180cdf0e10cSrcweir#
181cdf0e10cSrcweir#
182cdf0e10cSrcweir#$(DESTROOT)$/program$/pyunoenv$(ENVSUFFIX) : pyunoenv$(ENVSUFFIX)
183cdf0e10cSrcweir#	-rm -f $@
184cdf0e10cSrcweir#	cat $? > $@
185cdf0e10cSrcweir#
186cdf0e10cSrcweir#$(DESTROOT)$/program$/$(DLLPRE)pyuno$(DLLPOST) : $(DLLDEST)$/$(DLLPRE)pyuno$(DLLPOST)
187cdf0e10cSrcweir#	cp $? $@
188cdf0e10cSrcweir#
189cdf0e10cSrcweir#$(DESTROOT)$/program$/pyuno_setup$(BATCHSUFFIX) : makefile.mk
190cdf0e10cSrcweir#	-rm -f $@
191cdf0e10cSrcweir#.IF "$(GUI)"!="WNT"
192cdf0e10cSrcweir#	echo #\!/bin/sh >> $@
193cdf0e10cSrcweir#	chmod +x $@
194cdf0e10cSrcweir#.ENDIF
195cdf0e10cSrcweir#	echo regcomp -register -r services.rdb -c pythonloader.uno >>$@
196cdf0e10cSrcweir##	echo "$(MYCOPY) applicat.rdb pydemo$/applicat.rdb" >> $@
197cdf0e10cSrcweir#	echo regcomp -register -br types.rdb -br services.rdb -r services.rdb -c vnd.openoffice.pymodule:swritercomp -l com.sun.star.loader.Python >>$@
198cdf0e10cSrcweir#
199cdf0e10cSrcweir#$(DESTROOT)$/program$/$(DLLPRE)python$(DLLPOST).$(PYVERSION) : $(SOLARLIBDIR)$/$(DLLPRE)python$(DLLPOST).$(PYVERSION)
200cdf0e10cSrcweir#	cp $? $@
201cdf0e10cSrcweir#
202cdf0e10cSrcweir#$(DESTROOT)$/program$/pythonloader.uno$(DLLPOST) : $(DLLDEST)$/pythonloader.uno$(DLLPOST)
203cdf0e10cSrcweir#	cp $? $@
204cdf0e10cSrcweir#
205cdf0e10cSrcweir#$(DESTROOT)$/program$/%.py : $(DLLDEST)$/%.py
206cdf0e10cSrcweir#	cp $? $@
207cdf0e10cSrcweir#
208cdf0e10cSrcweir#.IF "$(GUI)" == "UNX"
209cdf0e10cSrcweir#$(DESTROOT)$/program$/pyuno$(DLLPOST) : $(DLLDEST)$/pyuno$(DLLPOST)
210cdf0e10cSrcweir#	cp $? $@
211cdf0e10cSrcweir#.ENDIF
212cdf0e10cSrcweir#
213cdf0e10cSrcweir#$(DESTROOT)$/program$/pydemo$/%.py : %.py
214cdf0e10cSrcweir#	-rm -f $@
215cdf0e10cSrcweir#	cat $? > $@
216cdf0e10cSrcweir#
217cdf0e10cSrcweir#$(DESTROOT)$/program$/pyuno$(INISUFFIX) : makefile.mk
218cdf0e10cSrcweir#	-rm -f $@ $(DESTROOT)$/program$/pyuno.tmp
219cdf0e10cSrcweir#	echo UNO_TYPES=$(DOLLAR_SIGN)PYUNOLIBDIR/types.rdb > $(DESTROOT)$/program$/pyuno.tmp
220cdf0e10cSrcweir#	echo UNO_SERVICES=$(DOLLAR_SIGN)PYUNOLIBDIR/services.rdb >> $(DESTROOT)$/program$/pyuno.tmp
221cdf0e10cSrcweir#	mv $(DESTROOT)$/program$/pyuno.tmp $@
222cdf0e10cSrcweir#
223cdf0e10cSrcweir#$(DESTROOT)$/program$/pydemo$/python-bridge.html : ..$/doc$/python-bridge.html
224cdf0e10cSrcweir#	-rm -f $@
225cdf0e10cSrcweir#	cat $? > $@
226cdf0e10cSrcweir#
227cdf0e10cSrcweir#
228cdf0e10cSrcweir# $(DESTROOT)$/program$/$(PYDIRNAME)$/lib$/%.so : $(SOLARLIBDIR)$/python$/%.so
229cdf0e10cSrcweir# 	-rm -f $@
230cdf0e10cSrcweir# 	cat $? > $@
231cdf0e10cSrcweir# 	strip $@
232cdf0e10cSrcweir#
233cdf0e10cSrcweir#$(DESTROOT)$/program$/$(PYDIRNAME)$/lib$/% : $(SOLARLIBDIR)$/python$/%
234cdf0e10cSrcweir#	-rm -f $@
235cdf0e10cSrcweir#	cat $? > $@
236cdf0e10cSrcweir#
237cdf0e10cSrcweir#
238cdf0e10cSrcweir#$(DESTROOT)$/program$/$(PYDIRNAME)$/bin$/python$(EXESUFFIX) : $(SOLARBINDIR)$/python$(EXESUFFIX)
239cdf0e10cSrcweir#	-rm -f $@
240cdf0e10cSrcweir#	cat $? > $@
241cdf0e10cSrcweir#.IF "$(GUI)" == "UNX"
242cdf0e10cSrcweir#	strip $@
243cdf0e10cSrcweir#	chmod +x $@
244cdf0e10cSrcweir#.ENDIF
245cdf0e10cSrcweir#
246cdf0e10cSrcweir#
247cdf0e10cSrcweir#
248cdf0e10cSrcweir#
249*d71964d5SAndrew Rist#
250