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