xref: /aoo41x/main/pyuno/zipcore/makefile.mk (revision 7871dc3e)
1*7871dc3eSAndrew Rist#**************************************************************
2*7871dc3eSAndrew Rist#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*7871dc3eSAndrew Rist#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*7871dc3eSAndrew Rist#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19*7871dc3eSAndrew Rist#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJNAME=pyuno
25cdf0e10cSrcweirPRJ=..
26cdf0e10cSrcweir
27cdf0e10cSrcweirTARGET=zipcore
28cdf0e10cSrcweirLIBTARGET=NO
29cdf0e10cSrcweir
30cdf0e10cSrcweir.INCLUDE : settings.mk
31cdf0e10cSrcweir.IF "$(L10N_framework)"==""
32cdf0e10cSrcweirUWINAPILIB =
33cdf0e10cSrcweir
34cdf0e10cSrcweir.IF "$(SYSTEM_PYTHON)" == "YES" || "$(GUI)" == "OS2"
35cdf0e10cSrcweirsystempython:
36cdf0e10cSrcweir        @echo "Not building python-core because system python is being used"
37cdf0e10cSrcweir.ELSE
38cdf0e10cSrcweir
39cdf0e10cSrcweir.INCLUDE : pyversion.mk
40cdf0e10cSrcweir
41cdf0e10cSrcweirPYDIRNAME=python-core-$(PYVERSION)
42cdf0e10cSrcweirDESTROOT=$(BIN)$/$(PYDIRNAME)
43cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
44cdf0e10cSrcweirPYTHONBINARY=$(BIN)$/python$(EXECPOST).bin
45cdf0e10cSrcweir.ELSE
46cdf0e10cSrcweir.IF "$(COM)" == "GCC"
47cdf0e10cSrcweirPYTHONBINARY=$(DESTROOT)$/bin$/python.bin
48cdf0e10cSrcweir.ELSE
49cdf0e10cSrcweirPYTHONBINARY=$(DESTROOT)$/bin$/python$(EXECPOST)
50cdf0e10cSrcweir.ENDIF
51cdf0e10cSrcweir.ENDIF
52cdf0e10cSrcweir
53cdf0e10cSrcweirFINDLIBFILES_TMP:=$(subst,/,$/ \
54cdf0e10cSrcweir	$(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v "\.pyc" |$(GREP) -v "\.py~" |$(GREP) -v .orig | $(GREP) -v _failed))
55cdf0e10cSrcweirFINDLIBFILES=$(subst,$(SOLARLIBDIR)$/python, $(FINDLIBFILES_TMP))
56cdf0e10cSrcweir
57cdf0e10cSrcweirFILES=\
58cdf0e10cSrcweir	$(PYTHONBINARY)	\
59cdf0e10cSrcweir	$(foreach,i,$(FINDLIBFILES) $(DESTROOT)$/lib$(i))
60cdf0e10cSrcweir
61cdf0e10cSrcweir.IF "$(OS)" == "WNT"
62cdf0e10cSrcweirAPP1TARGET = python
63cdf0e10cSrcweirAPP1OBJS = $(OBJFILES) $(SOLARLIBDIR)$/pathutils-obj.obj
64cdf0e10cSrcweirAPP1STDLIBS =
65cdf0e10cSrcweirAPP1RPATH = BRAND
66cdf0e10cSrcweirOBJFILES = $(OBJ)$/python.obj
67cdf0e10cSrcweir.ENDIF
68cdf0e10cSrcweir
69cdf0e10cSrcweir
70cdf0e10cSrcweir.INCLUDE: target.mk
71cdf0e10cSrcweir
72cdf0e10cSrcweirALLTAR: \
73cdf0e10cSrcweir	$(BIN)$/$(PYDIRNAME).zip
74cdf0e10cSrcweir
75cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
76cdf0e10cSrcweirALLTAR : $(BIN)$/python.sh
77cdf0e10cSrcweir$(BIN)$/python.sh : python.sh
78cdf0e10cSrcweir	-rm -f $@
79cdf0e10cSrcweir	cat $? > $@
80cdf0e10cSrcweir	sed 's/%%PYVERSION%%/$(PYVERSION)/g' < $@ > $@.new
81cdf0e10cSrcweir	mv $@.new $@
82cdf0e10cSrcweir	chmod +x $@
83cdf0e10cSrcweir.ENDIF
84cdf0e10cSrcweir
85cdf0e10cSrcweir$(OBJ)$/python.obj: $(OUT)$/inc$/pyversion.hxx
86cdf0e10cSrcweir
87cdf0e10cSrcweir$(OUT)$/inc$/pyversion.hxx: pyversion.inc
88cdf0e10cSrcweir    $(SED) $(USQ)s/@/$(PYVERSION)/g$(USQ) < $< > $@
89cdf0e10cSrcweir
90cdf0e10cSrcweir$(BIN)$/$(PYDIRNAME).zip : $(FILES)
91cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
92cdf0e10cSrcweir.IF "$(OS)" != "MACOSX"
93cdf0e10cSrcweir	cd $(DESTROOT) && find . -name '*$(DLLPOST)' | xargs strip
94cdf0e10cSrcweir.ENDIF
95cdf0e10cSrcweir.ENDIF
96cdf0e10cSrcweir	-rm -f $@
97cdf0e10cSrcweir	cd $(BIN) && zip -r $(PYDIRNAME).zip $(PYDIRNAME)
98cdf0e10cSrcweir
99cdf0e10cSrcweir$(DESTROOT)$/lib$/% : $(SOLARLIBDIR)$/python$/%
100cdf0e10cSrcweir	-$(MKDIRHIER) $(@:d)
101cdf0e10cSrcweir	-rm -f $@
102cdf0e10cSrcweir	cat $< > $@
103cdf0e10cSrcweir
104cdf0e10cSrcweir.IF "$(GUI)"== "UNX"
105cdf0e10cSrcweir$(BIN)$/python$(EXECPOST).bin : $(SOLARBINDIR)$/python$(EXECPOST)
106cdf0e10cSrcweir	-$(MKDIRHIER) $(@:d)
107cdf0e10cSrcweir	-rm -f $@
108cdf0e10cSrcweir	cat $< > $@
109cdf0e10cSrcweir.IF "$(OS)" != "MACOSX"
110cdf0e10cSrcweir	strip $@
111cdf0e10cSrcweir.ENDIF
112cdf0e10cSrcweir	chmod +x $@
113cdf0e10cSrcweir.ELSE
114cdf0e10cSrcweir.IF "$(COM)" == "GCC"
115cdf0e10cSrcweir$(DESTROOT)$/bin$/python.bin : $(SOLARBINDIR)$/python$(EXECPOST)
116cdf0e10cSrcweir.ELSE
117cdf0e10cSrcweir$(DESTROOT)$/bin$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST)
118cdf0e10cSrcweir.ENDIF
119cdf0e10cSrcweir	-$(MKDIRHIER) $(@:d)
120cdf0e10cSrcweir	-rm -f $@
121cdf0e10cSrcweir	cat $< > $@
122cdf0e10cSrcweir.ENDIF
123cdf0e10cSrcweir
124cdf0e10cSrcweir.ENDIF
125cdf0e10cSrcweir.ELSE
126cdf0e10cSrcweirivo:
127cdf0e10cSrcweir	$(ECHO)
128cdf0e10cSrcweir.ENDIF # L10N_framework
129