cpython/PC/os2emx/Makefile
Guido van Rossum e7ba495627 Merged revisions 55631-55794 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk

................
  r55636 | neal.norwitz | 2007-05-29 00:06:39 -0700 (Tue, 29 May 2007) | 149 lines

  Merged revisions 55506-55635 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r55507 | georg.brandl | 2007-05-22 07:28:17 -0700 (Tue, 22 May 2007) | 2 lines

    Remove the "panel" module doc file which has been ignored since 1994.
  ........
    r55522 | mark.hammond | 2007-05-22 19:04:28 -0700 (Tue, 22 May 2007) | 4 lines

    Remove definition of PY_UNICODE_TYPE from pyconfig.h, allowing the
    definition in unicodeobject.h to be used, giving us the desired
    wchar_t in place of 'unsigned short'.  As discussed on python-dev.
  ........
    r55525 | neal.norwitz | 2007-05-22 23:35:32 -0700 (Tue, 22 May 2007) | 6 lines

    Add -3 option to the interpreter to warn about features that are
    deprecated and will be changed/removed in Python 3.0.

    This patch is mostly from Anthony.  I tweaked some format and added
    a little doc.
  ........
    r55527 | neal.norwitz | 2007-05-22 23:57:35 -0700 (Tue, 22 May 2007) | 1 line

    Whitespace cleanup
  ........
    r55528 | neal.norwitz | 2007-05-22 23:58:36 -0700 (Tue, 22 May 2007) | 1 line

    Add a bunch more deprecation warnings for builtins that are going away in 3.0
  ........
    r55549 | georg.brandl | 2007-05-24 09:49:29 -0700 (Thu, 24 May 2007) | 2 lines

    shlex.split() now has an optional "posix" parameter.
  ........
    r55550 | georg.brandl | 2007-05-24 10:33:33 -0700 (Thu, 24 May 2007) | 2 lines

    Fix parameter passing.
  ........
    r55555 | facundo.batista | 2007-05-24 10:50:54 -0700 (Thu, 24 May 2007) | 6 lines


    Added an optional timeout parameter to urllib.ftpwrapper, with tests
    (for this and a basic one, because there weren't any). Changed also
    NEWS, but didn't find documentation for this function, assumed it
    wasn't public...
  ........
    r55563 | facundo.batista | 2007-05-24 13:01:59 -0700 (Thu, 24 May 2007) | 4 lines


    Removed the .recv() in the test, is not necessary, and was
    causing problems that didn't have anything to do with was
    actually being tested...
  ........
    r55564 | facundo.batista | 2007-05-24 13:51:19 -0700 (Thu, 24 May 2007) | 5 lines


    Let's see if reading exactly what is written allow this live
    test to pass (now I know why there were so few tests in ftp,
    http, etc, :( ).
  ........
    r55567 | facundo.batista | 2007-05-24 20:10:28 -0700 (Thu, 24 May 2007) | 4 lines


    Trying to make the tests work in Windows and Solaris, everywhere
    else just works
  ........
    r55568 | facundo.batista | 2007-05-24 20:47:19 -0700 (Thu, 24 May 2007) | 4 lines


    Fixing stupid error, and introducing a sleep, to see if the
    other thread is awakened and finish sending data.
  ........
    r55569 | facundo.batista | 2007-05-24 21:20:22 -0700 (Thu, 24 May 2007) | 4 lines


    Commenting out the tests until find out who can test them in
    one of the problematic enviroments.
  ........
    r55570 | neal.norwitz | 2007-05-24 22:13:40 -0700 (Thu, 24 May 2007) | 2 lines

    Get test passing again by commenting out the reference to the test class.
  ........
    r55575 | vinay.sajip | 2007-05-25 00:05:59 -0700 (Fri, 25 May 2007) | 1 line

    Updated docstring for SysLogHandler (#1720726).
  ........
    r55576 | vinay.sajip | 2007-05-25 00:06:55 -0700 (Fri, 25 May 2007) | 1 line

    Updated documentation for SysLogHandler (#1720726).
  ........
    r55592 | brett.cannon | 2007-05-25 13:17:15 -0700 (Fri, 25 May 2007) | 3 lines

    Remove direct call's to file's constructor and replace them with calls to
    open() as ths is considered best practice.
  ........
    r55601 | kristjan.jonsson | 2007-05-26 12:19:50 -0700 (Sat, 26 May 2007) | 1 line

    Remove the rgbimgmodule from PCBuild8
  ........
    r55602 | kristjan.jonsson | 2007-05-26 12:31:39 -0700 (Sat, 26 May 2007) | 1 line

    Include <windows.h> after python.h, so that WINNT is properly set before windows.h is included.  Fixes warnings in PC builds.
  ........
    r55603 | walter.doerwald | 2007-05-26 14:04:13 -0700 (Sat, 26 May 2007) | 2 lines

    Fix typo.
  ........
    r55604 | peter.astrand | 2007-05-26 15:18:20 -0700 (Sat, 26 May 2007) | 1 line

    Applied patch 1669481, slightly modified: Support close_fds on Win32
  ........
    r55606 | neal.norwitz | 2007-05-26 21:08:54 -0700 (Sat, 26 May 2007) | 2 lines

    Add the new function object attribute names from py3k.
  ........
    r55617 | lars.gustaebel | 2007-05-27 12:49:30 -0700 (Sun, 27 May 2007) | 20 lines

    Added errors argument to TarFile class that allows the user to
    specify an error handling scheme for character conversion. Additional
    scheme "utf-8" in read mode. Unicode input filenames are now
    supported by design. The values of the pax_headers dictionary are now
    limited to unicode objects.

    Fixed: The prefix field is no longer used in PAX_FORMAT (in
    conformance with POSIX).
    Fixed: In read mode use a possible pax header size field.
    Fixed: Strip trailing slashes from pax header name values.
    Fixed: Give values in user-specified pax_headers precedence when
    writing.

    Added unicode tests. Added pax/regtype4 member to testtar.tar all
    possible number fields in a pax header.

    Added two chapters to the documentation about the different formats
    tarfile.py supports and how unicode issues are handled.
  ........
    r55618 | raymond.hettinger | 2007-05-27 22:23:22 -0700 (Sun, 27 May 2007) | 1 line

    Explain when groupby() issues a new group.
  ........
    r55634 | martin.v.loewis | 2007-05-28 21:01:29 -0700 (Mon, 28 May 2007) | 2 lines

    Test pre-commit hook for a link to a .py file.
  ........
    r55635 | martin.v.loewis | 2007-05-28 21:02:03 -0700 (Mon, 28 May 2007) | 2 lines

    Revert 55634.
  ........
................
  r55639 | neal.norwitz | 2007-05-29 00:58:11 -0700 (Tue, 29 May 2007) | 1 line

  Remove sys.exc_{type,exc_value,exc_traceback}
................
  r55641 | neal.norwitz | 2007-05-29 01:03:50 -0700 (Tue, 29 May 2007) | 1 line

  Missed one sys.exc_type.  I wonder why exc_{value,traceback} were already gone
................
  r55642 | neal.norwitz | 2007-05-29 01:08:33 -0700 (Tue, 29 May 2007) | 1 line

  Missed more doc for sys.exc_* attrs.
................
  r55643 | neal.norwitz | 2007-05-29 01:18:19 -0700 (Tue, 29 May 2007) | 1 line

  Remove sys.exc_clear()
................
  r55665 | guido.van.rossum | 2007-05-29 19:45:43 -0700 (Tue, 29 May 2007) | 4 lines

  Make None, True, False keywords.
  We can now also delete all the other places that explicitly forbid
  assignment to None, but I'm not going to bother right now.
................
  r55666 | guido.van.rossum | 2007-05-29 20:01:51 -0700 (Tue, 29 May 2007) | 3 lines

  Found another place that needs check for forbidden names.
  Fixed test_syntax.py accordingly (it helped me find that one).
................
  r55668 | guido.van.rossum | 2007-05-29 20:41:48 -0700 (Tue, 29 May 2007) | 2 lines

  Mark None, True, False as keywords.
................
  r55673 | neal.norwitz | 2007-05-29 23:28:25 -0700 (Tue, 29 May 2007) | 3 lines

  Get the dis module working on modules again after changing dicts
  to not return lists and also new-style classes.  Add a test.
................
  r55674 | neal.norwitz | 2007-05-29 23:35:45 -0700 (Tue, 29 May 2007) | 1 line

  Umm, it helps to add the module that the test uses
................
  r55675 | neal.norwitz | 2007-05-29 23:53:05 -0700 (Tue, 29 May 2007) | 4 lines

  Try to fix up all the other places that were assigning to True/False.
  There's at least one more problem in test.test_xmlrpc.  I have other
  changes in that file and that should be fixed soon (I hope).
................
  r55679 | neal.norwitz | 2007-05-30 00:31:55 -0700 (Wed, 30 May 2007) | 1 line

  Fix up another place that was assigning to True/False.
................
  r55688 | brett.cannon | 2007-05-30 14:19:47 -0700 (Wed, 30 May 2007) | 2 lines

  Ditch MimeWriter.
................
  r55692 | brett.cannon | 2007-05-30 14:52:00 -0700 (Wed, 30 May 2007) | 2 lines

  Remove the mimify module.
................
  r55707 | guido.van.rossum | 2007-05-31 05:08:45 -0700 (Thu, 31 May 2007) | 2 lines

  Backport the addition of show_code() to dis.py -- it's too handy.
................
  r55708 | guido.van.rossum | 2007-05-31 06:22:57 -0700 (Thu, 31 May 2007) | 7 lines

  Fix a fairly long-standing bug in the check for assignment to None (and other
  keywords, these days).  In 2.5, you could write foo(None=1) without getting
  a SyntaxError (although foo()'s definition would have to use **kwds to avoid
  getting a runtime error complaining about an unknown keyword of course).

  This ought to be backported to 2.5.2 or at least 2.6.
................
  r55724 | brett.cannon | 2007-05-31 19:32:41 -0700 (Thu, 31 May 2007) | 2 lines

  Remove the cfmfile.
................
  r55727 | neal.norwitz | 2007-05-31 22:19:44 -0700 (Thu, 31 May 2007) | 1 line

  Remove reload() builtin.
................
  r55729 | neal.norwitz | 2007-05-31 22:51:30 -0700 (Thu, 31 May 2007) | 59 lines

  Merged revisions 55636-55728 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r55637 | georg.brandl | 2007-05-29 00:16:47 -0700 (Tue, 29 May 2007) | 2 lines

    Fix rst markup.
  ........
    r55638 | neal.norwitz | 2007-05-29 00:51:39 -0700 (Tue, 29 May 2007) | 1 line

    Fix typo in doc
  ........
    r55671 | neal.norwitz | 2007-05-29 21:53:41 -0700 (Tue, 29 May 2007) | 1 line

    Fix indentation (whitespace only).
  ........
    r55676 | thomas.heller | 2007-05-29 23:58:30 -0700 (Tue, 29 May 2007) | 1 line

    Fix compiler warnings.
  ........
    r55677 | thomas.heller | 2007-05-30 00:01:25 -0700 (Wed, 30 May 2007) | 2 lines

    Correct the name of a field in the WIN32_FIND_DATAA and WIN32_FIND_DATAW structures.
    Closes bug #1726026.
  ........
    r55686 | brett.cannon | 2007-05-30 13:46:26 -0700 (Wed, 30 May 2007) | 2 lines

    Have MimeWriter raise a DeprecationWarning as per PEP 4 and its documentation.
  ........
    r55690 | brett.cannon | 2007-05-30 14:48:58 -0700 (Wed, 30 May 2007) | 3 lines

    Have mimify raise a DeprecationWarning.  The docs and PEP 4 have listed the
    module as deprecated for a while.
  ........
    r55696 | brett.cannon | 2007-05-30 15:24:28 -0700 (Wed, 30 May 2007) | 2 lines

    Have md5 raise a DeprecationWarning as per PEP 4.
  ........
    r55705 | neal.norwitz | 2007-05-30 21:14:22 -0700 (Wed, 30 May 2007) | 1 line

    Add some spaces in the example code.
  ........
    r55716 | brett.cannon | 2007-05-31 12:20:00 -0700 (Thu, 31 May 2007) | 2 lines

    Have the sha module raise a DeprecationWarning as specified in PEP 4.
  ........
    r55719 | brett.cannon | 2007-05-31 12:40:42 -0700 (Thu, 31 May 2007) | 2 lines

    Cause buildtools to raise a DeprecationWarning.
  ........
    r55721 | brett.cannon | 2007-05-31 13:01:11 -0700 (Thu, 31 May 2007) | 2 lines

    Have cfmfile raise a DeprecationWarning as per PEP 4.
  ........
    r55726 | neal.norwitz | 2007-05-31 21:56:47 -0700 (Thu, 31 May 2007) | 1 line

    Mail if there is an installation failure.
  ........
................
  r55730 | neal.norwitz | 2007-05-31 23:22:07 -0700 (Thu, 31 May 2007) | 2 lines

  Remove the code that was missed in rev 55303.
................
  r55738 | neal.norwitz | 2007-06-01 19:10:43 -0700 (Fri, 01 Jun 2007) | 1 line

  Fix doc breakage
................
  r55741 | neal.norwitz | 2007-06-02 00:41:58 -0700 (Sat, 02 Jun 2007) | 1 line

  Remove timing module (plus some remnants of other modules).
................
  r55742 | neal.norwitz | 2007-06-02 00:51:44 -0700 (Sat, 02 Jun 2007) | 1 line

  Remove posixfile module (plus some remnants of other modules).
................
  r55744 | neal.norwitz | 2007-06-02 10:18:56 -0700 (Sat, 02 Jun 2007) | 1 line

  Fix doc breakage.
................
  r55745 | neal.norwitz | 2007-06-02 11:32:16 -0700 (Sat, 02 Jun 2007) | 1 line

  Make a whatsnew 3.0 template.
................
  r55754 | neal.norwitz | 2007-06-03 23:24:18 -0700 (Sun, 03 Jun 2007) | 1 line

  SF #1730441, os._execvpe raises UnboundLocal due to new try/except semantics
................
  r55755 | neal.norwitz | 2007-06-03 23:26:00 -0700 (Sun, 03 Jun 2007) | 1 line

  Get rid of extra whitespace
................
  r55794 | guido.van.rossum | 2007-06-06 15:29:22 -0700 (Wed, 06 Jun 2007) | 3 lines

  Make this compile in GCC 2.96, which does not allow interspersing
  declarations and code.
................
2007-06-06 23:52:48 +00:00

680 lines
20 KiB
Makefile

#####################==================----------------
#
# Top-Level Makefile for Building Python 2.4 for OS/2 using GCC/EMX
# Originally written by Andrew Zabolotny, <bit@eltech.ru> for Python 1.5.2
# Modified by Andrew MacIntyre, <andymac@pcug.org.au> for Python 2.5
#
# This makefile was developed for use with [P]GCC/EMX compiler any
# version and GNU Make.
#
# The output of the build is a largish Python25.DLL containing the
# essential modules of Python and a small Python.exe program to start
# the interpreter. When embedding Python within another program, only
# Python25.DLL is needed. We also build python_s.a static library (which
# can be converted into OMF (.lib) format using emxomf tool) and both
# python.a and python.lib import libraries. Then the optional
# extension modules, which are OS/2 DLLs renamed with a PYD file extension.
#
# Recommended build order:
# make depend (if you have makedep)
# make all
# make lx (if you have lxlite)
# make test (optional)
#
#####################==================----------------
# === Compilation mode: debug or release ===
MODE= optimize
#MODE= debug
# === Assert() enabled ===
ASSERTIONS=no
#ASSERTIONS=yes
# === Hard-wire installation location ===
FIXED_PYHOME=no
#FIXED_PYHOME=yes
# === Optional modules ===
# Do you have the InfoZip compression library installed?
HAVE_ZLIB= no
# Do you have the Ultra Fast Crypt (UFC) library installed?
HAVE_UFC= no
# Do you have the Tcl/Tk library installed?
HAVE_TCLTK= no
# Do you have the GNU readline library installed?
# NOTE: I'm using a modified version of Kai Uwe Rommel's port that
# - is compiled with multithreading enabled
# - is linked statically
# I have had no success trying to use a DLL version, even when
# compiled with multithreading enabled.
HAVE_GREADLINE= no
# Do you have the BSD DB library (v1.85) as included in the EMXBSD package?
# NOTE: this library needs to be recompiled with a structure member
# renamed to avoid problems with the multithreaded errno support
# (there is a structure member called errno, used for shadowing the
# real errno, which conflicts with the errno redefinition of -Zmt)
HAVE_BSDDB= no
# Do you have the ncurses library installed? EMX's BSD curses aren't enough!
HAVE_NCURSES= no
# Do you have the GDBM library installed?
HAVE_GDBM= no
# Do you have the BZ2 compression library installed?
HAVE_BZ2= no
# Do you have the OpenSSL libraries installed
HAVE_OPENSSL= no
# === install locations ===
# default value of PYTHONHOME
LIB_DIR=C:/Python25
# default is to have everything in or under PYTHONHOME
EXE_DIR=$(LIB_DIR)
DLL_DIR=$(EXE_DIR)
# === The Tools ===
CC= gcc
CFLAGS= -Zmt -Wall $(INCLUDE)
CFLAGS.LIB= $(CFLAGS)
LD= gcc
LDFLAGS= -Zmt -Zcrtdll -L. -lgcc
LDFLAGS.EXE= $(LDFLAGS)
LDFLAGS.DLL= $(LDFLAGS) -Zdll
LDFLAGS.A= $(LDFLAGS) $(LIBS)
ARFLAGS= crs
IMPLIB= emximp
EXPLIB= emxexp
EXEOPT= emxbind
PY_DEF= -DPy_BUILD_CORE
# adjust C compiler settings based on build options
ifeq ($(MODE),debug)
CFLAGS+= -g -O
LDFLAGS+= -g
else
CFLAGS+= -s -O3 -fomit-frame-pointer -mprobe
LDFLAGS+= -s
endif
CFLAGS+= $(PY_DEF)
ifeq ($(ASSERTIONS),no)
CFLAGS+= -DNDEBUG
endif
ifeq ($(FIXED_PYHOME),yes)
CFLAGS+= -DPREFIX=$(DQUOTE)$(LIB_DIR)$(DQUOTE)
endif
# We're using the OMF format since EMX's ld has a obscure bug
# because of which it sometimes fails to build relocations
# in .data segment that point to another .data locations
# (except for the final linking if the .EXEs)
OMF= yes
# if fork() support is required, the main executable must be linked with ld
EXEOMF= no
# File extensions
MODULE.EXT= .pyd
MODLIB.EXT= .dll
ifeq ($(OMF),yes)
O= .obj
A= .lib
AR= emxomfar
CFLAGS+= -Zomf
LDFLAGS+= -Zomf
ifeq ($(MODE),debug)
ARFLAGS= -p64 crs
else
ARFLAGS= -p32 crs
endif
else
O= .o
A= .a
AR= ar
endif
# === Build time resource settings ===
# EMX's default number of file handles is 40, which is sometimes insufficient
# (the tempfile regression test tries to create 100 temporary files)
NFILES=250
# The default stack size for child threads is 64k bytes, which is
# insufficient for some applications which do a lot of work in threads
# (such as Zope, especially in conjunction with Plone).
# Note that this setting is distinct from the stack size for the main
# thread, which is set via the %.def rule below.
# EMX documents that the thread stack size should be at least 32768 bytes;
# for Zope/Plone at least 128k bytes is recommended.
# Uncomment & adjust the next line to override the default stack size:
#CFLAGS+= -DTHREAD_STACK_SIZE=0x20000
# === The environment ===
# Source file paths
SRCPATH=.;../../Python;../../Parser;../../Objects;../../Include;../../Modules
# Python contains the central core, containing the builtins and interpreter.
# Parser contains Python's Internal Parser and
# Standalone Parser Generator Program (Shares Some of Python's Modules)
# Objects contains Python Object Types
# Modules contains extension Modules (Built-In or as Separate DLLs)
# Unix shells tend to use "$" as delimiter for variable names.
# Test for this behaviour and set $(BUCK) variable correspondigly ...
__TMP__:=$(shell echo $$$$)
ifeq ($(__TMP__),$$$$)
BUCK= $$
BRO= (
BRC= )
else
BUCK= \$$
BRO= \(
BRC= \)
endif
# Compute the "double quote" variable
__TMP__:=$(shell echo "")
ifeq ($(__TMP__),"")
DQUOTE= "
else
DQUOTE= \"
endif
# Include paths
#INCLUDE= -I$(subst ;, -I, $(SRCPATH))
INCLUDE= -I. -I../../Include
# Path to search for .c files
vpath %.c .;..;$(SRCPATH)
# Top of the package tree
TOP= ../../
# Directory for output files
OUTBASE= out/
OUT= $(OUTBASE)$(MODE)/
# Additional libraries
LIBS= -lsocket
# Utility macro: replacement for $^
^^= $(filter-out %$A,$^)
# Use $(L^) to link with all libraries specified as dependencies
L^= $(addprefix -l,$(basename $(notdir $(filter %$A,$+))))
# Build rules
$(OUT)%$O: %.c
$(CC) $(CFLAGS.LIB) -c $< -o $@
%.a:
$(LD) $(LDFLAGS.A) -o $@ $(^^) $(L^)
%.dll:
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
%.pyd: $(OUT)%module$O $(OUT)%_m.def
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(PYTHON.IMPLIB) $(LIBS)
%.exe:
$(LD) $(LDFLAGS.EXE) -o $@ $(^^) $(L^)
%_m.def:
@echo Creating .DEF file: $@
@echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
ifeq ($(DESCRIPTION.$(notdir $*)$(MODULE.EXT)),)
@echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
else
@echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
endif
@echo DATA MULTIPLE NONSHARED >>$@
@echo EXPORTS >>$@
@echo init$(notdir $*) >>$@
%.def:
@echo Creating .DEF file: $@
@echo NAME $(notdir $*) $(EXETYPE.$(notdir $*).exe) >$@
@echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*).exe)$(DQUOTE) >>$@
@echo STACKSIZE 2097152 >>$@
# Output file names
PYTHON_VER= 2.5
PYTHON_LIB= python25
PYTHON.LIB= $(PYTHON_LIB)_s$A
PYTHON.IMPLIB= $(PYTHON_LIB)$A
ifeq ($(EXEOMF),yes)
PYTHON.EXEIMP= $(PYTHON.IMPLIB)
LDMODE.EXE= -Zomf
else
PYTHON.EXEIMP= $(PYTHON_LIB).a
LDMODE.EXE =
endif
PYTHON.DLL= $(PYTHON_LIB).dll
PYTHON.DEF= $(PYTHON_LIB).def
PYTHON.EXE= python.exe
PYTHONPM.EXE= pythonpm.exe
PGEN.EXE= pgen.exe
LIBRARY= $(PYTHON.LIB)
LD_LIBRARY= $(PYTHON.IMPLIB)
# Additional executable parameters
EXETYPE.$(PYTHON.EXE)= WINDOWCOMPAT
EXETYPE.$(PYTHONPM.EXE)= WINDOWAPI
EXETYPE.$(PGEN.EXE)= WINDOWCOMPAT
DESCRIPTION.$(PYTHON.EXE)= Python object-oriented programming language interpreter for OS/2
DESCRIPTION.$(PYTHONPM.EXE)= $(DESCRIPTION.$(PYTHON.EXE))
DESCRIPTION.$(PGEN.EXE)= Python object-oriented programming language parser generator for OS/2
# Module descriptions
DESCRIPTION.zlib$(MODULE.EXT)= Python Extension DLL for accessing the InfoZip compression library
DESCRIPTION.crypt$(MODULE.EXT)= Python Extension DLL implementing the crypt$(BRO)$(BRC) function
DESCRIPTION._tkinter$(MODULE.EXT)= Python Extension DLL for access to Tcl/Tk Environment
DESCRIPTION.readline$(MODULE.EXT)= Python Extension DLL for access to GNU ReadLine library
DESCRIPTION._curses$(MODLIB.EXT)= Python Extension DLL for access to ncurses library
DESCRIPTION.pyexpat$(MODULE.EXT)= Python Extension DLL for access to expat library
DESCRIPTION.bz2$(MODULE.EXT)= Python Extension DLL for accessing the bz2 compression library
# Source files
SRC.OS2EMX= config.c dlfcn.c getpathp.c
SRC.MAIN= $(addprefix $(TOP), \
Modules/getbuildinfo.c \
Modules/main.c)
SRC.MODULES= $(addprefix $(TOP), \
Modules/gcmodule.c \
Modules/signalmodule.c \
Modules/posixmodule.c \
Modules/threadmodule.c \
Modules/arraymodule.c \
Modules/binascii.c \
Modules/cmathmodule.c \
Modules/_codecsmodule.c \
Modules/collectionsmodule.c \
Modules/cPickle.c \
Modules/cStringIO.c \
Modules/_csv.c \
Modules/datetimemodule.c \
Modules/dlmodule.c \
Modules/errnomodule.c \
Modules/fcntlmodule.c \
Modules/_functoolsmodule.c \
Modules/_heapqmodule.c \
Modules/imageop.c \
Modules/itertoolsmodule.c \
Modules/_localemodule.c \
Modules/mathmodule.c \
Modules/operator.c \
Modules/_randommodule.c \
Modules/sha256module.c \
Modules/sha512module.c \
Modules/_sre.c \
Modules/_struct.c \
Modules/symtablemodule.c \
Modules/termios.c \
Modules/timemodule.c \
Modules/_weakref.c \
Modules/xxsubtype.c \
Modules/zipimport.c)
SRC.PARSE1= $(addprefix $(TOP), \
Parser/acceler.c \
Parser/grammar1.c \
Parser/listnode.c \
Parser/node.c \
Parser/parser.c \
Parser/parsetok.c \
Parser/bitset.c \
Parser/metagrammar.c)
SRC.PARSE2= $(addprefix $(TOP), \
Parser/tokenizer.c \
Parser/myreadline.c)
SRC.PARSER= $(SRC.PARSE1) \
$(SRC.PARSE2)
SRC.PYTHON= $(addprefix $(TOP), \
Python/Python-ast.c \
Python/asdl.c \
Python/ast.c \
Python/bltinmodule.c \
Python/exceptions.c \
Python/ceval.c \
Python/compile.c \
Python/codecs.c \
Python/errors.c \
Python/frozen.c \
Python/frozenmain.c \
Python/future.c \
Python/getargs.c \
Python/getcompiler.c \
Python/getcopyright.c \
Python/getmtime.c \
Python/getplatform.c \
Python/getversion.c \
Python/graminit.c \
Python/import.c \
Python/importdl.c \
Python/marshal.c \
Python/modsupport.c \
Python/mysnprintf.c \
Python/mystrtoul.c \
Python/pyarena.c \
Python/pyfpe.c \
Python/pystate.c \
Python/pystrtod.c \
Python/pythonrun.c \
Python/structmember.c \
Python/symtable.c \
Python/sysmodule.c \
Python/traceback.c \
Python/getopt.c \
Python/dynload_shlib.c \
Python/thread.c)
SRC.OBJECT= $(addprefix $(TOP), \
Objects/abstract.c \
Objects/boolobject.c \
Objects/bufferobject.c \
Objects/cellobject.c \
Objects/classobject.c \
Objects/cobject.c \
Objects/codeobject.c \
Objects/complexobject.c \
Objects/descrobject.c \
Objects/dictobject.c \
Objects/enumobject.c \
Objects/fileobject.c \
Objects/floatobject.c \
Objects/frameobject.c \
Objects/funcobject.c \
Objects/genobject.c \
Objects/intobject.c \
Objects/iterobject.c \
Objects/listobject.c \
Objects/longobject.c \
Objects/methodobject.c \
Objects/moduleobject.c \
Objects/object.c \
Objects/obmalloc.c \
Objects/rangeobject.c \
Objects/setobject.c \
Objects/sliceobject.c \
Objects/stringobject.c \
Objects/structseq.c \
Objects/tupleobject.c \
Objects/typeobject.c \
Objects/unicodeobject.c \
Objects/unicodectype.c \
Objects/weakrefobject.c)
SRC.LIB= $(SRC.OS2EMX) \
$(SRC.MAIN) \
$(SRC.PARSER) \
$(SRC.OBJECT) \
$(SRC.PYTHON) \
$(SRC.MODULES)
OBJ.LIB= $(addprefix $(OUT),$(notdir $(SRC.LIB:.c=$O)))
SRC.PGEN= $(SRC.PARSE1) \
$(addprefix $(TOP), \
Objects/obmalloc.c) \
$(addprefix $(TOP), \
Python/mysnprintf.c) \
$(addprefix $(TOP), \
Parser/tokenizer_pgen.c \
Parser/pgenmain.c \
Parser/pgen.c \
Parser/printgrammar.c \
Parser/grammar.c \
Parser/firstsets.c) \
OBJ.PGEN= $(addprefix $(OUT),$(notdir $(SRC.PGEN:.c=$O)))
SRC.EXE= $(TOP)Modules/python.c
SRC.PMEXE= pythonpm.c
# Python modules to be dynamically loaded that:
# 1) have only single source file and require no extra libs
# 2) use the standard module naming convention
# (the 'module' in ?????module.c is assumed)
# - these can be built with implicit rules
EASYEXTMODULES= fpectl \
fpetest \
parser \
pwd \
select
# Python modules to be dynamically loaded that need explicit build rules
# (either multiple source files and/or non-standard module naming)
# (NOTE: use shortened names for modules affected by 8 char name limit)
HARDEXTMODULES= _hotshot \
_socket \
_testcap \
unicoded
# Python modules that are used as libraries and therefore must use
# a .DLL extension
LIBEXTMODULES=
# Python external ($(MODULE.EXT)) modules - can be EASY or HARD
ifeq ($(HAVE_ZLIB),yes)
HARDEXTMODULES+= zlib
endif
ifeq ($(HAVE_UFC),yes)
HARDEXTMODULES+= crypt
endif
ifeq ($(HAVE_TCLTK),yes)
HARDEXTMODULES+= _tkinter
CFLAGS+= -DHAS_DIRENT -I/TclTk80/include
TK_LIBS+= -L/TclTk80/lib -ltcl80 -ltk80
endif
ifeq ($(HAVE_GREADLINE),yes)
HARDEXTMODULES+= readline
endif
ifeq ($(HAVE_NCURSES),yes)
LIBEXTMODULES+= _curses
HARDEXTMODULES+= _curses_
endif
ifeq ($(HAVE_GDBM),yes)
HARDEXTMODULES+= gdbm dbm
endif
ifeq ($(HAVE_BZ2),yes)
HARDEXTMODULES+= bz2
endif
ifeq ($(HAVE_OPENSSL),yes)
HARDEXTMODULES+= _ssl
endif
# Expat is now distributed with the Python source
HARDEXTMODULES+= pyexpat
EXPAT.INC= -I../../Modules/expat
EXPAT.DEF= -DHAVE_EXPAT_H -DXML_NS=1 -DXML_DTD=1 -DXML_BYTE_ORDER=12 \
-DXML_CONTENT_BYTES=1024 -DHAVE_MEMMOVE=1 -DHAVE_BCOPY=1
EXPAT.SRC= $(addprefix ../../Modules/expat/, \
xmlparse.c \
xmlrole.c \
xmltok.c)
# all the external modules
EXTERNDLLS= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES)))
EXTERNDLLS+= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES)))
EXTERNDLLS+= $(addsuffix $(MODLIB.EXT),$(patsubst %module,%,$(LIBEXTMODULES)))
# Targets
all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
python_noncore
python_noncore:
make PY_DEF= $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
clean:
rm -f $(OUT)*
rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \
$(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT) *.dll
find ../../Lib -name "*.py[co]" -exec rm {} ";"
lx:
@echo Packing everything with lxLite...
lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE)
depend: $(OUTBASE)
makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \
-r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN)
$(OUT): $(OUTBASE)
$(OUT) $(OUTBASE):
mkdir.exe $@
$(PYTHON.LIB): $(OBJ.LIB)
rm.exe -f $@
$(AR) $(ARFLAGS) $@ $^
# the Python core DLL .def file needs to have a number of non-static
# symbols that aren't part of the Python C API removed (commented out)
# from the DLL export list.
$(PYTHON.DEF): $(PYTHON.LIB)
@echo Creating .DEF file: $@
@echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@
@echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@
@echo PROTMODE >>$@
@echo DATA MULTIPLE NONSHARED >>$@
@echo EXPORTS >>$@
$(EXPLIB) -u $(PYTHON.LIB) |\
sed -e "/^ .init.*/s/^ /; /" \
-e "/^ .pcre_.*/s/^ /; /" \
-e "/^ .array_methods/s/^ /; /" \
-e "/^ .fast_save_leave/s/^ /; /" \
-e "/^ .dlopen/s/^ /; /" \
-e "/^ .dlsym/s/^ /; /" \
-e "/^ .dlclose/s/^ /; /" \
-e "/^ .dlerror/s/^ /; /" \
-e "/^ ._Py_re_.*/s/^ /; /" \
-e "/^ ._Py_MD5.*/s/^ /; /" >>$@
$(PYTHON.IMPLIB): $(PYTHON.DEF)
$(IMPLIB) -o $@ $^
$(PYTHON.EXEIMP): $(PYTHON.DEF)
$(IMPLIB) -o $@ $^
$(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF)
# Explicit make targets for the .EXEs to be able to use LD to link
# (so that fork() will work if required)
$(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def
$(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def
$(EXEOPT) -aq $(PYTHON.EXE) -h$(NFILES)
$(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def
$(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.PMEXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)pythonpm.def
$(EXEOPT) -aq $(PYTHONPM.EXE) -h$(NFILES)
$(PGEN.EXE): $(OBJ.PGEN) $(OUT)pgen.def
# Explicit building instructions for those external modules that require
# awkward handling (due e.g. to non-std naming, or multiple source files)
# - standard modules
_hotshot$(MODULE.EXT): $(OUT)_hotshot$O $(OUT)_hotshot_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
_socket$(MODULE.EXT): $(OUT)socketmodule$O $(OUT)_socket_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
# _testcapi needs to be renamed to be useful
_testcapi$(MODULE.EXT): $(OUT)_testcapimodule$O $(OUT)_testcapi_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
_testcap$(MODULE.EXT): _testcapi$(MODULE.EXT)
cp $^ $@
# unicodedata needs to be renamed to be useful
unicodedata$(MODULE.EXT): $(OUT)unicodedata$O $(OUT)unicodedata_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(MODULE_LIBS)
unicoded$(MODULE.EXT): unicodedata$(MODULE.EXT)
cp $^ $@
crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS)
# The _curses_panel module requires a couple of ncurses library entry
# points, which are best exposed as exports from the _curses module DLL
$(OUT)_curses_m.def:
@echo Creating .DEF file: $@
@echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
@echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODLIB.EXT))$(DQUOTE) >>$@
@echo DATA MULTIPLE NONSHARED >>$@
@echo EXPORTS >>$@
@echo init_curses >>$@
@echo wnoutrefresh >>$@
@echo _nc_panelhook >>$@
@echo is_linetouched >>$@
@echo mvwin >>$@
@echo stdscr >>$@
@echo wtouchln >>$@
$(OUT)_curses_panel_m.def:
@echo Creating .DEF file: $@
@echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
@echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
@echo DATA MULTIPLE NONSHARED >>$@
@echo IMPORTS >>$@
@echo _curses.wnoutrefresh >>$@
@echo _curses._nc_panelhook >>$@
@echo _curses.is_linetouched >>$@
@echo _curses.mvwin >>$@
@echo _curses.stdscr >>$@
@echo _curses.wtouchln >>$@
@echo EXPORTS >>$@
@echo init_curses_panel >>$@
_curses$(MODLIB.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses
# curses_panel needs to be renamed to be useful
_curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel
_curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT)
cp $^ $@
dbm$(MODULE.EXT): $(OUT)dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
gdbm$(MODULE.EXT): $(OUT)gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
# Expat is now distributed with Python, so use the included version
$(OUT)pyexpat$O: ../../Modules/pyexpat.c
$(CC) $(CFLAGS) $(EXPAT.INC) -c -o $@ $^
$(OUT)xmlparse$O: ../../Modules/expat/xmlparse.c
$(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^
$(OUT)xmlrole$O: ../../Modules/expat/xmlrole.c
$(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^
$(OUT)xmltok$O: ../../Modules/expat/xmltok.c
$(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^
pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)xmlparse$O $(OUT)xmlrole$O \
$(OUT)xmltok$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses
#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
$(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz
bz2$(MODULE.EXT): $(OUT)bz2module$O $(OUT)bz2_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lbz2
_ssl$(MODULE.EXT): $(OUT)_ssl$O $(OUT)_ssl_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lssl -lcrypto
# the test target
test:
-find ../../Lib -name "*.py[co]" -exec rm {} ";"
-./python -E -tt ../../lib/test/regrtest.py -l -u "network"
./python -E -tt ../../lib/test/regrtest.py -l -u "network"
-include $(OUTBASE)python.dep