Update to m13
[ooovba.git] / pyuno / zipcore / makefile.mk
blob6b808202c7b38c58278d63a9ebd762f3b8cf88d4
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
11 # $Revision: 1.14 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 PRJNAME=pyuno
33 PRJ=..
35 TARGET=zipcore
36 LIBTARGET=NO
38 .INCLUDE : settings.mk
40 UWINAPILIB =
42 .IF "$(SYSTEM_PYTHON)" == "YES" || "$(GUI)" == "OS2"
43 systempython:
44 @echo "Not building python-core because system python is being used"
45 .ELSE
47 .INCLUDE : pyversion.mk
49 PYDIRNAME=python-core-$(PYVERSION)
50 DESTROOT=$(BIN)$/$(PYDIRNAME)
51 .IF "$(GUI)" == "UNX"
52 PYTHONBINARY=$(BIN)$/python$(EXECPOST).bin
53 .ELSE
54 PYTHONBINARY=$(DESTROOT)$/bin$/python$(EXECPOST)
55 .ENDIF
57 FINDLIBFILES_TMP:=$(subst,/,$/ \
58 $(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v .pyc |$(GREP) -v .py\~ |$(GREP) -v .orig ))
59 FINDLIBFILES=$(subst,$(SOLARLIBDIR)$/python, $(FINDLIBFILES_TMP))
61 FILES=\
62 $(PYTHONBINARY) \
63 $(foreach,i,$(FINDLIBFILES) $(DESTROOT)$/lib$(i))
65 .IF "$(OS)" == "WNT"
66 APP1TARGET = python
67 APP1OBJS = $(OBJFILES) $(SOLARLIBDIR)$/pathutils-obj.obj
68 APP1STDLIBS =
69 APP1RPATH = BRAND
70 OBJFILES = $(OBJ)$/python.obj
71 .ENDIF
73 .INCLUDE: target.mk
75 ALLTAR: \
76 $(BIN)$/$(PYDIRNAME).zip
78 .IF "$(GUI)" == "UNX"
79 ALLTAR : $(BIN)$/python.sh
80 $(BIN)$/python.sh : python.sh
81 -rm -f $@
82 cat $? > $@
83 sed 's/%%PYVERSION%%/$(PYVERSION)/g' < $@ > $@.new
84 mv $@.new $@
85 chmod +x $@
86 .ENDIF
88 $(OBJ)$/python.obj: $(OUT)$/inc$/pyversion.hxx
90 $(OUT)$/inc$/pyversion.hxx: pyversion.inc
91 $(SED) $(USQ)s/@/$(PYVERSION)/g$(USQ) < $< > $@
93 $(BIN)$/$(PYDIRNAME).zip : $(FILES)
94 .IF "$(GUI)" == "UNX"
95 .IF "$(OS)" != "MACOSX"
96 cd $(DESTROOT) && find . -name '*$(DLLPOST)' | xargs strip
97 .ENDIF
98 .ENDIF
99 -rm -f $@
100 cd $(BIN) && zip -r $(PYDIRNAME).zip $(PYDIRNAME)
102 $(DESTROOT)$/lib$/% : $(SOLARLIBDIR)$/python$/%
103 -$(MKDIRHIER) $(@:d)
104 -rm -f $@
105 cat $< > $@
107 .IF "$(GUI)"== "UNX"
108 $(BIN)$/python$(EXECPOST).bin : $(SOLARBINDIR)$/python$(EXECPOST)
109 -$(MKDIRHIER) $(@:d)
110 -rm -f $@
111 cat $< > $@
112 .IF "$(OS)" != "MACOSX"
113 strip $@
114 .ENDIF
115 chmod +x $@
116 .ELSE
117 $(DESTROOT)$/bin$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST)
118 -$(MKDIRHIER) $(@:d)
119 -rm -f $@
120 cat $< > $@
121 .ENDIF
123 .ENDIF