17871dc3eSAndrew Rist#************************************************************** 27871dc3eSAndrew Rist# 37871dc3eSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 47871dc3eSAndrew Rist# or more contributor license agreements. See the NOTICE file 57871dc3eSAndrew Rist# distributed with this work for additional information 67871dc3eSAndrew Rist# regarding copyright ownership. The ASF licenses this file 77871dc3eSAndrew Rist# to you under the Apache License, Version 2.0 (the 87871dc3eSAndrew Rist# "License"); you may not use this file except in compliance 97871dc3eSAndrew Rist# with the License. You may obtain a copy of the License at 107871dc3eSAndrew Rist# 117871dc3eSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 127871dc3eSAndrew Rist# 137871dc3eSAndrew Rist# Unless required by applicable law or agreed to in writing, 147871dc3eSAndrew Rist# software distributed under the License is distributed on an 157871dc3eSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 167871dc3eSAndrew Rist# KIND, either express or implied. See the License for the 177871dc3eSAndrew Rist# specific language governing permissions and limitations 187871dc3eSAndrew Rist# under the License. 197871dc3eSAndrew Rist# 207871dc3eSAndrew Rist#************************************************************** 217871dc3eSAndrew Rist 227871dc3eSAndrew 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 57*0a45483eSPedro GiffuniFINDINCFILES_TMP:=$(subst,/,$/ \ 58*0a45483eSPedro Giffuni $(shell @$(FIND) $(SOLARINCDIR)$/python -type f| $(GREP) -v "\.h~" | $(GREP) -v _failed)) 59*0a45483eSPedro GiffuniFINDINCFILES=$(subst,$(SOLARINCDIR)$/python, $(FINDINCFILES_TMP)) 60*0a45483eSPedro Giffuni 61cdf0e10cSrcweirFILES=\ 62cdf0e10cSrcweir $(PYTHONBINARY) \ 63*0a45483eSPedro Giffuni $(foreach,i,$(FINDLIBFILES) $(DESTROOT)$/lib$(i)) \ 64*0a45483eSPedro Giffuni $(foreach,i,$(FINDINCFILES) $(DESTROOT)$/include$/python$(PYMAJOR).$(PYMINOR)$(i)) 65cdf0e10cSrcweir 66cdf0e10cSrcweir.IF "$(OS)" == "WNT" 67cdf0e10cSrcweirAPP1TARGET = python 68cdf0e10cSrcweirAPP1OBJS = $(OBJFILES) $(SOLARLIBDIR)$/pathutils-obj.obj 69cdf0e10cSrcweirAPP1STDLIBS = 70cdf0e10cSrcweirAPP1RPATH = BRAND 71cdf0e10cSrcweirOBJFILES = $(OBJ)$/python.obj 72cdf0e10cSrcweir.ENDIF 73cdf0e10cSrcweir 74cdf0e10cSrcweir 75cdf0e10cSrcweir.INCLUDE: target.mk 76cdf0e10cSrcweir 77cdf0e10cSrcweirALLTAR: \ 78cdf0e10cSrcweir $(BIN)$/$(PYDIRNAME).zip 79cdf0e10cSrcweir 80cdf0e10cSrcweir.IF "$(GUI)" == "UNX" 81cdf0e10cSrcweirALLTAR : $(BIN)$/python.sh 82cdf0e10cSrcweir$(BIN)$/python.sh : python.sh 83cdf0e10cSrcweir -rm -f $@ 84cdf0e10cSrcweir cat $? > $@ 85cdf0e10cSrcweir sed 's/%%PYVERSION%%/$(PYVERSION)/g' < $@ > $@.new 86cdf0e10cSrcweir mv $@.new $@ 87cdf0e10cSrcweir chmod +x $@ 88cdf0e10cSrcweir.ENDIF 89cdf0e10cSrcweir 90cdf0e10cSrcweir$(OBJ)$/python.obj: $(OUT)$/inc$/pyversion.hxx 91cdf0e10cSrcweir 92cdf0e10cSrcweir$(OUT)$/inc$/pyversion.hxx: pyversion.inc 93cdf0e10cSrcweir $(SED) $(USQ)s/@/$(PYVERSION)/g$(USQ) < $< > $@ 94cdf0e10cSrcweir 95cdf0e10cSrcweir$(BIN)$/$(PYDIRNAME).zip : $(FILES) 96cdf0e10cSrcweir.IF "$(GUI)" == "UNX" 97cdf0e10cSrcweir.IF "$(OS)" != "MACOSX" 98cdf0e10cSrcweir cd $(DESTROOT) && find . -name '*$(DLLPOST)' | xargs strip 99cdf0e10cSrcweir.ENDIF 100cdf0e10cSrcweir.ENDIF 101cdf0e10cSrcweir -rm -f $@ 102cdf0e10cSrcweir cd $(BIN) && zip -r $(PYDIRNAME).zip $(PYDIRNAME) 103cdf0e10cSrcweir 104cdf0e10cSrcweir$(DESTROOT)$/lib$/% : $(SOLARLIBDIR)$/python$/% 105cdf0e10cSrcweir -$(MKDIRHIER) $(@:d) 106cdf0e10cSrcweir -rm -f $@ 107cdf0e10cSrcweir cat $< > $@ 108cdf0e10cSrcweir 109*0a45483eSPedro Giffuni$(DESTROOT)$/include$/python$(PYMAJOR).$(PYMINOR)%: $(SOLARINCDIR)$/python$/% 110*0a45483eSPedro Giffuni -$(MKDIRHIER) $(@:d) 111*0a45483eSPedro Giffuni -rm -f $@ 112*0a45483eSPedro Giffuni cat $< > $@ 113*0a45483eSPedro Giffuni 114cdf0e10cSrcweir.IF "$(GUI)"== "UNX" 115cdf0e10cSrcweir$(BIN)$/python$(EXECPOST).bin : $(SOLARBINDIR)$/python$(EXECPOST) 116cdf0e10cSrcweir -$(MKDIRHIER) $(@:d) 117cdf0e10cSrcweir -rm -f $@ 118cdf0e10cSrcweir cat $< > $@ 119cdf0e10cSrcweir.IF "$(OS)" != "MACOSX" 120cdf0e10cSrcweir strip $@ 121cdf0e10cSrcweir.ENDIF 122cdf0e10cSrcweir chmod +x $@ 123cdf0e10cSrcweir.ELSE 124cdf0e10cSrcweir.IF "$(COM)" == "GCC" 125cdf0e10cSrcweir$(DESTROOT)$/bin$/python.bin : $(SOLARBINDIR)$/python$(EXECPOST) 126cdf0e10cSrcweir.ELSE 127cdf0e10cSrcweir$(DESTROOT)$/bin$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST) 128cdf0e10cSrcweir.ENDIF 129cdf0e10cSrcweir -$(MKDIRHIER) $(@:d) 130cdf0e10cSrcweir -rm -f $@ 131cdf0e10cSrcweir cat $< > $@ 132cdf0e10cSrcweir.ENDIF 133cdf0e10cSrcweir 134cdf0e10cSrcweir.ENDIF 135cdf0e10cSrcweir.ELSE 136cdf0e10cSrcweirivo: 137cdf0e10cSrcweir $(ECHO) 138cdf0e10cSrcweir.ENDIF # L10N_framework 139