1*cdf0e10cSrcweir#************************************************************************* 2*cdf0e10cSrcweir# 3*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir# 5*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir# 7*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir# 9*cdf0e10cSrcweir# This file is part of OpenOffice.org. 10*cdf0e10cSrcweir# 11*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir# only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir# 15*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir# 21*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir# version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir# <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir# for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir# 26*cdf0e10cSrcweir#************************************************************************* 27*cdf0e10cSrcweirPRJ=..$/.. 28*cdf0e10cSrcweir 29*cdf0e10cSrcweirPRJNAME=pyuno 30*cdf0e10cSrcweirTARGET=pyuno 31*cdf0e10cSrcweirENABLE_EXCEPTIONS=TRUE 32*cdf0e10cSrcweir 33*cdf0e10cSrcweirLINKFLAGSDEFS = # do not fail with missing symbols 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir# --- Settings ----------------------------------------------------- 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir.INCLUDE : settings.mk 38*cdf0e10cSrcweir.IF "$(L10N_framework)"=="" 39*cdf0e10cSrcweir#------------------------------------------------------------------- 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir.IF "$(OS)$(COMEX)" == "SOLARIS4" 42*cdf0e10cSrcweir# no -Bdirect for SunWS CC 43*cdf0e10cSrcweirDIRECT = $(LINKFLAGSDEFS) 44*cdf0e10cSrcweir.ENDIF 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir# special setting from environment 47*cdf0e10cSrcweir.IF "$(EXTRA_CFLAGS)"!="" 48*cdf0e10cSrcweirEXTRA_FRAMEWORK_FLAG=-framework Python 49*cdf0e10cSrcweir.ENDIF # .IF "$(EXTRA_CFLAGS)"!="" 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir.IF "$(GUI)" == "UNX" 52*cdf0e10cSrcweir# python expects modules without the lib prefix 53*cdf0e10cSrcweir# pyuno.so even on Mac OS X, because it is a python module 54*cdf0e10cSrcweirPYUNO_MODULE=$(DLLDEST)$/pyuno.so 55*cdf0e10cSrcweirPYUNORC=pyunorc 56*cdf0e10cSrcweir.ELIF "$(GUI)" == "OS2" 57*cdf0e10cSrcweir.INCLUDE : pyversion.mk 58*cdf0e10cSrcweirPYUNORC=pyuno.ini 59*cdf0e10cSrcweir.ELSE 60*cdf0e10cSrcweir.INCLUDE : pyversion.mk 61*cdf0e10cSrcweirPYUNORC=pyuno.ini 62*cdf0e10cSrcweirDLLPOST=.pyd 63*cdf0e10cSrcweir.ENDIF 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir.IF "$(SYSTEM_PYTHON)" == "YES" 66*cdf0e10cSrcweirPYTHONLIB=$(PYTHON_LIBS) 67*cdf0e10cSrcweirCFLAGS+=$(PYTHON_CFLAGS) 68*cdf0e10cSrcweir.ELSE # "$(SYSTEM_PYTHON)" == "YES" 69*cdf0e10cSrcweir.INCLUDE : pyversion.mk 70*cdf0e10cSrcweirCFLAGS+=-I$(SOLARINCDIR)$/python 71*cdf0e10cSrcweir.ENDIF # "$(SYSTEM_PYTHON)" == "YES" 72*cdf0e10cSrcweir 73*cdf0e10cSrcweirSHL1TARGET=$(TARGET) 74*cdf0e10cSrcweirSLOFILES= \ 75*cdf0e10cSrcweir $(SLO)$/pyuno_runtime.obj \ 76*cdf0e10cSrcweir $(SLO)$/pyuno.obj \ 77*cdf0e10cSrcweir $(SLO)$/pyuno_callable.obj \ 78*cdf0e10cSrcweir $(SLO)$/pyuno_module.obj \ 79*cdf0e10cSrcweir $(SLO)$/pyuno_type.obj \ 80*cdf0e10cSrcweir $(SLO)$/pyuno_util.obj \ 81*cdf0e10cSrcweir $(SLO)$/pyuno_except.obj \ 82*cdf0e10cSrcweir $(SLO)$/pyuno_adapter.obj \ 83*cdf0e10cSrcweir $(SLO)$/pyuno_gc.obj 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir# remove this, when issue i35064 is integrated 86*cdf0e10cSrcweir.IF "$(COM)"=="GCC" 87*cdf0e10cSrcweirNOOPTFILES= \ 88*cdf0e10cSrcweir $(SLO)$/pyuno_module.obj 89*cdf0e10cSrcweir.ENDIF # "$(COM)"=="GCC" 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir 92*cdf0e10cSrcweirSHL1STDLIBS= \ 93*cdf0e10cSrcweir $(CPPULIB) \ 94*cdf0e10cSrcweir $(CPPUHELPERLIB) \ 95*cdf0e10cSrcweir $(SALLIB) \ 96*cdf0e10cSrcweir $(PYTHONLIB) \ 97*cdf0e10cSrcweir $(EXTRA_FRAMEWORK_FLAG) 98*cdf0e10cSrcweir 99*cdf0e10cSrcweirSHL1DEPN= 100*cdf0e10cSrcweirSHL1LIBS=$(SLB)$/$(TARGET).lib 101*cdf0e10cSrcweirSHL1IMPLIB=i$(TARGET) 102*cdf0e10cSrcweir 103*cdf0e10cSrcweirSHL1DEF= $(MISC)$/$(SHL1TARGET).def 104*cdf0e10cSrcweir 105*cdf0e10cSrcweirDEF1NAME= $(SHL1TARGET) 106*cdf0e10cSrcweirDEF1DEPN= $(MISC)$/pyuno.flt 107*cdf0e10cSrcweir 108*cdf0e10cSrcweirDEFLIB1NAME=$(TARGET) 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir# --- Targets ------------------------------------------------------ 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir.IF "$(GUI)$(COM)"=="WNTGCC" 113*cdf0e10cSrcweirALLTAR : \ 114*cdf0e10cSrcweir $(DLLDEST)$/uno.py \ 115*cdf0e10cSrcweir $(DLLDEST)$/unohelper.py \ 116*cdf0e10cSrcweir $(PYUNO_MODULE) \ 117*cdf0e10cSrcweir $(MISC)$/$(PYUNORC) \ 118*cdf0e10cSrcweir $(LB)$/lib$(TARGET).a 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir$(LB)$/lib$(TARGET).a: $(MISC)$/$(TARGET).def 121*cdf0e10cSrcweir dlltool --dllname $(TARGET)$(DLLPOST) --input-def=$(MISC)$/$(TARGET).def --kill-at --output-lib=$(LB)$/lib$(TARGET).a 122*cdf0e10cSrcweir.ELSE 123*cdf0e10cSrcweirALLTAR : \ 124*cdf0e10cSrcweir $(DLLDEST)$/uno.py \ 125*cdf0e10cSrcweir $(DLLDEST)$/unohelper.py \ 126*cdf0e10cSrcweir $(PYUNO_MODULE) \ 127*cdf0e10cSrcweir $(MISC)$/$(PYUNORC) 128*cdf0e10cSrcweir.ENDIF 129*cdf0e10cSrcweir.ENDIF 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir.INCLUDE : target.mk 132*cdf0e10cSrcweir.IF "$(L10N_framework)"=="" 133*cdf0e10cSrcweir$(DLLDEST)$/%.py: %.py 134*cdf0e10cSrcweir cp $? $@ 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir.IF "$(GUI)" == "UNX" 138*cdf0e10cSrcweir$(PYUNO_MODULE) : $(SLO)$/pyuno_dlopenwrapper.obj 139*cdf0e10cSrcweir.IF "$(OS)" == "LINUX" 140*cdf0e10cSrcweir @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSRUNPATH_OOO) $(LINKFLAGSSHLCUI) -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd 141*cdf0e10cSrcweir.ELIF "$(OS)" == "SOLARIS" 142*cdf0e10cSrcweir @echo ld -G -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd 143*cdf0e10cSrcweir.ELIF "$(OS)" == "FREEBSD" 144*cdf0e10cSrcweir @echo ld -shared -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd 145*cdf0e10cSrcweir.ELIF "$(OS)" == "NETBSD" 146*cdf0e10cSrcweir @echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd 147*cdf0e10cSrcweir.ELIF "$(OS)" == "MACOSX" 148*cdf0e10cSrcweir @echo $(CC) -bundle -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o $(EXTRA_LINKFLAGS) $(EXTRA_FRAMEWORK_FLAG) > $(MISC)$/$(@:b).cmd 149*cdf0e10cSrcweir.ELSE 150*cdf0e10cSrcweir @echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd 151*cdf0e10cSrcweir.ENDIF 152*cdf0e10cSrcweir cat $(MISC)$/$(@:b).cmd 153*cdf0e10cSrcweir @+source $(MISC)$/$(@:b).cmd 154*cdf0e10cSrcweir.ENDIF 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir$(MISC)$/$(PYUNORC) : pyuno 158*cdf0e10cSrcweir -rm -f $@ 159*cdf0e10cSrcweir cat pyuno > $@ 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir$(MISC)$/pyuno.flt : pyuno.flt 162*cdf0e10cSrcweir -rm -f $@ 163*cdf0e10cSrcweir cat $? > $@ 164*cdf0e10cSrcweir.ENDIF # L10N_framework 165*cdf0e10cSrcweir 166