blob: f4ed5100e20c3aa0b622a3a8adc6af8135830949 [file] [log] [blame]
Andrew MacIntyre41d97d62002-02-17 05:23:30 +00001#####################==================----------------úúúúúúúúúúúúú
2#
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#
24#####################==================----------------úúúúúúúúúúúúú
25
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 \
311 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
341SRC.EXE= $(TOP)Modules/python.c
342SRC.PMEXE= pythonpm.c
343
344# Python modules to be dynamically loaded that:
345# 1) have only single source file and require no extra libs
346# 2) use the standard module naming convention
347# (the 'module' in ?????module.c is assumed)
348# - these can be built with implicit rules
349EASYEXTMODULES= array \
350 cmath \
351 _codecs \
352 dl \
353 errno \
354 fcntl \
355 fpectl \
356 fpetest \
357 _locale \
358 math \
359 new \
360 parser \
361 pwd \
362 rgbimg \
363 rotor \
364 select \
365 sha \
366 strop \
367 struct \
368 time \
369 timing
370
371# Python modules to be dynamically loaded that need explicit build rules
372# (either multiple source files and/or non-standard module naming)
373# (NOTE: use shortened names for modules affected by 8 char name limit)
374HARDEXTMODULES= binascii \
375 cPickle \
376 cStringI \
377 _hotshot \
378 imageop \
379 md5 \
380 operator \
381 pcre \
382 regex \
383 _socket \
384 termios \
385 _testcap \
386 unicoded \
387 _weakref \
388 xreadlin
389
390# Python external ($(MODULE.EXT)) modules - can be EASY or HARD
391ifeq ($(ZLIB),yes)
392 HARDEXTMODULES+= zlib
393endif
394ifeq ($(UFC),yes)
395 HARDEXTMODULES+= crypt
396endif
397ifeq ($(TCLTK),yes)
398 HARDEXTMODULES+= _tkinter
399 CFLAGS+= -DHAS_DIRENT -I/TclTk80/include
400 TK_LIBS+= -L/TclTk80/lib -ltcl80 -ltk80
401endif
402ifeq ($(GMPZ),yes)
403 HARDEXTMODULES+= mpz
404endif
405ifeq ($(GREADLINE),yes)
406 HARDEXTMODULES+= readline
407endif
408ifeq ($(BSDDB),yes)
409 HARDEXTMODULES+= bsddb
410endif
411ifeq ($(CURSES),yes)
412 HARDEXTMODULES+= _curses _curses_
413endif
414ifeq ($(EXPAT),yes)
415 HARDEXTMODULES+= pyexpat
416endif
417ifeq ($(GDBM),yes)
418 HARDEXTMODULES+= gdbm dbm
419endif
420
421EXTERNDLLS= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES)))
422EXTERNDLLS+= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES)))
423
424# Targets
425all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
426 $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
427
428clean:
429 rm -f $(OUT)*
430 rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \
431 $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT)
432
433lx:
434 @echo Packing everything with lxLite...
435 lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE)
436
437depend: $(OUTBASE)
438 makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \
439 -r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN)
440
441$(OUT): $(OUTBASE)
442
443$(OUT) $(OUTBASE):
444 mkdir.exe $@
445
446$(PYTHON.LIB): $(OBJ.LIB)
447 rm.exe -f $@
448 $(AR) $(ARFLAGS) $@ $^
449
450$(PYTHON.DEF): $(PYTHON.LIB)
451 @echo Creating .DEF file: $@
452 @echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@
453 @echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@
454 @echo PROTMODE >>$@
455 @echo DATA MULTIPLE NONSHARED >>$@
456 @echo EXPORTS >>$@
457 $(EXPLIB) -u $(PYTHON.LIB) >>$@
458
459$(PYTHON.IMPLIB): $(PYTHON.DEF)
460 $(IMPLIB) -o $@ $^
461
462$(PYTHON.EXEIMP): $(PYTHON.DEF)
463 $(IMPLIB) -o $@ $^
464
465$(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF)
466
467# Explicit make targets for the .EXEs to be able to use LD to link
468# (so that fork() will work if required)
469
470$(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def
471 $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def
472
473$(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def
474 $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.PMEXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)pythonpm.def
475
476$(PGEN.EXE): $(OBJ.PGEN) $(PYTHON.LIB) $(OUT)pgen.def
477
478# Explicit building instructions for those external modules that require
479# awkward handling (due e.g. to non-std naming, or multiple source files)
480# - standard modules
481binascii$(MODULE.EXT): $(OUT)binascii$O $(OUT)binascii_m.def $(PYTHON.IMPLIB)
482 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
483
484cPickle$(MODULE.EXT): $(OUT)cPickle$O $(OUT)cPickle_m.def $(PYTHON.IMPLIB)
485 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
486
487# cStringIO needs to be renamed to be useful (8 char DLL name limit)
488cStringIO$(MODULE.EXT): $(OUT)cStringIO$O $(OUT)cStringIO_m.def $(PYTHON.IMPLIB)
489 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
490
491cStringI$(MODULE.EXT): cStringIO$(MODULE.EXT)
492 cp $^ $@
493
494_hotshot$(MODULE.EXT): $(OUT)_hotshot$O $(OUT)_hotshot_m.def $(PYTHON.IMPLIB)
495 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
496
497imageop$(MODULE.EXT): $(OUT)imageop$O $(OUT)imageop_m.def $(PYTHON.IMPLIB)
498 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
499
500md5$(MODULE.EXT): $(OUT)md5module$O $(OUT)md5c$O $(OUT)md5_m.def $(PYTHON.IMPLIB)
501 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
502
503operator$(MODULE.EXT): $(OUT)operator$O $(OUT)operator_m.def $(PYTHON.IMPLIB)
504 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
505
506pcre$(MODULE.EXT): $(OUT)pcremodule$O $(OUT)pypcre$O $(OUT)pcre_m.def $(PYTHON.IMPLIB)
507 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
508
509regex$(MODULE.EXT): $(OUT)regexmodule$O $(OUT)regexpr$O $(OUT)regex_m.def $(PYTHON.IMPLIB)
510 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
511
512_socket$(MODULE.EXT): $(OUT)socketmodule$O $(OUT)_socket_m.def $(PYTHON.IMPLIB)
513 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
514
515# _symtable needs to be renamed to be useful
516_symtable$(MODULE.EXT): $(OUT)symtablemodule$O $(OUT)_symtable_m.def $(PYTHON.IMPLIB)
517 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
518
519_symtabl$(MODULE.EXT): _symtable$(MODULE.EXT)
520 cp $^ $@
521
522termios$(MODULE.EXT): $(OUT)termios$O $(OUT)termios_m.def $(PYTHON.IMPLIB)
523 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
524
525# _testcapi needs to be renamed to be useful
526_testcapi$(MODULE.EXT): $(OUT)_testcapimodule$O $(OUT)_testcapi_m.def $(PYTHON.IMPLIB)
527 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
528
529_testcap$(MODULE.EXT): _testcapi$(MODULE.EXT)
530 cp $^ $@
531
532# unicodedata needs to be renamed to be useful
533unicodedata$(MODULE.EXT): $(OUT)unicodedata$O $(OUT)unicodedata_m.def $(PYTHON.IMPLIB)
534 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(MODULE_LIBS)
535
536unicoded$(MODULE.EXT): unicodedata$(MODULE.EXT)
537 cp $^ $@
538
539_weakref$(MODULE.EXT): $(OUT)_weakref$O $(OUT)_weakref_m.def $(PYTHON.IMPLIB)
540 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
541
542# xreadlines needs to be renamed to be useful
543xreadlines$(MODULE.EXT): $(OUT)xreadlinesmodule$O $(OUT)xreadlines_m.def $(PYTHON.IMPLIB)
544 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS)
545
546xreadlin$(MODULE.EXT): xreadlines$(MODULE.EXT)
547 cp $^ $@
548
549# - optional modules (requiring other software to be installed)
550bsddb$(MODULE.EXT): $(OUT)bsddbmodule$O $(OUT)bsddb_m.def $(PYTHON.IMPLIB)
551 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -ldb $(LIBS)
552
553crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB)
554 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS)
555
556# The _curses_panel module requires a couple of ncurses library entry
557# points, which are best exposed as exports from the _curses module DLL
558$(OUT)_curses_m.def:
559 @echo Creating .DEF file: $@
560 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
561 @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
562 @echo DATA MULTIPLE NONSHARED >>$@
563 @echo EXPORTS >>$@
564 @echo init_curses >>$@
565 @echo wnoutrefresh >>$@
566 @echo _nc_panelhook >>$@
567 @echo is_linetouched >>$@
568 @echo mvwin >>$@
569 @echo stdscr >>$@
570 @echo wtouchln >>$@
571
572$(OUT)_curses_panel_m.def:
573 @echo Creating .DEF file: $@
574 @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
575 @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@
576 @echo DATA MULTIPLE NONSHARED >>$@
577 @echo IMPORTS >>$@
578 @echo _curses.wnoutrefresh >>$@
579 @echo _curses._nc_panelhook >>$@
580 @echo _curses.is_linetouched >>$@
581 @echo _curses.mvwin >>$@
582 @echo _curses.stdscr >>$@
583 @echo _curses.wtouchln >>$@
584 @echo EXPORTS >>$@
585 @echo init_curses_panel >>$@
586
587_curses$(MODULE.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB)
588 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses
589
590# curses_panel needs to be renamed to be useful
591_curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB)
592 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel
593
594_curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT)
595 cp $^ $@
596
597dbm$(MODULE.EXT): $(OUT)dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB)
598 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
599
600gdbm$(MODULE.EXT): $(OUT)gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB)
601 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm
602
603mpz$(MODULE.EXT): $(OUT)mpzmodule$O $(OUT)mpz_m.def $(PYTHON.IMPLIB)
604 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgmp
605
606pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB)
607 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lexpat
608
609readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB)
610 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses
611
612#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
613_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
614 $(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
615 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
616
617zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB)
618 $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz
619
620# the test target
621test:
622 ./python -tt ../../lib/test/regrtest.py -l -u "network"
623
624-include $(OUTBASE)python.dep