| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 1 | #####################==================---------------- | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 2 | # | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 3 | # Top-Level Makefile for Building Python 2.4 for OS/2 using GCC/EMX | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 4 | # Originally written by Andrew Zabolotny, <bit@eltech.ru> for Python 1.5.2 | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 5 | # Modified by Andrew MacIntyre, <andymac@pcug.org.au> for Python 2.4 | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 6 | # | 
|  | 7 | # This makefile was developed for use with [P]GCC/EMX compiler any | 
|  | 8 | # version and GNU Make. | 
|  | 9 | # | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 10 | # The output of the build is a largish Python24.DLL containing the | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 11 | # essential modules of Python and a small Python.exe program to start | 
|  | 12 | # the interpreter. When embedding Python within another program, only | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 13 | # Python24.DLL is needed. We also build python_s.a static library (which | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 14 | # can be converted into OMF (.lib) format using emxomf tool) and both | 
|  | 15 | # python.a and python.lib import libraries.  Then the optional | 
|  | 16 | # extension modules, which are OS/2 DLLs renamed with a PYD file extension. | 
|  | 17 | # | 
|  | 18 | # Recommended build order: | 
|  | 19 | #   make depend		(if you have makedep) | 
|  | 20 | #   make all | 
|  | 21 | #   make lx		(if you have lxlite) | 
|  | 22 | #   make test		(optional) | 
|  | 23 | # | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 24 | #####################==================---------------- | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 25 |  | 
|  | 26 | # === Compilation mode: debug or release === | 
|  | 27 | MODE=		optimize | 
|  | 28 | #MODE=		debug | 
|  | 29 | # === Assert() enabled === | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 30 | ASSERTIONS=no | 
|  | 31 | #ASSERTIONS=yes | 
|  | 32 | # === Hard-wire installation location === | 
|  | 33 | FIXED_PYHOME=no | 
|  | 34 | #FIXED_PYHOME=yes | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 35 |  | 
|  | 36 | # === Optional modules === | 
|  | 37 | # Do you have the InfoZip compression library installed? | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 38 | HAVE_ZLIB=	no | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 39 | # Do you have the Ultra Fast Crypt (UFC) library installed? | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 40 | HAVE_UFC=	no | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 41 | # Do you have the Tcl/Tk library installed? | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 42 | HAVE_TCLTK=	no | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 43 | # Do you have the GNU multiprecision library installed? | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 44 | HAVE_GMPZ=	no | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 45 | # Do you have the GNU readline library installed? | 
|  | 46 | # NOTE: I'm using a modified version of Kai Uwe Rommel's port that | 
|  | 47 | #       - is compiled with multithreading enabled | 
|  | 48 | #       - is linked statically | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 49 | #       I have had no success trying to use a DLL version, even when | 
|  | 50 | #       compiled with multithreading enabled. | 
|  | 51 | HAVE_GREADLINE=	no | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 52 | # Do you have the BSD DB library (v1.85) as included in the EMXBSD package? | 
|  | 53 | # NOTE: this library needs to be recompiled with a structure member | 
|  | 54 | #       renamed to avoid problems with the multithreaded errno support | 
|  | 55 | #       (there is a structure member called errno, used for shadowing the | 
|  | 56 | #       real errno, which conflicts with the errno redefinition of -Zmt) | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 57 | HAVE_BSDDB=	no | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 58 | # Do you have the ncurses library installed? EMX's BSD curses aren't enough! | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 59 | HAVE_NCURSES=	no | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 60 | # Do you have the GDBM library installed? | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 61 | HAVE_GDBM=	no | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 62 | # Do you have the BZ2 compression library installed? | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 63 | HAVE_BZ2=	no | 
|  | 64 |  | 
|  | 65 | # === install locations === | 
|  | 66 | # default value of PYTHONHOME | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 67 | LIB_DIR=C:/Python24 | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 68 | # default is to have everything in or under PYTHONHOME | 
|  | 69 | EXE_DIR=$(LIB_DIR) | 
|  | 70 | DLL_DIR=$(EXE_DIR) | 
|  | 71 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 72 |  | 
|  | 73 | # === The Tools === | 
|  | 74 | CC=		gcc | 
|  | 75 | CFLAGS=		-Zmt -Wall $(INCLUDE) | 
|  | 76 | CFLAGS.LIB=	$(CFLAGS) | 
|  | 77 | LD=		gcc | 
|  | 78 | LDFLAGS=	-Zmt -Zcrtdll -L. -lgcc | 
|  | 79 | LDFLAGS.EXE=	$(LDFLAGS) | 
|  | 80 | LDFLAGS.DLL=	$(LDFLAGS) -Zdll | 
|  | 81 | LDFLAGS.A=	$(LDFLAGS) $(LIBS) | 
|  | 82 | ARFLAGS=	crs | 
|  | 83 | IMPLIB=		emximp | 
|  | 84 | EXPLIB=		emxexp | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 85 | EXEOPT=		emxbind | 
| Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 86 | PY_DEF=		-DPy_BUILD_CORE | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 87 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 88 |  | 
|  | 89 | # adjust C compiler settings based on build options | 
|  | 90 | ifeq ($(MODE),debug) | 
|  | 91 | CFLAGS+=	-g -O | 
|  | 92 | LDFLAGS+=	-g | 
|  | 93 | else | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 94 | CFLAGS+=	-s -O3 -fomit-frame-pointer -mprobe | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 95 | LDFLAGS+=	-s | 
|  | 96 | endif | 
| Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 97 | CFLAGS+=	$(PY_DEF) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 98 | ifeq ($(ASSERTIONS),no) | 
|  | 99 | CFLAGS+=	-DNDEBUG | 
|  | 100 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 101 | ifeq ($(FIXED_PYHOME),yes) | 
|  | 102 | CFLAGS+=	-DPREFIX=$(DQUOTE)$(LIB_DIR)$(DQUOTE) | 
|  | 103 | endif | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 104 |  | 
|  | 105 | # We're using the OMF format since EMX's ld has a obscure bug | 
|  | 106 | # because of which it sometimes fails to build relocations | 
|  | 107 | # in .data segment that point to another .data locations | 
|  | 108 | # (except for the final linking if the .EXEs) | 
|  | 109 | OMF=		yes | 
|  | 110 |  | 
|  | 111 | # if fork() support is required, the main executable must be linked with ld | 
|  | 112 | EXEOMF=		no | 
|  | 113 |  | 
|  | 114 | # File extensions | 
|  | 115 | MODULE.EXT=	.pyd | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 116 | MODLIB.EXT=	.dll | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 117 | ifeq ($(OMF),yes) | 
|  | 118 | O=		.obj | 
|  | 119 | A=		.lib | 
|  | 120 | AR=		emxomfar | 
|  | 121 | CFLAGS+=	-Zomf | 
|  | 122 | LDFLAGS+=	-Zomf | 
|  | 123 | ifeq ($(MODE),debug) | 
|  | 124 | ARFLAGS=	-p64 crs | 
|  | 125 | else | 
|  | 126 | ARFLAGS=	-p32 crs | 
|  | 127 | endif | 
|  | 128 | else | 
|  | 129 | O=		.o | 
|  | 130 | A=		.a | 
|  | 131 | AR=		ar | 
|  | 132 | endif | 
|  | 133 |  | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 134 | # EMX's default number of file handles is 40, which is sometimes insufficient | 
|  | 135 | # (the tempfile regression test tries to create 100 temporary files) | 
|  | 136 | NFILES=250 | 
|  | 137 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 138 | # Source file paths | 
|  | 139 | SRCPATH=.;../../Python;../../Parser;../../Objects;../../Include;../../Modules | 
|  | 140 | # Python contains the central core, containing the builtins and interpreter. | 
|  | 141 | # Parser contains Python's Internal Parser and | 
|  | 142 | #   Standalone Parser Generator Program (Shares Some of Python's Modules) | 
|  | 143 | # Objects contains Python Object Types | 
|  | 144 | # Modules contains extension Modules (Built-In or as Separate DLLs) | 
|  | 145 |  | 
|  | 146 | # Unix shells tend to use "$" as delimiter for variable names. | 
|  | 147 | # Test for this behaviour and set $(BUCK) variable correspondigly ... | 
|  | 148 | __TMP__:=$(shell echo $$$$) | 
|  | 149 | ifeq ($(__TMP__),$$$$) | 
|  | 150 | BUCK=		$$ | 
|  | 151 | BRO=		( | 
|  | 152 | BRC=		) | 
|  | 153 | else | 
|  | 154 | BUCK=		\$$ | 
|  | 155 | BRO=		\( | 
|  | 156 | BRC=		\) | 
|  | 157 | endif | 
|  | 158 | # Compute the "double quote" variable | 
|  | 159 | __TMP__:=$(shell echo "") | 
|  | 160 | ifeq ($(__TMP__),"") | 
|  | 161 | DQUOTE=	" | 
|  | 162 | else | 
|  | 163 | DQUOTE=	\" | 
|  | 164 | endif | 
|  | 165 |  | 
|  | 166 | # Include paths | 
|  | 167 | #INCLUDE=	-I$(subst ;, -I, $(SRCPATH)) | 
|  | 168 | INCLUDE=	-I. -I../../Include | 
|  | 169 |  | 
|  | 170 | # Path to search for .c files | 
|  | 171 | vpath %.c .;..;$(SRCPATH) | 
|  | 172 |  | 
|  | 173 | # Top of the package tree | 
|  | 174 | TOP=		../../ | 
|  | 175 |  | 
|  | 176 | # Directory for output files | 
|  | 177 | OUTBASE=	out/ | 
|  | 178 | OUT=		$(OUTBASE)$(MODE)/ | 
|  | 179 |  | 
|  | 180 | # Additional libraries | 
|  | 181 | LIBS=		-lsocket | 
|  | 182 |  | 
|  | 183 | # Utility macro: replacement for $^ | 
|  | 184 | ^^=		$(filter-out %$A,$^) | 
|  | 185 | # Use $(L^) to link with all libraries specified as dependencies | 
|  | 186 | L^=		$(addprefix -l,$(basename $(notdir $(filter %$A,$+)))) | 
|  | 187 |  | 
|  | 188 | # Build rules | 
|  | 189 | $(OUT)%$O: %.c | 
|  | 190 | $(CC) $(CFLAGS.LIB) -c $< -o $@ | 
|  | 191 |  | 
|  | 192 | %.a: | 
|  | 193 | $(LD) $(LDFLAGS.A) -o $@ $(^^) $(L^) | 
|  | 194 |  | 
|  | 195 | %.dll: | 
|  | 196 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) | 
|  | 197 |  | 
|  | 198 | %.pyd: $(OUT)%module$O $(OUT)%_m.def | 
|  | 199 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(PYTHON.IMPLIB) $(LIBS) | 
|  | 200 |  | 
|  | 201 | %.exe: | 
|  | 202 | $(LD) $(LDFLAGS.EXE) -o $@ $(^^) $(L^) | 
|  | 203 |  | 
|  | 204 | %_m.def: | 
|  | 205 | @echo Creating .DEF file: $@ | 
|  | 206 | @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ | 
|  | 207 | ifeq ($(DESCRIPTION.$(notdir $*)$(MODULE.EXT)),) | 
|  | 208 | @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@ | 
|  | 209 | else | 
|  | 210 | @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@ | 
|  | 211 | endif | 
|  | 212 | @echo DATA MULTIPLE NONSHARED >>$@ | 
|  | 213 | @echo EXPORTS >>$@ | 
|  | 214 | @echo 	init$(notdir $*) >>$@ | 
|  | 215 |  | 
|  | 216 | %.def: | 
|  | 217 | @echo Creating .DEF file: $@ | 
|  | 218 | @echo NAME $(notdir $*) $(EXETYPE.$(notdir $*).exe) >$@ | 
|  | 219 | @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*).exe)$(DQUOTE) >>$@ | 
| Andrew MacIntyre | 23ec1dc | 2003-06-09 08:14:03 +0000 | [diff] [blame] | 220 | @echo STACKSIZE 1572864 >>$@ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 221 |  | 
|  | 222 | # Output file names | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 223 | PYTHON_VER=	2.4 | 
|  | 224 | PYTHON_LIB=	python24 | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 225 | PYTHON.LIB=	$(PYTHON_LIB)_s$A | 
|  | 226 | PYTHON.IMPLIB=	$(PYTHON_LIB)$A | 
|  | 227 | ifeq ($(EXEOMF),yes) | 
|  | 228 | PYTHON.EXEIMP=	$(PYTHON.IMPLIB) | 
|  | 229 | LDMODE.EXE=		-Zomf | 
|  | 230 | else | 
|  | 231 | PYTHON.EXEIMP=	$(PYTHON_LIB).a | 
|  | 232 | LDMODE.EXE = | 
|  | 233 | endif | 
|  | 234 | PYTHON.DLL=	$(PYTHON_LIB).dll | 
|  | 235 | PYTHON.DEF=	$(PYTHON_LIB).def | 
|  | 236 | PYTHON.EXE=	python.exe | 
|  | 237 | PYTHONPM.EXE=	pythonpm.exe | 
|  | 238 | PGEN.EXE=	pgen.exe | 
|  | 239 | LIBRARY=	$(PYTHON.LIB) | 
|  | 240 | LD_LIBRARY=	$(PYTHON.IMPLIB) | 
|  | 241 |  | 
|  | 242 | # Additional executable parameters | 
|  | 243 | EXETYPE.$(PYTHON.EXE)=		WINDOWCOMPAT | 
|  | 244 | EXETYPE.$(PYTHONPM.EXE)=	WINDOWAPI | 
|  | 245 | EXETYPE.$(PGEN.EXE)=		WINDOWCOMPAT | 
|  | 246 | DESCRIPTION.$(PYTHON.EXE)=	Python object-oriented programming language interpreter for OS/2 | 
|  | 247 | DESCRIPTION.$(PYTHONPM.EXE)=	$(DESCRIPTION.$(PYTHON.EXE)) | 
|  | 248 | DESCRIPTION.$(PGEN.EXE)=	Python object-oriented programming language parser generator for OS/2 | 
|  | 249 |  | 
|  | 250 | # Module descriptions | 
|  | 251 | DESCRIPTION.zlib$(MODULE.EXT)=		Python Extension DLL for accessing the InfoZip compression library | 
|  | 252 | DESCRIPTION.crypt$(MODULE.EXT)=		Python Extension DLL implementing the crypt$(BRO)$(BRC) function | 
|  | 253 | DESCRIPTION._tkinter$(MODULE.EXT)=	Python Extension DLL for access to Tcl/Tk Environment | 
|  | 254 | DESCRIPTION.mpz$(MODULE.EXT)=		Python Extension DLL for access to GNU multi-precision library | 
|  | 255 | DESCRIPTION.readline$(MODULE.EXT)=	Python Extension DLL for access to GNU ReadLine library | 
| Andrew MacIntyre | e7a8cad | 2002-12-04 12:37:17 +0000 | [diff] [blame] | 256 | DESCRIPTION.bsddb185$(MODULE.EXT)=	Python Extension DLL for access to BSD DB (v1.85) library | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 257 | DESCRIPTION._curses$(MODLIB.EXT)=	Python Extension DLL for access to ncurses library | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 258 | DESCRIPTION.pyexpat$(MODULE.EXT)=	Python Extension DLL for access to expat library | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 259 | DESCRIPTION.bz2$(MODULE.EXT)=		Python Extension DLL for accessing the bz2 compression library | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 260 |  | 
|  | 261 | # Source files | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 262 | SRC.OS2EMX=	config.c dlfcn.c getpathp.c | 
|  | 263 | SRC.MAIN=	$(addprefix $(TOP), \ | 
|  | 264 | Modules/getbuildinfo.c \ | 
|  | 265 | Modules/main.c) | 
|  | 266 | SRC.MODULES=	$(addprefix $(TOP), \ | 
|  | 267 | Modules/gcmodule.c \ | 
|  | 268 | Modules/signalmodule.c \ | 
|  | 269 | Modules/posixmodule.c \ | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 270 | Modules/threadmodule.c \ | 
|  | 271 | Modules/arraymodule.c \ | 
|  | 272 | Modules/binascii.c \ | 
|  | 273 | Modules/cmathmodule.c \ | 
|  | 274 | Modules/_codecsmodule.c \ | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 275 | Modules/collectionsmodule.c \ | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 276 | Modules/cPickle.c \ | 
|  | 277 | Modules/cStringIO.c \ | 
|  | 278 | Modules/_csv.c \ | 
|  | 279 | Modules/datetimemodule.c \ | 
|  | 280 | Modules/dlmodule.c \ | 
|  | 281 | Modules/errnomodule.c \ | 
|  | 282 | Modules/fcntlmodule.c \ | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 283 | Modules/_heapqmodule.c \ | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 284 | Modules/imageop.c \ | 
|  | 285 | Modules/itertoolsmodule.c \ | 
|  | 286 | Modules/_localemodule.c \ | 
|  | 287 | Modules/mathmodule.c \ | 
|  | 288 | Modules/md5c.c \ | 
|  | 289 | Modules/md5module.c \ | 
|  | 290 | Modules/operator.c \ | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 291 | Modules/_randommodule.c \ | 
|  | 292 | Modules/regexmodule.c \ | 
|  | 293 | Modules/regexpr.c \ | 
|  | 294 | Modules/rgbimgmodule.c \ | 
|  | 295 | Modules/shamodule.c \ | 
|  | 296 | Modules/_sre.c \ | 
|  | 297 | Modules/stropmodule.c \ | 
|  | 298 | Modules/structmodule.c \ | 
|  | 299 | Modules/symtablemodule.c \ | 
|  | 300 | Modules/termios.c \ | 
|  | 301 | Modules/timemodule.c \ | 
|  | 302 | Modules/timingmodule.c \ | 
|  | 303 | Modules/_weakref.c \ | 
|  | 304 | Modules/xreadlinesmodule.c \ | 
|  | 305 | Modules/xxsubtype.c \ | 
|  | 306 | Modules/zipimport.c) | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 307 | SRC.PARSE1=	$(addprefix $(TOP), \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 308 | Parser/acceler.c \ | 
|  | 309 | Parser/grammar1.c \ | 
|  | 310 | Parser/listnode.c \ | 
|  | 311 | Parser/node.c \ | 
|  | 312 | Parser/parser.c \ | 
|  | 313 | Parser/parsetok.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 314 | Parser/bitset.c \ | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 315 | Parser/metagrammar.c) | 
|  | 316 | SRC.PARSE2=	$(addprefix $(TOP), \ | 
|  | 317 | Parser/tokenizer.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 318 | Parser/myreadline.c) | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 319 | SRC.PARSER=	$(SRC.PARSE1) \ | 
|  | 320 | $(SRC.PARSE2) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 321 | SRC.PYTHON=	$(addprefix $(TOP), \ | 
|  | 322 | Python/bltinmodule.c \ | 
|  | 323 | Python/exceptions.c \ | 
|  | 324 | Python/ceval.c \ | 
|  | 325 | Python/compile.c \ | 
|  | 326 | Python/codecs.c \ | 
|  | 327 | Python/errors.c \ | 
|  | 328 | Python/frozen.c \ | 
|  | 329 | Python/frozenmain.c \ | 
|  | 330 | Python/future.c \ | 
|  | 331 | Python/getargs.c \ | 
|  | 332 | Python/getcompiler.c \ | 
|  | 333 | Python/getcopyright.c \ | 
|  | 334 | Python/getmtime.c \ | 
|  | 335 | Python/getplatform.c \ | 
|  | 336 | Python/getversion.c \ | 
|  | 337 | Python/graminit.c \ | 
|  | 338 | Python/import.c \ | 
|  | 339 | Python/importdl.c \ | 
|  | 340 | Python/marshal.c \ | 
|  | 341 | Python/modsupport.c \ | 
|  | 342 | Python/mysnprintf.c \ | 
|  | 343 | Python/mystrtoul.c \ | 
|  | 344 | Python/pyfpe.c \ | 
|  | 345 | Python/pystate.c \ | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 346 | Python/pystrtod.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 347 | Python/pythonrun.c \ | 
|  | 348 | Python/structmember.c \ | 
|  | 349 | Python/symtable.c \ | 
|  | 350 | Python/sysmodule.c \ | 
|  | 351 | Python/traceback.c \ | 
|  | 352 | Python/getopt.c \ | 
|  | 353 | Python/dynload_shlib.c \ | 
|  | 354 | Python/thread.c) | 
|  | 355 | SRC.OBJECT=	$(addprefix $(TOP), \ | 
|  | 356 | Objects/abstract.c \ | 
| Andrew MacIntyre | 6c65531 | 2002-04-15 12:09:45 +0000 | [diff] [blame] | 357 | Objects/boolobject.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 358 | Objects/bufferobject.c \ | 
|  | 359 | Objects/cellobject.c \ | 
|  | 360 | Objects/classobject.c \ | 
|  | 361 | Objects/cobject.c \ | 
|  | 362 | Objects/complexobject.c \ | 
|  | 363 | Objects/descrobject.c \ | 
|  | 364 | Objects/dictobject.c \ | 
| Andrew MacIntyre | 07c639f | 2002-04-30 13:06:32 +0000 | [diff] [blame] | 365 | Objects/enumobject.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 366 | Objects/fileobject.c \ | 
|  | 367 | Objects/floatobject.c \ | 
|  | 368 | Objects/frameobject.c \ | 
|  | 369 | Objects/funcobject.c \ | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 370 | Objects/genobject.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 371 | Objects/intobject.c \ | 
|  | 372 | Objects/iterobject.c \ | 
|  | 373 | Objects/listobject.c \ | 
|  | 374 | Objects/longobject.c \ | 
|  | 375 | Objects/methodobject.c \ | 
|  | 376 | Objects/moduleobject.c \ | 
|  | 377 | Objects/object.c \ | 
| Andrew MacIntyre | 6c65531 | 2002-04-15 12:09:45 +0000 | [diff] [blame] | 378 | Objects/obmalloc.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 379 | Objects/rangeobject.c \ | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 380 | Objects/setobject.c \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 381 | Objects/sliceobject.c \ | 
|  | 382 | Objects/stringobject.c \ | 
|  | 383 | Objects/structseq.c \ | 
|  | 384 | Objects/tupleobject.c \ | 
|  | 385 | Objects/typeobject.c \ | 
|  | 386 | Objects/unicodeobject.c \ | 
|  | 387 | Objects/unicodectype.c \ | 
|  | 388 | Objects/weakrefobject.c) | 
|  | 389 |  | 
|  | 390 | SRC.LIB=	$(SRC.OS2EMX) \ | 
|  | 391 | $(SRC.MAIN) \ | 
|  | 392 | $(SRC.PARSER) \ | 
|  | 393 | $(SRC.OBJECT) \ | 
|  | 394 | $(SRC.PYTHON) \ | 
|  | 395 | $(SRC.MODULES) | 
|  | 396 | OBJ.LIB=	$(addprefix $(OUT),$(notdir $(SRC.LIB:.c=$O))) | 
|  | 397 |  | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 398 | SRC.PGEN=	$(SRC.PARSE1) \ | 
|  | 399 | $(addprefix $(TOP), \ | 
|  | 400 | Objects/obmalloc.c) \ | 
|  | 401 | $(addprefix $(TOP), \ | 
|  | 402 | Python/mysnprintf.c) \ | 
|  | 403 | $(addprefix $(TOP), \ | 
|  | 404 | Parser/tokenizer_pgen.c \ | 
|  | 405 | Parser/pgenmain.c \ | 
|  | 406 | Parser/pgen.c \ | 
|  | 407 | Parser/printgrammar.c \ | 
|  | 408 | Parser/grammar.c \ | 
|  | 409 | Parser/firstsets.c) \ | 
|  | 410 |  | 
|  | 411 | OBJ.PGEN=	$(addprefix $(OUT),$(notdir $(SRC.PGEN:.c=$O))) | 
|  | 412 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 413 | SRC.EXE=	$(TOP)Modules/python.c | 
|  | 414 | SRC.PMEXE=	pythonpm.c | 
|  | 415 |  | 
|  | 416 | # Python modules to be dynamically loaded that: | 
|  | 417 | #   1) have only single source file and require no extra libs | 
|  | 418 | #   2) use the standard module naming convention | 
|  | 419 | #      (the 'module' in ?????module.c is assumed) | 
|  | 420 | # - these can be built with implicit rules | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 421 | EASYEXTMODULES=	fpectl \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 422 | fpetest \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 423 | parser \ | 
|  | 424 | pwd \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 425 | rotor \ | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 426 | select | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 427 |  | 
|  | 428 | # Python modules to be dynamically loaded that need explicit build rules | 
|  | 429 | #  (either multiple source files and/or non-standard module naming) | 
|  | 430 | #  (NOTE: use shortened names for modules affected by 8 char name limit) | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 431 | HARDEXTMODULES=	_hotshot \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 432 | _socket \ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 433 | _testcap \ | 
| Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 434 | unicoded | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 435 |  | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 436 | # Python modules that are used as libraries and therefore must use | 
|  | 437 | # a .DLL extension | 
|  | 438 | LIBEXTMODULES= | 
|  | 439 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 440 | # Python external ($(MODULE.EXT)) modules - can be EASY or HARD | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 441 | ifeq ($(HAVE_ZLIB),yes) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 442 | HARDEXTMODULES+=	zlib | 
|  | 443 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 444 | ifeq ($(HAVE_UFC),yes) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 445 | HARDEXTMODULES+=	crypt | 
|  | 446 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 447 | ifeq ($(HAVE_TCLTK),yes) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 448 | HARDEXTMODULES+=	_tkinter | 
|  | 449 | CFLAGS+=		-DHAS_DIRENT -I/TclTk80/include | 
|  | 450 | TK_LIBS+=		-L/TclTk80/lib -ltcl80 -ltk80 | 
|  | 451 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 452 | ifeq ($(HAVE_GMPZ),yes) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 453 | HARDEXTMODULES+=	mpz | 
|  | 454 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 455 | ifeq ($(HAVE_GREADLINE),yes) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 456 | HARDEXTMODULES+=	readline | 
|  | 457 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 458 | ifeq ($(HAVE_BSDDB),yes) | 
| Andrew MacIntyre | e7a8cad | 2002-12-04 12:37:17 +0000 | [diff] [blame] | 459 | HARDEXTMODULES+=	bsddb185 | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 460 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 461 | ifeq ($(HAVE_NCURSES),yes) | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 462 | LIBEXTMODULES+=	_curses | 
|  | 463 | HARDEXTMODULES+=	_curses_ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 464 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 465 | ifeq ($(HAVE_GDBM),yes) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 466 | HARDEXTMODULES+=	gdbm dbm | 
|  | 467 | endif | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 468 | ifeq ($(HAVE_BZ2),yes) | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 469 | HARDEXTMODULES+=	bz2 | 
|  | 470 | endif | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 471 |  | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 472 | # Expat is now distributed with the Python source | 
|  | 473 | HARDEXTMODULES+=	pyexpat | 
|  | 474 | EXPAT.INC=	-I../../Modules/expat | 
|  | 475 | EXPAT.DEF=	-DHAVE_EXPAT_H -DXML_NS=1 -DXML_DTD=1 -DXML_BYTE_ORDER=12 \ | 
| Andrew MacIntyre | 4d04639 | 2003-12-25 13:25:20 +0000 | [diff] [blame] | 476 | -DXML_CONTENT_BYTES=1024 -DHAVE_MEMMOVE=1 -DHAVE_BCOPY=1 | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 477 | EXPAT.SRC=	$(addprefix ../../Modules/expat/, \ | 
|  | 478 | xmlparse.c \ | 
|  | 479 | xmlrole.c \ | 
|  | 480 | xmltok.c) | 
|  | 481 |  | 
|  | 482 | # all the external modules | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 483 | EXTERNDLLS=	$(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES))) | 
|  | 484 | EXTERNDLLS+=	$(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES))) | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 485 | EXTERNDLLS+=	$(addsuffix $(MODLIB.EXT),$(patsubst %module,%,$(LIBEXTMODULES))) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 486 |  | 
|  | 487 | # Targets | 
|  | 488 | all:  $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \ | 
| Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 489 | python_noncore | 
|  | 490 |  | 
|  | 491 | python_noncore: | 
|  | 492 | make PY_DEF= $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 493 |  | 
|  | 494 | clean: | 
|  | 495 | rm -f $(OUT)* | 
|  | 496 | rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \ | 
| Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame^] | 497 | $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT) *.dll | 
| Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 498 | find ../../Lib -name "*.py[co]" -exec rm {} ";" | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 499 |  | 
|  | 500 | lx: | 
|  | 501 | @echo Packing everything with lxLite... | 
|  | 502 | lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) | 
|  | 503 |  | 
|  | 504 | depend: $(OUTBASE) | 
|  | 505 | makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \ | 
|  | 506 | -r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN) | 
|  | 507 |  | 
|  | 508 | $(OUT): $(OUTBASE) | 
|  | 509 |  | 
|  | 510 | $(OUT) $(OUTBASE): | 
|  | 511 | mkdir.exe $@ | 
|  | 512 |  | 
|  | 513 | $(PYTHON.LIB): $(OBJ.LIB) | 
|  | 514 | rm.exe -f $@ | 
|  | 515 | $(AR) $(ARFLAGS) $@ $^ | 
|  | 516 |  | 
| Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 517 | # the Python core DLL .def file needs to have a number of non-static | 
|  | 518 | # symbols that aren't part of the Python C API removed (commented out) | 
|  | 519 | # from the DLL export list. | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 520 | $(PYTHON.DEF): $(PYTHON.LIB) | 
|  | 521 | @echo Creating .DEF file: $@ | 
|  | 522 | @echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@ | 
|  | 523 | @echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@ | 
|  | 524 | @echo PROTMODE >>$@ | 
|  | 525 | @echo DATA MULTIPLE NONSHARED >>$@ | 
|  | 526 | @echo EXPORTS >>$@ | 
| Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 527 | $(EXPLIB) -u $(PYTHON.LIB) |\ | 
| Andrew MacIntyre | bac1ea9 | 2003-07-16 13:31:11 +0000 | [diff] [blame] | 528 | sed -e "/^  .init.*/s/^ /; /" \ | 
|  | 529 | -e "/^  .pcre_.*/s/^ /; /" \ | 
|  | 530 | -e "/^  .array_methods/s/^ /; /" \ | 
|  | 531 | -e "/^  .fast_save_leave/s/^ /; /" \ | 
|  | 532 | -e "/^  .dlopen/s/^ /; /" \ | 
|  | 533 | -e "/^  .dlsym/s/^ /; /" \ | 
|  | 534 | -e "/^  .dlclose/s/^ /; /" \ | 
|  | 535 | -e "/^  .dlerror/s/^ /; /" \ | 
|  | 536 | -e "/^  ._Py_re_.*/s/^ /; /" \ | 
|  | 537 | -e "/^  ._Py_MD5.*/s/^ /; /" >>$@ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 538 |  | 
|  | 539 | $(PYTHON.IMPLIB): $(PYTHON.DEF) | 
|  | 540 | $(IMPLIB) -o $@ $^ | 
|  | 541 |  | 
|  | 542 | $(PYTHON.EXEIMP): $(PYTHON.DEF) | 
|  | 543 | $(IMPLIB) -o $@ $^ | 
|  | 544 |  | 
|  | 545 | $(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF) | 
|  | 546 |  | 
|  | 547 | # Explicit make targets for the .EXEs to be able to use LD to link | 
|  | 548 | # (so that fork() will work if required) | 
|  | 549 |  | 
|  | 550 | $(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def | 
|  | 551 | $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 552 | $(EXEOPT) -aq $(PYTHON.EXE) -h$(NFILES) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 553 |  | 
|  | 554 | $(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def | 
|  | 555 | $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.PMEXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)pythonpm.def | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 556 | $(EXEOPT) -aq $(PYTHONPM.EXE) -h$(NFILES) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 557 |  | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 558 | $(PGEN.EXE): $(OBJ.PGEN) $(OUT)pgen.def | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 559 |  | 
|  | 560 | # Explicit building instructions for those external modules that require | 
|  | 561 | # awkward handling (due e.g. to non-std naming, or multiple source files) | 
|  | 562 | # - standard modules | 
| Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 563 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 564 | _hotshot$(MODULE.EXT): $(OUT)_hotshot$O $(OUT)_hotshot_m.def $(PYTHON.IMPLIB) | 
|  | 565 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) | 
|  | 566 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 567 | _socket$(MODULE.EXT): $(OUT)socketmodule$O $(OUT)_socket_m.def $(PYTHON.IMPLIB) | 
|  | 568 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) | 
|  | 569 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 570 | # _testcapi needs to be renamed to be useful | 
|  | 571 | _testcapi$(MODULE.EXT): $(OUT)_testcapimodule$O $(OUT)_testcapi_m.def $(PYTHON.IMPLIB) | 
|  | 572 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) | 
|  | 573 |  | 
|  | 574 | _testcap$(MODULE.EXT): _testcapi$(MODULE.EXT) | 
|  | 575 | cp $^ $@ | 
|  | 576 |  | 
|  | 577 | # unicodedata needs to be renamed to be useful | 
|  | 578 | unicodedata$(MODULE.EXT): $(OUT)unicodedata$O $(OUT)unicodedata_m.def $(PYTHON.IMPLIB) | 
|  | 579 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(MODULE_LIBS) | 
|  | 580 |  | 
|  | 581 | unicoded$(MODULE.EXT): unicodedata$(MODULE.EXT) | 
|  | 582 | cp $^ $@ | 
|  | 583 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 584 | # - optional modules (requiring other software to be installed) | 
| Andrew MacIntyre | e7a8cad | 2002-12-04 12:37:17 +0000 | [diff] [blame] | 585 | bsddb185$(MODULE.EXT): $(OUT)bsddbmodule$O $(OUT)bsddb185_m.def $(PYTHON.IMPLIB) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 586 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -ldb $(LIBS) | 
|  | 587 |  | 
|  | 588 | crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB) | 
|  | 589 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS) | 
|  | 590 |  | 
|  | 591 | # The _curses_panel module requires a couple of ncurses library entry | 
|  | 592 | # points, which are best exposed as exports from the _curses module DLL | 
|  | 593 | $(OUT)_curses_m.def: | 
|  | 594 | @echo Creating .DEF file: $@ | 
|  | 595 | @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 596 | @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODLIB.EXT))$(DQUOTE) >>$@ | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 597 | @echo DATA MULTIPLE NONSHARED >>$@ | 
|  | 598 | @echo EXPORTS >>$@ | 
|  | 599 | @echo 	init_curses >>$@ | 
|  | 600 | @echo 	wnoutrefresh >>$@ | 
|  | 601 | @echo 	_nc_panelhook >>$@ | 
|  | 602 | @echo 	is_linetouched >>$@ | 
|  | 603 | @echo 	mvwin >>$@ | 
|  | 604 | @echo 	stdscr >>$@ | 
|  | 605 | @echo 	wtouchln >>$@ | 
|  | 606 |  | 
|  | 607 | $(OUT)_curses_panel_m.def: | 
|  | 608 | @echo Creating .DEF file: $@ | 
|  | 609 | @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ | 
|  | 610 | @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@ | 
|  | 611 | @echo DATA MULTIPLE NONSHARED >>$@ | 
|  | 612 | @echo IMPORTS >>$@ | 
|  | 613 | @echo 	_curses.wnoutrefresh >>$@ | 
|  | 614 | @echo 	_curses._nc_panelhook >>$@ | 
|  | 615 | @echo 	_curses.is_linetouched >>$@ | 
|  | 616 | @echo 	_curses.mvwin >>$@ | 
|  | 617 | @echo 	_curses.stdscr >>$@ | 
|  | 618 | @echo 	_curses.wtouchln >>$@ | 
|  | 619 | @echo EXPORTS >>$@ | 
|  | 620 | @echo 	init_curses_panel >>$@ | 
|  | 621 |  | 
| Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 622 | _curses$(MODLIB.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 623 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses | 
|  | 624 |  | 
|  | 625 | # curses_panel needs to be renamed to be useful | 
|  | 626 | _curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB) | 
|  | 627 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel | 
|  | 628 |  | 
|  | 629 | _curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT) | 
|  | 630 | cp $^ $@ | 
|  | 631 |  | 
|  | 632 | dbm$(MODULE.EXT): $(OUT)dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB) | 
|  | 633 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm | 
|  | 634 |  | 
|  | 635 | gdbm$(MODULE.EXT): $(OUT)gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB) | 
|  | 636 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm | 
|  | 637 |  | 
|  | 638 | mpz$(MODULE.EXT): $(OUT)mpzmodule$O $(OUT)mpz_m.def $(PYTHON.IMPLIB) | 
|  | 639 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgmp | 
|  | 640 |  | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 641 | # Expat is now distributed with Python, so use the included version | 
|  | 642 | $(OUT)pyexpat$O:	../../Modules/pyexpat.c | 
|  | 643 | $(CC) $(CFLAGS) $(EXPAT.INC) -c -o $@ $^ | 
|  | 644 | $(OUT)xmlparse$O:	../../Modules/expat/xmlparse.c | 
|  | 645 | $(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^ | 
|  | 646 | $(OUT)xmlrole$O:	../../Modules/expat/xmlrole.c | 
|  | 647 | $(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^ | 
|  | 648 | $(OUT)xmltok$O:	../../Modules/expat/xmltok.c | 
|  | 649 | $(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^ | 
|  | 650 | pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)xmlparse$O $(OUT)xmlrole$O \ | 
|  | 651 | $(OUT)xmltok$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB) | 
|  | 652 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 653 |  | 
|  | 654 | readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB) | 
|  | 655 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses | 
|  | 656 |  | 
|  | 657 | #_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O | 
|  | 658 | _tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \ | 
| Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 659 | $(OUT)_tkinter_m.def $(PYTHON.IMPLIB) | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 660 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS) | 
|  | 661 |  | 
|  | 662 | zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB) | 
|  | 663 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz | 
|  | 664 |  | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 665 | bz2$(MODULE.EXT): $(OUT)bz2module$O $(OUT)bz2_m.def $(PYTHON.IMPLIB) | 
|  | 666 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lbz2 | 
|  | 667 |  | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 668 | # the test target | 
|  | 669 | test: | 
| Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 670 | -find ../../Lib -name "*.py[co]" -exec rm {} ";" | 
|  | 671 | -./python -E -tt ../../lib/test/regrtest.py -l -u "network" | 
| Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 672 | ./python -E -tt ../../lib/test/regrtest.py -l -u "network" | 
| Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 673 |  | 
|  | 674 | -include $(OUTBASE)python.dep |