merged tag ooo/DEV300_m102
[LibreOffice.git] / pyuno / zipcore / makefile.mk
blob06241da2bfdbcd4b7c23328ceff6c66e2ebed6f9
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 PRJNAME=pyuno
29 PRJ=..
31 TARGET=zipcore
32 LIBTARGET=NO
34 .INCLUDE : settings.mk
35 .IF "$(L10N_framework)"==""
36 UWINAPILIB =
38 .IF "$(SYSTEM_PYTHON)" == "YES" || "$(GUI)" == "OS2"
39 systempython:
40 @echo "Not building python-core because system python is being used"
41 .ELSE
43 .INCLUDE : pyversion.mk
45 PYDIRNAME=python-core-$(PYVERSION)
46 DESTROOT=$(BIN)$/$(PYDIRNAME)
47 .IF "$(GUI)" == "UNX"
48 PYTHONBINARY=$(BIN)$/python$(EXECPOST).bin
49 .ELSE
50 .IF "$(COM)" == "GCC"
51 PYTHONBINARY=$(DESTROOT)$/bin$/python.bin
52 .ELSE
53 PYTHONBINARY=$(DESTROOT)$/bin$/python$(EXECPOST)
54 .ENDIF
55 .ENDIF
57 FINDLIBFILES_TMP:=$(subst,/,$/ \
58 $(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v "\.pyc" |$(GREP) -v "\.py~" |$(GREP) -v .orig | $(GREP) -v _failed))
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
74 .INCLUDE: target.mk
76 ALLTAR: \
77 $(BIN)$/$(PYDIRNAME).zip
79 .IF "$(GUI)" == "UNX"
80 ALLTAR : $(BIN)$/python.sh
81 $(BIN)$/python.sh : python.sh
82 -rm -f $@
83 cat $? > $@
84 sed 's/%%PYVERSION%%/$(PYVERSION)/g' < $@ > $@.new
85 mv $@.new $@
86 chmod +x $@
87 .ENDIF
89 $(OBJ)$/python.obj: $(OUT)$/inc$/pyversion.hxx
91 $(OUT)$/inc$/pyversion.hxx: pyversion.inc
92 $(SED) $(USQ)s/@/$(PYVERSION)/g$(USQ) < $< > $@
94 $(BIN)$/$(PYDIRNAME).zip : $(FILES)
95 .IF "$(GUI)" == "UNX"
96 .IF "$(OS)" != "MACOSX"
97 cd $(DESTROOT) && find . -name '*$(DLLPOST)' | xargs strip
98 .ENDIF
99 .ENDIF
100 -rm -f $@
101 cd $(BIN) && zip -r $(PYDIRNAME).zip $(PYDIRNAME)
103 $(DESTROOT)$/lib$/% : $(SOLARLIBDIR)$/python$/%
104 -$(MKDIRHIER) $(@:d)
105 -rm -f $@
106 cat $< > $@
108 .IF "$(GUI)"== "UNX"
109 $(BIN)$/python$(EXECPOST).bin : $(SOLARBINDIR)$/python$(EXECPOST)
110 -$(MKDIRHIER) $(@:d)
111 -rm -f $@
112 cat $< > $@
113 .IF "$(OS)" != "MACOSX"
114 strip $@
115 .ENDIF
116 chmod +x $@
117 .ELSE
118 .IF "$(COM)" == "GCC"
119 $(DESTROOT)$/bin$/python.bin : $(SOLARBINDIR)$/python$(EXECPOST)
120 .ELSE
121 $(DESTROOT)$/bin$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST)
122 .ENDIF
123 -$(MKDIRHIER) $(@:d)
124 -rm -f $@
125 cat $< > $@
126 .ENDIF
128 .ENDIF
129 .ELSE
130 ivo:
131 $(ECHO)
132 .ENDIF # L10N_framework