xref: /aoo41x/main/python/makefile.mk (revision cdf0e10c)
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*cdf0e10cSrcweir
28*cdf0e10cSrcweirPRJ=.
29*cdf0e10cSrcweir
30*cdf0e10cSrcweirPRJNAME=so_python
31*cdf0e10cSrcweirTARGET=so_python
32*cdf0e10cSrcweir
33*cdf0e10cSrcweir# --- Settings -----------------------------------------------------
34*cdf0e10cSrcweir
35*cdf0e10cSrcweir.INCLUDE :	settings.mk
36*cdf0e10cSrcweir.INCLUDE :      pyversion.mk
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir.IF "$(SYSTEM_PYTHON)" == "YES"
39*cdf0e10cSrcweirall:
40*cdf0e10cSrcweir	@echo "An already available installation of python should exist on your system."
41*cdf0e10cSrcweir	@echo "Therefore the version provided here does not need to be built in addition."
42*cdf0e10cSrcweir.ENDIF
43*cdf0e10cSrcweir
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir# --- Files --------------------------------------------------------
46*cdf0e10cSrcweir
47*cdf0e10cSrcweir
48*cdf0e10cSrcweirTARFILE_NAME=Python-$(PYVERSION)
49*cdf0e10cSrcweirTARFILE_MD5=e81c2f0953aa60f8062c05a4673f2be0
50*cdf0e10cSrcweirPATCH_FILES=\
51*cdf0e10cSrcweir	Python-$(PYVERSION).patch \
52*cdf0e10cSrcweir	Python-parallel-make.patch \
53*cdf0e10cSrcweir	Python-ssl.patch \
54*cdf0e10cSrcweir    Python-2.6.1-sysbase.patch\
55*cdf0e10cSrcweir	Python-2.6.1-nohardlink.patch
56*cdf0e10cSrcweir
57*cdf0e10cSrcweirCONFIGURE_DIR=
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
60*cdf0e10cSrcweirBUILD_DIR=
61*cdf0e10cSrcweirMYCWD=$(shell @pwd)/$(INPATH)/misc/build
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir# CLFLAGS get overwritten in Makefile.pre.in
64*cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
65*cdf0e10cSrcweirCC+:=-I$(SYSBASE)$/usr$/include
66*cdf0e10cSrcweirpython_LDFLAGS+=-L$(SYSBASE)/usr/lib
67*cdf0e10cSrcweir.IF "$(COMNAME)"=="sunpro5"
68*cdf0e10cSrcweirCC+:=$(C_RESTRICTIONFLAGS)
69*cdf0e10cSrcweir.ENDIF			# "$(COMNAME)"=="sunpro5"
70*cdf0e10cSrcweir.ENDIF			# "$(SYSBASE)"!=""
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir.IF "$(OS)$(CPU)"=="SOLARISU"
73*cdf0e10cSrcweirCC+:=$(ARCH_FLAGS)
74*cdf0e10cSrcweirpython_LDFLAGS+=$(ARCH_FLAGS)
75*cdf0e10cSrcweir.ENDIF
76*cdf0e10cSrcweir
77*cdf0e10cSrcweirCONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure --prefix=$(MYCWD)/python-inst --enable-shared CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
78*cdf0e10cSrcweir.IF "$(OS)$(CPU)" == "SOLARISI"
79*cdf0e10cSrcweirCONFIGURE_ACTION += --disable-ipv6
80*cdf0e10cSrcweir.ENDIF
81*cdf0e10cSrcweirBUILD_ACTION=$(ENV_BUILD) $(GNUMAKE) -j$(EXTMAXPROCESS) && $(GNUMAKE) install && chmod -R ug+w $(MYCWD)/python-inst && chmod g+w Include
82*cdf0e10cSrcweir.ELSE
83*cdf0e10cSrcweir# ----------------------------------
84*cdf0e10cSrcweir# WINDOWS
85*cdf0e10cSrcweir# ----------------------------------
86*cdf0e10cSrcweir.IF "$(COM)"=="GCC"
87*cdf0e10cSrcweirPATCH_FILES=Python-$(PYVERSION)-mingw.patch
88*cdf0e10cSrcweirBUILD_DIR=
89*cdf0e10cSrcweirMYCWD=$(shell cygpath -m $(shell @pwd))/$(INPATH)/misc/build
90*cdf0e10cSrcweirpython_CFLAGS=-mno-cygwin -mthreads
91*cdf0e10cSrcweirpython_LDFLAGS=-mno-cygwin -mthreads
92*cdf0e10cSrcweir.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
93*cdf0e10cSrcweirpython_LDFLAGS+=-shared-libgcc
94*cdf0e10cSrcweir.ENDIF
95*cdf0e10cSrcweirpython_LDFLAGS+=-shared-libgcc -Wl,--enable-runtime-pseudo-reloc-v2
96*cdf0e10cSrcweirCONFIGURE_ACTION=./configure --prefix=$(MYCWD)/python-inst --enable-shared CC="$(CC:s/guw.exe //)" CXX="$(CXX:s/guw.exe //)" MACHDEP=MINGW32 LN="cp -p" CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
97*cdf0e10cSrcweirBUILD_ACTION=$(ENV_BUILD) make && make install
98*cdf0e10cSrcweir.ELSE
99*cdf0e10cSrcweir#PYTHONPATH:=..$/Lib
100*cdf0e10cSrcweir#.EXPORT : PYTHONPATH
101*cdf0e10cSrcweir
102*cdf0e10cSrcweir#.IF "$(CCNUMVER)" <= "001400000000"
103*cdf0e10cSrcweir#EXFLAGS="/GX /YX"
104*cdf0e10cSrcweir#.ELSE
105*cdf0e10cSrcweir#.IF "$(WINDOWS_VISTA_PSDK)"!=""
106*cdf0e10cSrcweir#EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
107*cdf0e10cSrcweir#ADDITIONALLIBS=ws2_32.lib
108*cdf0e10cSrcweir#.ELSE  #"$(WINDOWS_VISTA_PSDK)"!=""
109*cdf0e10cSrcweir#EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
110*cdf0e10cSrcweir#.ENDIF #"$(WINDOWS_VISTA_PSDK)"!=""
111*cdf0e10cSrcweir#.ENDIF
112*cdf0e10cSrcweir
113*cdf0e10cSrcweirBUILD_DIR=PCbuild
114*cdf0e10cSrcweir
115*cdf0e10cSrcweir# Build python executable and then runs a minimal script. Running the minimal script
116*cdf0e10cSrcweir# ensures that certain *.pyc files are generated which would otherwise be created on
117*cdf0e10cSrcweir# solver during registration in insetoo_native
118*cdf0e10cSrcweir.IF "$(SYSBASE)" != ""
119*cdf0e10cSrcweirBUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe -useenv pcbuild.sln "Release|Win32"
120*cdf0e10cSrcweir.ELSE
121*cdf0e10cSrcweirBUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe pcbuild.sln "Release|Win32"
122*cdf0e10cSrcweir.ENDIF # "$(SYSBASE)" != ""
123*cdf0e10cSrcweir.ENDIF
124*cdf0e10cSrcweir.ENDIF
125*cdf0e10cSrcweir
126*cdf0e10cSrcweirPYVERSIONFILE=$(MISC)$/pyversion.mk
127*cdf0e10cSrcweir
128*cdf0e10cSrcweir# --- Targets ------------------------------------------------------
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir
131*cdf0e10cSrcweir.INCLUDE : set_ext.mk
132*cdf0e10cSrcweir.INCLUDE : target.mk
133*cdf0e10cSrcweir.INCLUDE : tg_ext.mk
134*cdf0e10cSrcweir
135*cdf0e10cSrcweir.IF "$(L10N_framework)"==""
136*cdf0e10cSrcweir.IF "$(GUI)" != "UNX"
137*cdf0e10cSrcweir.IF "$(COM)"!="GCC"
138*cdf0e10cSrcweirPYCONFIG:=$(MISC)$/build$/pyconfig.h
139*cdf0e10cSrcweir$(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h : $(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE)
140*cdf0e10cSrcweir
141*cdf0e10cSrcweir$(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) : $(PYCONFIG)
142*cdf0e10cSrcweir
143*cdf0e10cSrcweir$(PYCONFIG) : $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h
144*cdf0e10cSrcweir	-rm -f $@
145*cdf0e10cSrcweir	cat $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h > $@
146*cdf0e10cSrcweir.ENDIF
147*cdf0e10cSrcweir.ENDIF
148*cdf0e10cSrcweir
149*cdf0e10cSrcweirALLTAR : $(PYVERSIONFILE)
150*cdf0e10cSrcweir.ENDIF          # "$(L10N_framework)"==""
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir
153*cdf0e10cSrcweir$(PYVERSIONFILE) : pyversion.mk $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
154*cdf0e10cSrcweir	-rm -f $@
155*cdf0e10cSrcweir	cat $? > $@
156*cdf0e10cSrcweir
157