update dev300-m57
[ooovba.git] / python / makefile.mk
blob663a5604603dd56e528e9abca0ce7f1b1381d453
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
11 # $Revision: 1.39 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 PRJ=.
34 PRJNAME=so_python
35 TARGET=so_python
37 # --- Settings -----------------------------------------------------
39 .INCLUDE : settings.mk
40 .INCLUDE : pyversion.mk
42 .IF "$(SYSTEM_PYTHON)" == "YES"
43 all:
44 @echo "An already available installation of python should exist on your system."
45 @echo "Therefore the version provided here does not need to be built in addition."
46 .ENDIF
49 # --- Files --------------------------------------------------------
52 TARFILE_NAME=Python-$(PYVERSION)
53 PATCH_FILES=Python-$(PYVERSION).patch
55 CONFIGURE_DIR=
57 .IF "$(GUI)"=="UNX"
58 BUILD_DIR=
59 MYCWD=$(shell @pwd)/$(INPATH)/misc/build
61 # CLFLAGS get overwritten in Makefile.pre.in
62 .IF "$(SYSBASE)"!=""
63 CC+:=-I$(SYSBASE)$/usr$/include
64 python_LDFLAGS+=-L$(SYSBASE)/usr/lib
65 .IF "$(COMNAME)"=="sunpro5"
66 CC+:=$(C_RESTRICTIONFLAGS)
67 .ENDIF # "$(COMNAME)"=="sunpro5"
68 .ENDIF # "$(SYSBASE)"!=""
70 .IF "$(OS)$(COM)"=="LINUXGCC"
71 python_LDFLAGS+=-Wl,-z,noexecstack
72 .ENDIF
74 .IF "$(OS)$(CPU)"=="SOLARISU"
75 CC+:=$(ARCH_FLAGS)
76 python_LDFLAGS+=$(ARCH_FLAGS)
77 .ENDIF
79 CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure --prefix=$(MYCWD)/python-inst --enable-shared CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
80 .IF "$(OS)$(CPU)" == "SOLARISI"
81 CONFIGURE_ACTION += --disable-ipv6
82 .ENDIF
83 .IF "$(OS)" == "IRIX"
84 BUILD_ACTION=$(ENV_BUILD) gmake -j$(EXTMAXPROCESS) ; gmake install
85 .ELSE
86 BUILD_ACTION=$(ENV_BUILD) $(GNUMAKE) -j$(EXTMAXPROCESS) ; $(GNUMAKE) install ; chmod -R ug+w $(MYCWD)/python-inst
87 .ENDIF
88 .ELSE
89 # ----------------------------------
90 # WINDOWS
91 # ----------------------------------
92 .IF "$(COM)"=="GCC"
93 PATCH_FILES=Python-$(PYVERSION)-mingw.patch
94 BUILD_DIR=
95 MYCWD=$(shell cygpath -m $(shell @pwd))/$(INPATH)/misc/build
96 python_CFLAGS=-mno-cygwin -mthreads
97 python_LDFLAGS=-mno-cygwin -mthreads
98 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
99 python_LDFLAGS+=-shared-libgcc
100 .ENDIF
101 CONFIGURE_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)"
102 BUILD_ACTION=$(ENV_BUILD) make ; make install
103 .ELSE
104 #PYTHONPATH:=..$/Lib
105 #.EXPORT : PYTHONPATH
107 #.IF "$(CCNUMVER)" <= "001400000000"
108 #EXFLAGS="/GX /YX"
109 #.ELSE
110 #.IF "$(WINDOWS_VISTA_PSDK)"!=""
111 #EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
112 #ADDITIONALLIBS=ws2_32.lib
113 #.ELSE #"$(WINDOWS_VISTA_PSDK)"!=""
114 #EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
115 #.ENDIF #"$(WINDOWS_VISTA_PSDK)"!=""
116 #.ENDIF
118 BUILD_DIR=PCbuild
120 # Build python executable and then runs a minimal script. Running the minimal script
121 # ensures that certain *.pyc files are generated which would otherwise be created on
122 # solver during registration in insetoo_native
123 .IF "$(SYSBASE)" != ""
124 BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe -useenv pcbuild.sln "Release|Win32"
125 .ELSE
126 BUILD_ACTION=$(COMPATH)$/vcpackages$/vcbuild.exe pcbuild.sln "Release|Win32"
127 .ENDIF # "$(SYSBASE)" != ""
128 .ENDIF
129 .ENDIF
131 PYVERSIONFILE=$(MISC)$/pyversion.mk
133 # --- Targets ------------------------------------------------------
136 .INCLUDE : set_ext.mk
137 .INCLUDE : target.mk
138 .INCLUDE : tg_ext.mk
140 .IF "$(L10N_framework)"==""
141 .IF "$(GUI)" != "UNX"
142 .IF "$(COM)"!="GCC"
143 PYCONFIG:=$(MISC)$/build$/pyconfig.h
144 $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h : $(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE)
146 $(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) : $(PYCONFIG)
148 $(PYCONFIG) : $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h
149 -rm -f $@
150 cat $(MISC)$/build$/$(TARFILE_NAME)$/PC$/pyconfig.h > $@
151 .ENDIF
152 .ENDIF
154 ALLTAR : $(PYVERSIONFILE)
155 .ENDIF # "$(L10N_framework)"==""
158 $(PYVERSIONFILE) : pyversion.mk $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
159 -rm -f $@
160 cat $? > $@