blob: dcd6d1638ea55d282e0e2b1146fc5e17c1a99a04 [file] [log] [blame]
Andrew MacIntyre07c639f2002-04-30 13:06:32 +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 MacIntyre07c639f2002-04-30 13:06:32 +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
74
75# adjust C compiler settings based on build options
76ifeq ($(MODE),debug)
77 CFLAGS+= -g -O
78 LDFLAGS+= -g
79else
80 CFLAGS+= -s -O2
81 LDFLAGS+= -s
82endif
83ifeq ($(ASSERTIONS),no)
84 CFLAGS+= -DNDEBUG
85endif
86
87# We're using the OMF format since EMX's ld has a obscure bug
88# because of which it sometimes fails to build relocations
89# in .data segment that point to another .data locations
90# (except for the final linking if the .EXEs)
91OMF= yes
92
93# if fork() support is required, the main executable must be linked with ld
94EXEOMF= no
95
96# File extensions
97MODULE.EXT= .pyd
98ifeq ($(OMF),yes)
99 O= .obj
100 A= .lib
101 AR= emxomfar
102 CFLAGS+= -Zomf
103 LDFLAGS+= -Zomf
104 ifeq ($(MODE),debug)
105 ARFLAGS= -p64 crs
106 else
107 ARFLAGS= -p32 crs
108 endif
109else
110 O= .o
111 A= .a
112 AR= ar
113endif
114
115# Source file paths
116SRCPATH=.;../../Python;../../Parser;../../Objects;../../Include;../../Modules
117# Python contains the central core, containing the builtins and interpreter.
118# Parser contains Python's Internal Parser and
119# Standalone Parser Generator Program (Shares Some of Python's Modules)
120# Objects contains Python Object Types
121# Modules contains extension Modules (Built-In or as Separate DLLs)
122
123# Unix shells tend to use "$" as delimiter for variable names.
124# Test for this behaviour and set $(BUCK) variable correspondigly ...
125__TMP__:=$(shell echo $$$$)
126ifeq ($(__TMP__),$$$$)
127 BUCK= $$
128 BRO= (
129 BRC= )
130else
131 BUCK= \$$
132 BRO= \(
133 BRC= \)
134endif
135# Compute the "double quote" variable
136__TMP__:=$(shell echo "")
137ifeq ($(__TMP__),"")
138 DQUOTE= "
139else
140 DQUOTE= \"
141endif
142
143# Include paths
144#INCLUDE= -I$(subst ;, -I, $(SRCPATH))
145INCLUDE= -I. -I../../Include
146
147# Path to search for .c files
148vpath %.c .;..;$(SRCPATH)
149
150# Top of the package tree
151TOP= ../../
152
153# Directory for output files
154OUTBASE= out/
155OUT= $(OUTBASE)$(MODE)/
156
157# Additional libraries
158LIBS= -lsocket
159
160# Utility macro: replacement for $^
161^^= $(filter-out %$A,$^)
162# Use $(L^) to link with all libraries specified as dependencies
163L^= $(addprefix -l,$(basename $(notdir $(filter %$A,$+))))
164
165# Build rules
166$(OUT)%$O: %.c
167 $(CC) $(CFLAGS.LIB) -c $< -o $@
168
169%.a:
170 $(LD) $(LDFLAGS.A) -o $@ $(^^) $(L^)
171
172%.dll:
173 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
174
175%.pyd: $(OUT)%module$O $(OUT)%_m.def
176 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(PYTHON.IMPLIB) $(LIBS)
177
178%.exe:
179 $(LD) $(LDFLAGS.EXE) -o $@ $(^^) $(L^)
180
181%_m.def:
182 @echo Creating .DEF file: $@
183 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
184 ifeq ($(DESCRIPTION.$(notdir $*)$(MODULE.EXT)),)
185 @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
186 else
187 @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
188 endif
189 @echo DATA MULTIPLE NONSHARED >>$@
190 @echo EXPORTS >>$@
191 @echo init$(notdir $*) >>$@
192
193%.def:
194 @echo Creating .DEF file: $@
195 @echo NAME $(notdir $*) $(EXETYPE.$(notdir $*).exe) >$@
196 @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*).exe)$(DQUOTE) >>$@
197 @echo STACKSIZE 1048576 >>$@
198
199# Output file names
200PYTHON_VER= 2.3
201PYTHON_LIB= python23
202PYTHON.LIB= $(PYTHON_LIB)_s$A
203PYTHON.IMPLIB= $(PYTHON_LIB)$A
204ifeq ($(EXEOMF),yes)
205 PYTHON.EXEIMP= $(PYTHON.IMPLIB)
206 LDMODE.EXE= -Zomf
207else
208 PYTHON.EXEIMP= $(PYTHON_LIB).a
209 LDMODE.EXE =
210endif
211PYTHON.DLL= $(PYTHON_LIB).dll
212PYTHON.DEF= $(PYTHON_LIB).def
213PYTHON.EXE= python.exe
214PYTHONPM.EXE= pythonpm.exe
215PGEN.EXE= pgen.exe
216LIBRARY= $(PYTHON.LIB)
217LD_LIBRARY= $(PYTHON.IMPLIB)
218
219# Additional executable parameters
220EXETYPE.$(PYTHON.EXE)= WINDOWCOMPAT
221EXETYPE.$(PYTHONPM.EXE)= WINDOWAPI
222EXETYPE.$(PGEN.EXE)= WINDOWCOMPAT
223DESCRIPTION.$(PYTHON.EXE)= Python object-oriented programming language interpreter for OS/2
224DESCRIPTION.$(PYTHONPM.EXE)= $(DESCRIPTION.$(PYTHON.EXE))
225DESCRIPTION.$(PGEN.EXE)= Python object-oriented programming language parser generator for OS/2
226
227# Module descriptions
228DESCRIPTION.zlib$(MODULE.EXT)= Python Extension DLL for accessing the InfoZip compression library
229DESCRIPTION.crypt$(MODULE.EXT)= Python Extension DLL implementing the crypt$(BRO)$(BRC) function
230DESCRIPTION._tkinter$(MODULE.EXT)= Python Extension DLL for access to Tcl/Tk Environment
231DESCRIPTION.mpz$(MODULE.EXT)= Python Extension DLL for access to GNU multi-precision library
232DESCRIPTION.readline$(MODULE.EXT)= Python Extension DLL for access to GNU ReadLine library
233DESCRIPTION.bsddb$(MODULE.EXT)= Python Extension DLL for access to BSD DB (v1.85) library
234DESCRIPTION._curses$(MODULE.EXT)= Python Extension DLL for access to ncurses library
235DESCRIPTION.pyexpat$(MODULE.EXT)= Python Extension DLL for access to expat library
236
237# Source files
238SRC.PGEN= $(addprefix ../../Parser/, \
239 pgenmain.c \
240 pgen.c \
241 printgrammar.c \
242 grammar.c \
243 bitset.c \
244 firstsets.c)
245OBJ.PGEN= $(addprefix $(OUT),$(notdir $(SRC.PGEN:.c=$O)))
246
247SRC.OS2EMX= config.c dlfcn.c getpathp.c
248SRC.MAIN= $(addprefix $(TOP), \
249 Modules/getbuildinfo.c \
250 Modules/main.c)
251SRC.MODULES= $(addprefix $(TOP), \
252 Modules/gcmodule.c \
253 Modules/signalmodule.c \
254 Modules/posixmodule.c \
255 Modules/threadmodule.c \
256 Modules/_sre.c)
257SRC.PARSER= $(addprefix $(TOP), \
258 Parser/acceler.c \
259 Parser/grammar1.c \
260 Parser/listnode.c \
261 Parser/node.c \
262 Parser/parser.c \
263 Parser/parsetok.c \
264 Parser/tokenizer.c \
265 Parser/bitset.c \
266 Parser/metagrammar.c \
267 Parser/myreadline.c)
268SRC.PYTHON= $(addprefix $(TOP), \
269 Python/bltinmodule.c \
270 Python/exceptions.c \
271 Python/ceval.c \
272 Python/compile.c \
273 Python/codecs.c \
274 Python/errors.c \
275 Python/frozen.c \
276 Python/frozenmain.c \
277 Python/future.c \
278 Python/getargs.c \
279 Python/getcompiler.c \
280 Python/getcopyright.c \
281 Python/getmtime.c \
282 Python/getplatform.c \
283 Python/getversion.c \
284 Python/graminit.c \
285 Python/import.c \
286 Python/importdl.c \
287 Python/marshal.c \
288 Python/modsupport.c \
289 Python/mysnprintf.c \
290 Python/mystrtoul.c \
291 Python/pyfpe.c \
292 Python/pystate.c \
293 Python/pythonrun.c \
294 Python/structmember.c \
295 Python/symtable.c \
296 Python/sysmodule.c \
297 Python/traceback.c \
298 Python/getopt.c \
299 Python/dynload_shlib.c \
300 Python/thread.c)
301SRC.OBJECT= $(addprefix $(TOP), \
302 Objects/abstract.c \
Andrew MacIntyre6c655312002-04-15 12:09:45 +0000303 Objects/boolobject.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000304 Objects/bufferobject.c \
305 Objects/cellobject.c \
306 Objects/classobject.c \
307 Objects/cobject.c \
308 Objects/complexobject.c \
309 Objects/descrobject.c \
310 Objects/dictobject.c \
Andrew MacIntyre07c639f2002-04-30 13:06:32 +0000311 Objects/enumobject.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000312 Objects/fileobject.c \
313 Objects/floatobject.c \
314 Objects/frameobject.c \
315 Objects/funcobject.c \
316 Objects/intobject.c \
317 Objects/iterobject.c \
318 Objects/listobject.c \
319 Objects/longobject.c \
320 Objects/methodobject.c \
321 Objects/moduleobject.c \
322 Objects/object.c \
Andrew MacIntyre6c655312002-04-15 12:09:45 +0000323 Objects/obmalloc.c \
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000324 Objects/rangeobject.c \
325 Objects/sliceobject.c \
326 Objects/stringobject.c \
327 Objects/structseq.c \
328 Objects/tupleobject.c \
329 Objects/typeobject.c \
330 Objects/unicodeobject.c \
331 Objects/unicodectype.c \
332 Objects/weakrefobject.c)
333
334SRC.LIB= $(SRC.OS2EMX) \
335 $(SRC.MAIN) \
336 $(SRC.PARSER) \
337 $(SRC.OBJECT) \
338 $(SRC.PYTHON) \
339 $(SRC.MODULES)
340OBJ.LIB= $(addprefix $(OUT),$(notdir $(SRC.LIB:.c=$O)))
341
342SRC.EXE= $(TOP)Modules/python.c
343SRC.PMEXE= pythonpm.c
344
345# Python modules to be dynamically loaded that:
346# 1) have only single source file and require no extra libs
347# 2) use the standard module naming convention
348# (the 'module' in ?????module.c is assumed)
349# - these can be built with implicit rules
350EASYEXTMODULES= array \
351 cmath \
352 _codecs \
353 dl \
354 errno \
355 fcntl \
356 fpectl \
357 fpetest \
358 _locale \
359 math \
360 new \
361 parser \
362 pwd \
363 rgbimg \
364 rotor \
365 select \
366 sha \
367 strop \
368 struct \
369 time \
370 timing
371
372# Python modules to be dynamically loaded that need explicit build rules
373# (either multiple source files and/or non-standard module naming)
374# (NOTE: use shortened names for modules affected by 8 char name limit)
375HARDEXTMODULES= binascii \
376 cPickle \
377 cStringI \
378 _hotshot \
379 imageop \
380 md5 \
381 operator \
382 pcre \
383 regex \
384 _socket \
385 termios \
386 _testcap \
387 unicoded \
388 _weakref \
389 xreadlin
390
391# Python external ($(MODULE.EXT)) modules - can be EASY or HARD
392ifeq ($(ZLIB),yes)
393 HARDEXTMODULES+= zlib
394endif
395ifeq ($(UFC),yes)
396 HARDEXTMODULES+= crypt
397endif
398ifeq ($(TCLTK),yes)
399 HARDEXTMODULES+= _tkinter
400 CFLAGS+= -DHAS_DIRENT -I/TclTk80/include
401 TK_LIBS+= -L/TclTk80/lib -ltcl80 -ltk80
402endif
403ifeq ($(GMPZ),yes)
404 HARDEXTMODULES+= mpz
405endif
406ifeq ($(GREADLINE),yes)
407 HARDEXTMODULES+= readline
408endif
409ifeq ($(BSDDB),yes)
410 HARDEXTMODULES+= bsddb
411endif
412ifeq ($(CURSES),yes)
413 HARDEXTMODULES+= _curses _curses_
414endif
415ifeq ($(EXPAT),yes)
416 HARDEXTMODULES+= pyexpat
417endif
418ifeq ($(GDBM),yes)
419 HARDEXTMODULES+= gdbm dbm
420endif
421
422EXTERNDLLS= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES)))
423EXTERNDLLS+= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES)))
424
425# Targets
426all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
427 $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
428
429clean:
430 rm -f $(OUT)*
431 rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \
432 $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT)
433
434lx:
435 @echo Packing everything with lxLite...
436 lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE)
437
438depend: $(OUTBASE)
439 makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \
440 -r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN)
441
442$(OUT): $(OUTBASE)
443
444$(OUT) $(OUTBASE):
445 mkdir.exe $@
446
447$(PYTHON.LIB): $(OBJ.LIB)
448 rm.exe -f $@
449 $(AR) $(ARFLAGS) $@ $^
450
451$(PYTHON.DEF): $(PYTHON.LIB)
452 @echo Creating .DEF file: $@
453 @echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@
454 @echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@
455 @echo PROTMODE >>$@
456 @echo DATA MULTIPLE NONSHARED >>$@
457 @echo EXPORTS >>$@
458 $(EXPLIB) -u $(PYTHON.LIB) >>$@
459
460$(PYTHON.IMPLIB): $(PYTHON.DEF)
461 $(IMPLIB) -o $@ $^
462
463$(PYTHON.EXEIMP): $(PYTHON.DEF)
464 $(IMPLIB) -o $@ $^
465
466$(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF)
467
468# Explicit make targets for the .EXEs to be able to use LD to link
469# (so that fork() will work if required)
470
471$(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def
472 $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def
473
474$(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def
475 $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.PMEXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)pythonpm.def
476
477$(PGEN.EXE): $(OBJ.PGEN) $(PYTHON.LIB) $(OUT)pgen.def
478
479# Explicit building instructions for those external modules that require
480# awkward handling (due e.g. to non-std naming, or multiple source files)
481# - standard modules
482binascii$(MODULE.EXT): $(OUT)binascii$O $(OUT)binascii_m.def $(PYTHON.IMPLIB)
483 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
484
485cPickle$(MODULE.EXT): $(OUT)cPickle$O $(OUT)cPickle_m.def $(PYTHON.IMPLIB)
486 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
487
488# cStringIO needs to be renamed to be useful (8 char DLL name limit)
489cStringIO$(MODULE.EXT): $(OUT)cStringIO$O $(OUT)cStringIO_m.def $(PYTHON.IMPLIB)
490 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
491
492cStringI$(MODULE.EXT): cStringIO$(MODULE.EXT)
493 cp $^ $@
494
495_hotshot$(MODULE.EXT): $(OUT)_hotshot$O $(OUT)_hotshot_m.def $(PYTHON.IMPLIB)
496 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
497
498imageop$(MODULE.EXT): $(OUT)imageop$O $(OUT)imageop_m.def $(PYTHON.IMPLIB)
499 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
500
501md5$(MODULE.EXT): $(OUT)md5module$O $(OUT)md5c$O $(OUT)md5_m.def $(PYTHON.IMPLIB)
502 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
503
504operator$(MODULE.EXT): $(OUT)operator$O $(OUT)operator_m.def $(PYTHON.IMPLIB)
505 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
506
507pcre$(MODULE.EXT): $(OUT)pcremodule$O $(OUT)pypcre$O $(OUT)pcre_m.def $(PYTHON.IMPLIB)
508 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
509
510regex$(MODULE.EXT): $(OUT)regexmodule$O $(OUT)regexpr$O $(OUT)regex_m.def $(PYTHON.IMPLIB)
511 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
512
513_socket$(MODULE.EXT): $(OUT)socketmodule$O $(OUT)_socket_m.def $(PYTHON.IMPLIB)
514 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
515
516# _symtable needs to be renamed to be useful
517_symtable$(MODULE.EXT): $(OUT)symtablemodule$O $(OUT)_symtable_m.def $(PYTHON.IMPLIB)
518 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
519
520_symtabl$(MODULE.EXT): _symtable$(MODULE.EXT)
521 cp $^ $@
522
523termios$(MODULE.EXT): $(OUT)termios$O $(OUT)termios_m.def $(PYTHON.IMPLIB)
524 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
525
526# _testcapi needs to be renamed to be useful
527_testcapi$(MODULE.EXT): $(OUT)_testcapimodule$O $(OUT)_testcapi_m.def $(PYTHON.IMPLIB)
528 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
529
530_testcap$(MODULE.EXT): _testcapi$(MODULE.EXT)
531 cp $^ $@
532
533# unicodedata needs to be renamed to be useful
534unicodedata$(MODULE.EXT): $(OUT)unicodedata$O $(OUT)unicodedata_m.def $(PYTHON.IMPLIB)
535 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(MODULE_LIBS)
536
537unicoded$(MODULE.EXT): unicodedata$(MODULE.EXT)
538 cp $^ $@
539
540_weakref$(MODULE.EXT): $(OUT)_weakref$O $(OUT)_weakref_m.def $(PYTHON.IMPLIB)
541 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
542
543# xreadlines needs to be renamed to be useful
544xreadlines$(MODULE.EXT): $(OUT)xreadlinesmodule$O $(OUT)xreadlines_m.def $(PYTHON.IMPLIB)
545 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
546
547xreadlin$(MODULE.EXT): xreadlines$(MODULE.EXT)
548 cp $^ $@
549
550# - optional modules (requiring other software to be installed)
551bsddb$(MODULE.EXT): $(OUT)bsddbmodule$O $(OUT)bsddb_m.def $(PYTHON.IMPLIB)
552 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -ldb $(LIBS)
553
554crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB)
555 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS)
556
557# The _curses_panel module requires a couple of ncurses library entry
558# points, which are best exposed as exports from the _curses module DLL
559$(OUT)_curses_m.def:
560 @echo Creating .DEF file: $@
561 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
562 @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
563 @echo DATA MULTIPLE NONSHARED >>$@
564 @echo EXPORTS >>$@
565 @echo init_curses >>$@
566 @echo wnoutrefresh >>$@
567 @echo _nc_panelhook >>$@
568 @echo is_linetouched >>$@
569 @echo mvwin >>$@
570 @echo stdscr >>$@
571 @echo wtouchln >>$@
572
573$(OUT)_curses_panel_m.def:
574 @echo Creating .DEF file: $@
575 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
576 @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
577 @echo DATA MULTIPLE NONSHARED >>$@
578 @echo IMPORTS >>$@
579 @echo _curses.wnoutrefresh >>$@
580 @echo _curses._nc_panelhook >>$@
581 @echo _curses.is_linetouched >>$@
582 @echo _curses.mvwin >>$@
583 @echo _curses.stdscr >>$@
584 @echo _curses.wtouchln >>$@
585 @echo EXPORTS >>$@
586 @echo init_curses_panel >>$@
587
588_curses$(MODULE.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB)
589 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses
590
591# curses_panel needs to be renamed to be useful
592_curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB)
593 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel
594
595_curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT)
596 cp $^ $@
597
598dbm$(MODULE.EXT): $(OUT)dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB)
599 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
600
601gdbm$(MODULE.EXT): $(OUT)gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB)
602 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
603
604mpz$(MODULE.EXT): $(OUT)mpzmodule$O $(OUT)mpz_m.def $(PYTHON.IMPLIB)
605 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgmp
606
607pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB)
608 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lexpat
609
610readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB)
611 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses
612
613#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
614_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
615 $(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
616 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
617
618zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB)
619 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz
620
621# the test target
622test:
623 ./python -tt ../../lib/test/regrtest.py -l -u "network"
624
625-include $(OUTBASE)python.dep