blob: c0eb412e17c4646a7ac1cbc3e1dd0813a27b116c [file] [log] [blame]
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +00001#####################==================----------------
Andrew MacIntyre41d97d62002-02-17 05:23:30 +00002#
3# Top-Level Makefile for Building Python 2.3 for OS/2 using GCC/EMX
4# Originally written by Andrew Zabolotny, <bit@eltech.ru> for Python 1.5.2
5# Modified by Andrew MacIntyre, <andymac@pcug.org.au> for Python 2.3
6#
7# This makefile was developed for use with [P]GCC/EMX compiler any
8# version and GNU Make.
9#
10# The output of the build is a largish Python23.DLL containing the
11# essential modules of Python and a small Python.exe program to start
12# the interpreter. When embedding Python within another program, only
13# Python23.DLL is needed. We also build python_s.a static library (which
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 MacIntyre4fffdff2002-08-18 06:26:33 +000024#####################==================----------------
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000025
26# === Compilation mode: debug or release ===
27MODE= optimize
28#MODE= debug
29# === Assert() enabled ===
30#ASSERTIONS=no
31ASSERTIONS=yes
32
33# === Optional modules ===
34# Do you have the InfoZip compression library installed?
35ZLIB= no
36# Do you have the Ultra Fast Crypt (UFC) library installed?
37UFC= no
38# Do you have the Tcl/Tk library installed?
39TCLTK= no
40# Do you have the GNU multiprecision library installed?
41GMPZ= no
42# Do you have the GNU readline library installed?
43# NOTE: I'm using a modified version of Kai Uwe Rommel's port that
44# - is compiled with multithreading enabled
45# - is linked statically
46# I have had no success trying to use a DLL version, even with
47# the multithreading switch.
48GREADLINE= no
49# Do you have the BSD DB library (v1.85) as included in the EMXBSD package?
50# NOTE: this library needs to be recompiled with a structure member
51# renamed to avoid problems with the multithreaded errno support
52# (there is a structure member called errno, used for shadowing the
53# real errno, which conflicts with the errno redefinition of -Zmt)
54BSDDB= no
55# Do you have the ncurses library installed? EMX's BSD curses aren't enough!
56CURSES= no
57# Do you have the expat XML parsing library installed?
58EXPAT= no
59# Do you have the GDBM library installed?
60GDBM= no
61
62# === The Tools ===
63CC= gcc
64CFLAGS= -Zmt -Wall $(INCLUDE)
65CFLAGS.LIB= $(CFLAGS)
66LD= gcc
67LDFLAGS= -Zmt -Zcrtdll -L. -lgcc
68LDFLAGS.EXE= $(LDFLAGS)
69LDFLAGS.DLL= $(LDFLAGS) -Zdll
70LDFLAGS.A= $(LDFLAGS) $(LIBS)
71ARFLAGS= crs
72IMPLIB= emximp
73EXPLIB= emxexp
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +000074EXEOPT= emxbind
75
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000076
77# adjust C compiler settings based on build options
78ifeq ($(MODE),debug)
79 CFLAGS+= -g -O
80 LDFLAGS+= -g
81else
82 CFLAGS+= -s -O2
83 LDFLAGS+= -s
84endif
85ifeq ($(ASSERTIONS),no)
86 CFLAGS+= -DNDEBUG
87endif
88
89# We're using the OMF format since EMX's ld has a obscure bug
90# because of which it sometimes fails to build relocations
91# in .data segment that point to another .data locations
92# (except for the final linking if the .EXEs)
93OMF= yes
94
95# if fork() support is required, the main executable must be linked with ld
96EXEOMF= no
97
98# File extensions
99MODULE.EXT= .pyd
100ifeq ($(OMF),yes)
101 O= .obj
102 A= .lib
103 AR= emxomfar
104 CFLAGS+= -Zomf
105 LDFLAGS+= -Zomf
106 ifeq ($(MODE),debug)
107 ARFLAGS= -p64 crs
108 else
109 ARFLAGS= -p32 crs
110 endif
111else
112 O= .o
113 A= .a
114 AR= ar
115endif
116
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000117# EMX's default number of file handles is 40, which is sometimes insufficient
118# (the tempfile regression test tries to create 100 temporary files)
119NFILES=250
120
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000121# Source file paths
122SRCPATH=.;../../Python;../../Parser;../../Objects;../../Include;../../Modules
123# Python contains the central core, containing the builtins and interpreter.
124# Parser contains Python's Internal Parser and
125# Standalone Parser Generator Program (Shares Some of Python's Modules)
126# Objects contains Python Object Types
127# Modules contains extension Modules (Built-In or as Separate DLLs)
128
129# Unix shells tend to use "$" as delimiter for variable names.
130# Test for this behaviour and set $(BUCK) variable correspondigly ...
131__TMP__:=$(shell echo $$$$)
132ifeq ($(__TMP__),$$$$)
133 BUCK= $$
134 BRO= (
135 BRC= )
136else
137 BUCK= \$$
138 BRO= \(
139 BRC= \)
140endif
141# Compute the "double quote" variable
142__TMP__:=$(shell echo "")
143ifeq ($(__TMP__),"")
144 DQUOTE= "
145else
146 DQUOTE= \"
147endif
148
149# Include paths
150#INCLUDE= -I$(subst ;, -I, $(SRCPATH))
151INCLUDE= -I. -I../../Include
152
153# Path to search for .c files
154vpath %.c .;..;$(SRCPATH)
155
156# Top of the package tree
157TOP= ../../
158
159# Directory for output files
160OUTBASE= out/
161OUT= $(OUTBASE)$(MODE)/
162
163# Additional libraries
164LIBS= -lsocket
165
166# Utility macro: replacement for $^
167^^= $(filter-out %$A,$^)
168# Use $(L^) to link with all libraries specified as dependencies
169L^= $(addprefix -l,$(basename $(notdir $(filter %$A,$+))))
170
171# Build rules
172$(OUT)%$O: %.c
173 $(CC) $(CFLAGS.LIB) -c $< -o $@
174
175%.a:
176 $(LD) $(LDFLAGS.A) -o $@ $(^^) $(L^)
177
178%.dll:
179 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
180
181%.pyd: $(OUT)%module$O $(OUT)%_m.def
182 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(PYTHON.IMPLIB) $(LIBS)
183
184%.exe:
185 $(LD) $(LDFLAGS.EXE) -o $@ $(^^) $(L^)
186
187%_m.def:
188 @echo Creating .DEF file: $@
189 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
190 ifeq ($(DESCRIPTION.$(notdir $*)$(MODULE.EXT)),)
191 @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
192 else
193 @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
194 endif
195 @echo DATA MULTIPLE NONSHARED >>$@
196 @echo EXPORTS >>$@
197 @echo init$(notdir $*) >>$@
198
199%.def:
200 @echo Creating .DEF file: $@
201 @echo NAME $(notdir $*) $(EXETYPE.$(notdir $*).exe) >$@
202 @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*).exe)$(DQUOTE) >>$@
203 @echo STACKSIZE 1048576 >>$@
204
205# Output file names
206PYTHON_VER= 2.3
207PYTHON_LIB= python23
208PYTHON.LIB= $(PYTHON_LIB)_s$A
209PYTHON.IMPLIB= $(PYTHON_LIB)$A
210ifeq ($(EXEOMF),yes)
211 PYTHON.EXEIMP= $(PYTHON.IMPLIB)
212 LDMODE.EXE= -Zomf
213else
214 PYTHON.EXEIMP= $(PYTHON_LIB).a
215 LDMODE.EXE =
216endif
217PYTHON.DLL= $(PYTHON_LIB).dll
218PYTHON.DEF= $(PYTHON_LIB).def
219PYTHON.EXE= python.exe
220PYTHONPM.EXE= pythonpm.exe
221PGEN.EXE= pgen.exe
222LIBRARY= $(PYTHON.LIB)
223LD_LIBRARY= $(PYTHON.IMPLIB)
224
225# Additional executable parameters
226EXETYPE.$(PYTHON.EXE)= WINDOWCOMPAT
227EXETYPE.$(PYTHONPM.EXE)= WINDOWAPI
228EXETYPE.$(PGEN.EXE)= WINDOWCOMPAT
229DESCRIPTION.$(PYTHON.EXE)= Python object-oriented programming language interpreter for OS/2
230DESCRIPTION.$(PYTHONPM.EXE)= $(DESCRIPTION.$(PYTHON.EXE))
231DESCRIPTION.$(PGEN.EXE)= Python object-oriented programming language parser generator for OS/2
232
233# Module descriptions
234DESCRIPTION.zlib$(MODULE.EXT)= Python Extension DLL for accessing the InfoZip compression library
235DESCRIPTION.crypt$(MODULE.EXT)= Python Extension DLL implementing the crypt$(BRO)$(BRC) function
236DESCRIPTION._tkinter$(MODULE.EXT)= Python Extension DLL for access to Tcl/Tk Environment
237DESCRIPTION.mpz$(MODULE.EXT)= Python Extension DLL for access to GNU multi-precision library
238DESCRIPTION.readline$(MODULE.EXT)= Python Extension DLL for access to GNU ReadLine library
Andrew MacIntyree7a8cad2002-12-04 12:37:17 +0000239DESCRIPTION.bsddb185$(MODULE.EXT)= Python Extension DLL for access to BSD DB (v1.85) library
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000240DESCRIPTION._curses$(MODULE.EXT)= Python Extension DLL for access to ncurses library
241DESCRIPTION.pyexpat$(MODULE.EXT)= Python Extension DLL for access to expat library
242
243# Source files
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000244SRC.OS2EMX= config.c dlfcn.c getpathp.c
245SRC.MAIN= $(addprefix $(TOP), \
246 Modules/getbuildinfo.c \
247 Modules/main.c)
248SRC.MODULES= $(addprefix $(TOP), \
249 Modules/gcmodule.c \
250 Modules/signalmodule.c \
251 Modules/posixmodule.c \
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000252 Modules/threadmodule.c)
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000253SRC.PARSE1= $(addprefix $(TOP), \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000254 Parser/acceler.c \
255 Parser/grammar1.c \
256 Parser/listnode.c \
257 Parser/node.c \
258 Parser/parser.c \
259 Parser/parsetok.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000260 Parser/bitset.c \
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000261 Parser/metagrammar.c)
262SRC.PARSE2= $(addprefix $(TOP), \
263 Parser/tokenizer.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000264 Parser/myreadline.c)
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000265SRC.PARSER= $(SRC.PARSE1) \
266 $(SRC.PARSE2)
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000267SRC.PYTHON= $(addprefix $(TOP), \
268 Python/bltinmodule.c \
269 Python/exceptions.c \
270 Python/ceval.c \
271 Python/compile.c \
272 Python/codecs.c \
273 Python/errors.c \
274 Python/frozen.c \
275 Python/frozenmain.c \
276 Python/future.c \
277 Python/getargs.c \
278 Python/getcompiler.c \
279 Python/getcopyright.c \
280 Python/getmtime.c \
281 Python/getplatform.c \
282 Python/getversion.c \
283 Python/graminit.c \
284 Python/import.c \
285 Python/importdl.c \
286 Python/marshal.c \
287 Python/modsupport.c \
288 Python/mysnprintf.c \
289 Python/mystrtoul.c \
290 Python/pyfpe.c \
291 Python/pystate.c \
292 Python/pythonrun.c \
293 Python/structmember.c \
294 Python/symtable.c \
295 Python/sysmodule.c \
296 Python/traceback.c \
297 Python/getopt.c \
298 Python/dynload_shlib.c \
299 Python/thread.c)
300SRC.OBJECT= $(addprefix $(TOP), \
301 Objects/abstract.c \
Andrew MacIntyre6c655312002-04-15 12:09:45 +0000302 Objects/boolobject.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000303 Objects/bufferobject.c \
304 Objects/cellobject.c \
305 Objects/classobject.c \
306 Objects/cobject.c \
307 Objects/complexobject.c \
308 Objects/descrobject.c \
309 Objects/dictobject.c \
Andrew MacIntyre07c639f2002-04-30 13:06:32 +0000310 Objects/enumobject.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000311 Objects/fileobject.c \
312 Objects/floatobject.c \
313 Objects/frameobject.c \
314 Objects/funcobject.c \
315 Objects/intobject.c \
316 Objects/iterobject.c \
317 Objects/listobject.c \
318 Objects/longobject.c \
319 Objects/methodobject.c \
320 Objects/moduleobject.c \
321 Objects/object.c \
Andrew MacIntyre6c655312002-04-15 12:09:45 +0000322 Objects/obmalloc.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000323 Objects/rangeobject.c \
324 Objects/sliceobject.c \
325 Objects/stringobject.c \
326 Objects/structseq.c \
327 Objects/tupleobject.c \
328 Objects/typeobject.c \
329 Objects/unicodeobject.c \
330 Objects/unicodectype.c \
331 Objects/weakrefobject.c)
332
333SRC.LIB= $(SRC.OS2EMX) \
334 $(SRC.MAIN) \
335 $(SRC.PARSER) \
336 $(SRC.OBJECT) \
337 $(SRC.PYTHON) \
338 $(SRC.MODULES)
339OBJ.LIB= $(addprefix $(OUT),$(notdir $(SRC.LIB:.c=$O)))
340
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000341SRC.PGEN= $(SRC.PARSE1) \
342 $(addprefix $(TOP), \
343 Objects/obmalloc.c) \
344 $(addprefix $(TOP), \
345 Python/mysnprintf.c) \
346 $(addprefix $(TOP), \
347 Parser/tokenizer_pgen.c \
348 Parser/pgenmain.c \
349 Parser/pgen.c \
350 Parser/printgrammar.c \
351 Parser/grammar.c \
352 Parser/firstsets.c) \
353
354OBJ.PGEN= $(addprefix $(OUT),$(notdir $(SRC.PGEN:.c=$O)))
355
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000356SRC.EXE= $(TOP)Modules/python.c
357SRC.PMEXE= pythonpm.c
358
359# Python modules to be dynamically loaded that:
360# 1) have only single source file and require no extra libs
361# 2) use the standard module naming convention
362# (the 'module' in ?????module.c is assumed)
363# - these can be built with implicit rules
364EASYEXTMODULES= array \
365 cmath \
366 _codecs \
367 dl \
368 errno \
369 fcntl \
370 fpectl \
371 fpetest \
372 _locale \
373 math \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000374 parser \
375 pwd \
376 rgbimg \
377 rotor \
378 select \
379 sha \
380 strop \
381 struct \
382 time \
383 timing
384
385# Python modules to be dynamically loaded that need explicit build rules
386# (either multiple source files and/or non-standard module naming)
387# (NOTE: use shortened names for modules affected by 8 char name limit)
388HARDEXTMODULES= binascii \
389 cPickle \
390 cStringI \
391 _hotshot \
392 imageop \
393 md5 \
394 operator \
395 pcre \
396 regex \
397 _socket \
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000398 _sre \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000399 termios \
400 _testcap \
401 unicoded \
402 _weakref \
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000403 xreadlin \
404 xxsubtyp
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000405
406# Python external ($(MODULE.EXT)) modules - can be EASY or HARD
407ifeq ($(ZLIB),yes)
408 HARDEXTMODULES+= zlib
409endif
410ifeq ($(UFC),yes)
411 HARDEXTMODULES+= crypt
412endif
413ifeq ($(TCLTK),yes)
414 HARDEXTMODULES+= _tkinter
415 CFLAGS+= -DHAS_DIRENT -I/TclTk80/include
416 TK_LIBS+= -L/TclTk80/lib -ltcl80 -ltk80
417endif
418ifeq ($(GMPZ),yes)
419 HARDEXTMODULES+= mpz
420endif
421ifeq ($(GREADLINE),yes)
422 HARDEXTMODULES+= readline
423endif
424ifeq ($(BSDDB),yes)
Andrew MacIntyree7a8cad2002-12-04 12:37:17 +0000425 HARDEXTMODULES+= bsddb185
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000426endif
427ifeq ($(CURSES),yes)
428 HARDEXTMODULES+= _curses _curses_
429endif
430ifeq ($(EXPAT),yes)
431 HARDEXTMODULES+= pyexpat
432endif
433ifeq ($(GDBM),yes)
434 HARDEXTMODULES+= gdbm dbm
435endif
436
437EXTERNDLLS= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES)))
438EXTERNDLLS+= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES)))
439
440# Targets
441all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
442 $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
443
444clean:
445 rm -f $(OUT)*
446 rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \
447 $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT)
448
449lx:
450 @echo Packing everything with lxLite...
451 lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE)
452
453depend: $(OUTBASE)
454 makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \
455 -r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN)
456
457$(OUT): $(OUTBASE)
458
459$(OUT) $(OUTBASE):
460 mkdir.exe $@
461
462$(PYTHON.LIB): $(OBJ.LIB)
463 rm.exe -f $@
464 $(AR) $(ARFLAGS) $@ $^
465
466$(PYTHON.DEF): $(PYTHON.LIB)
467 @echo Creating .DEF file: $@
468 @echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@
469 @echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@
470 @echo PROTMODE >>$@
471 @echo DATA MULTIPLE NONSHARED >>$@
472 @echo EXPORTS >>$@
473 $(EXPLIB) -u $(PYTHON.LIB) >>$@
474
475$(PYTHON.IMPLIB): $(PYTHON.DEF)
476 $(IMPLIB) -o $@ $^
477
478$(PYTHON.EXEIMP): $(PYTHON.DEF)
479 $(IMPLIB) -o $@ $^
480
481$(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF)
482
483# Explicit make targets for the .EXEs to be able to use LD to link
484# (so that fork() will work if required)
485
486$(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def
487 $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000488 $(EXEOPT) -aq $(PYTHON.EXE) -h$(NFILES)
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000489
490$(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def
491 $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.PMEXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)pythonpm.def
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000492 $(EXEOPT) -aq $(PYTHONPM.EXE) -h$(NFILES)
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000493
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000494$(PGEN.EXE): $(OBJ.PGEN) $(OUT)pgen.def
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000495
496# Explicit building instructions for those external modules that require
497# awkward handling (due e.g. to non-std naming, or multiple source files)
498# - standard modules
499binascii$(MODULE.EXT): $(OUT)binascii$O $(OUT)binascii_m.def $(PYTHON.IMPLIB)
500 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
501
502cPickle$(MODULE.EXT): $(OUT)cPickle$O $(OUT)cPickle_m.def $(PYTHON.IMPLIB)
503 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
504
505# cStringIO needs to be renamed to be useful (8 char DLL name limit)
506cStringIO$(MODULE.EXT): $(OUT)cStringIO$O $(OUT)cStringIO_m.def $(PYTHON.IMPLIB)
507 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
508
509cStringI$(MODULE.EXT): cStringIO$(MODULE.EXT)
510 cp $^ $@
511
512_hotshot$(MODULE.EXT): $(OUT)_hotshot$O $(OUT)_hotshot_m.def $(PYTHON.IMPLIB)
513 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
514
515imageop$(MODULE.EXT): $(OUT)imageop$O $(OUT)imageop_m.def $(PYTHON.IMPLIB)
516 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
517
518md5$(MODULE.EXT): $(OUT)md5module$O $(OUT)md5c$O $(OUT)md5_m.def $(PYTHON.IMPLIB)
519 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
520
521operator$(MODULE.EXT): $(OUT)operator$O $(OUT)operator_m.def $(PYTHON.IMPLIB)
522 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
523
524pcre$(MODULE.EXT): $(OUT)pcremodule$O $(OUT)pypcre$O $(OUT)pcre_m.def $(PYTHON.IMPLIB)
525 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
526
527regex$(MODULE.EXT): $(OUT)regexmodule$O $(OUT)regexpr$O $(OUT)regex_m.def $(PYTHON.IMPLIB)
528 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
529
530_socket$(MODULE.EXT): $(OUT)socketmodule$O $(OUT)_socket_m.def $(PYTHON.IMPLIB)
531 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
532
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000533_sre$(MODULE.EXT): $(OUT)_sre$O $(OUT)_sre_m.def $(PYTHON.IMPLIB)
534 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
535
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000536# _symtable needs to be renamed to be useful
537_symtable$(MODULE.EXT): $(OUT)symtablemodule$O $(OUT)_symtable_m.def $(PYTHON.IMPLIB)
538 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
539
540_symtabl$(MODULE.EXT): _symtable$(MODULE.EXT)
541 cp $^ $@
542
543termios$(MODULE.EXT): $(OUT)termios$O $(OUT)termios_m.def $(PYTHON.IMPLIB)
544 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
545
546# _testcapi needs to be renamed to be useful
547_testcapi$(MODULE.EXT): $(OUT)_testcapimodule$O $(OUT)_testcapi_m.def $(PYTHON.IMPLIB)
548 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
549
550_testcap$(MODULE.EXT): _testcapi$(MODULE.EXT)
551 cp $^ $@
552
553# unicodedata needs to be renamed to be useful
554unicodedata$(MODULE.EXT): $(OUT)unicodedata$O $(OUT)unicodedata_m.def $(PYTHON.IMPLIB)
555 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(MODULE_LIBS)
556
557unicoded$(MODULE.EXT): unicodedata$(MODULE.EXT)
558 cp $^ $@
559
560_weakref$(MODULE.EXT): $(OUT)_weakref$O $(OUT)_weakref_m.def $(PYTHON.IMPLIB)
561 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
562
563# xreadlines needs to be renamed to be useful
564xreadlines$(MODULE.EXT): $(OUT)xreadlinesmodule$O $(OUT)xreadlines_m.def $(PYTHON.IMPLIB)
565 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
566
567xreadlin$(MODULE.EXT): xreadlines$(MODULE.EXT)
568 cp $^ $@
569
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000570# xxsubtype needs to be renamed to be useful
571xxsubtype$(MODULE.EXT): $(OUT)xxsubtype$O $(OUT)xxsubtype_m.def $(PYTHON.IMPLIB)
572 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
573
574xxsubtyp$(MODULE.EXT): xxsubtype$(MODULE.EXT)
575 cp $^ $@
576
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000577# - optional modules (requiring other software to be installed)
Andrew MacIntyree7a8cad2002-12-04 12:37:17 +0000578bsddb185$(MODULE.EXT): $(OUT)bsddbmodule$O $(OUT)bsddb185_m.def $(PYTHON.IMPLIB)
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000579 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -ldb $(LIBS)
580
581crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB)
582 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS)
583
584# The _curses_panel module requires a couple of ncurses library entry
585# points, which are best exposed as exports from the _curses module DLL
586$(OUT)_curses_m.def:
587 @echo Creating .DEF file: $@
588 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
589 @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
590 @echo DATA MULTIPLE NONSHARED >>$@
591 @echo EXPORTS >>$@
592 @echo init_curses >>$@
593 @echo wnoutrefresh >>$@
594 @echo _nc_panelhook >>$@
595 @echo is_linetouched >>$@
596 @echo mvwin >>$@
597 @echo stdscr >>$@
598 @echo wtouchln >>$@
599
600$(OUT)_curses_panel_m.def:
601 @echo Creating .DEF file: $@
602 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
603 @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
604 @echo DATA MULTIPLE NONSHARED >>$@
605 @echo IMPORTS >>$@
606 @echo _curses.wnoutrefresh >>$@
607 @echo _curses._nc_panelhook >>$@
608 @echo _curses.is_linetouched >>$@
609 @echo _curses.mvwin >>$@
610 @echo _curses.stdscr >>$@
611 @echo _curses.wtouchln >>$@
612 @echo EXPORTS >>$@
613 @echo init_curses_panel >>$@
614
615_curses$(MODULE.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB)
616 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses
617
618# curses_panel needs to be renamed to be useful
619_curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB)
620 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel
621
622_curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT)
623 cp $^ $@
624
625dbm$(MODULE.EXT): $(OUT)dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB)
626 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
627
628gdbm$(MODULE.EXT): $(OUT)gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB)
629 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
630
631mpz$(MODULE.EXT): $(OUT)mpzmodule$O $(OUT)mpz_m.def $(PYTHON.IMPLIB)
632 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgmp
633
634pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB)
635 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lexpat
636
637readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB)
638 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses
639
640#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
641_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
642 $(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
643 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
644
645zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB)
646 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz
647
648# the test target
649test:
Andrew MacIntyre4fffdff2002-08-18 06:26:33 +0000650 ./python -E -tt ../../lib/test/regrtest.py -l -u "network"
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000651
652-include $(OUTBASE)python.dep