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 | # |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 3 | # Top-Level Makefile for Building Python 2.6 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 |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 5 | # Modified by Andrew MacIntyre, <andymac@pcug.org.au> for Python 2.6 |
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 | # |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 10 | # The output of the build is a largish Python26.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 |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 13 | # Python26.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 readline library installed? |
| 44 | # NOTE: I'm using a modified version of Kai Uwe Rommel's port that |
| 45 | # - is compiled with multithreading enabled |
| 46 | # - is linked statically |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 47 | # I have had no success trying to use a DLL version, even when |
| 48 | # compiled with multithreading enabled. |
| 49 | HAVE_GREADLINE= no |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 50 | # Do you have the BSD DB library (v1.85) as included in the EMXBSD package? |
| 51 | # NOTE: this library needs to be recompiled with a structure member |
| 52 | # renamed to avoid problems with the multithreaded errno support |
| 53 | # (there is a structure member called errno, used for shadowing the |
| 54 | # real errno, which conflicts with the errno redefinition of -Zmt) |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 55 | HAVE_BSDDB= no |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 56 | # 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] | 57 | HAVE_NCURSES= no |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 58 | # Do you have the GDBM library installed? |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 59 | HAVE_GDBM= no |
Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 60 | # Do you have the BZ2 compression library installed? |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 61 | HAVE_BZ2= no |
Andrew MacIntyre | 744b313 | 2005-02-17 12:44:51 +0000 | [diff] [blame] | 62 | # Do you have the OpenSSL libraries installed |
| 63 | HAVE_OPENSSL= no |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 64 | |
| 65 | # === install locations === |
| 66 | # default value of PYTHONHOME |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 67 | LIB_DIR=C:/Python26 |
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 | ff59f3c | 2005-01-17 12:18:12 +0000 | [diff] [blame] | 134 | |
| 135 | # === Build time resource settings === |
| 136 | |
Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 137 | # EMX's default number of file handles is 40, which is sometimes insufficient |
| 138 | # (the tempfile regression test tries to create 100 temporary files) |
| 139 | NFILES=250 |
| 140 | |
Andrew MacIntyre | ff59f3c | 2005-01-17 12:18:12 +0000 | [diff] [blame] | 141 | # The default stack size for child threads is 64k bytes, which is |
| 142 | # insufficient for some applications which do a lot of work in threads |
| 143 | # (such as Zope, especially in conjunction with Plone). |
| 144 | # Note that this setting is distinct from the stack size for the main |
| 145 | # thread, which is set via the %.def rule below. |
| 146 | # EMX documents that the thread stack size should be at least 32768 bytes; |
| 147 | # for Zope/Plone at least 128k bytes is recommended. |
| 148 | # Uncomment & adjust the next line to override the default stack size: |
| 149 | #CFLAGS+= -DTHREAD_STACK_SIZE=0x20000 |
| 150 | |
| 151 | |
| 152 | # === The environment === |
| 153 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 154 | # Source file paths |
| 155 | SRCPATH=.;../../Python;../../Parser;../../Objects;../../Include;../../Modules |
| 156 | # Python contains the central core, containing the builtins and interpreter. |
| 157 | # Parser contains Python's Internal Parser and |
| 158 | # Standalone Parser Generator Program (Shares Some of Python's Modules) |
| 159 | # Objects contains Python Object Types |
| 160 | # Modules contains extension Modules (Built-In or as Separate DLLs) |
| 161 | |
| 162 | # Unix shells tend to use "$" as delimiter for variable names. |
| 163 | # Test for this behaviour and set $(BUCK) variable correspondigly ... |
| 164 | __TMP__:=$(shell echo $$$$) |
| 165 | ifeq ($(__TMP__),$$$$) |
| 166 | BUCK= $$ |
| 167 | BRO= ( |
| 168 | BRC= ) |
| 169 | else |
| 170 | BUCK= \$$ |
| 171 | BRO= \( |
| 172 | BRC= \) |
| 173 | endif |
| 174 | # Compute the "double quote" variable |
| 175 | __TMP__:=$(shell echo "") |
| 176 | ifeq ($(__TMP__),"") |
| 177 | DQUOTE= " |
| 178 | else |
| 179 | DQUOTE= \" |
| 180 | endif |
| 181 | |
| 182 | # Include paths |
| 183 | #INCLUDE= -I$(subst ;, -I, $(SRCPATH)) |
| 184 | INCLUDE= -I. -I../../Include |
| 185 | |
| 186 | # Path to search for .c files |
| 187 | vpath %.c .;..;$(SRCPATH) |
| 188 | |
| 189 | # Top of the package tree |
| 190 | TOP= ../../ |
| 191 | |
| 192 | # Directory for output files |
| 193 | OUTBASE= out/ |
| 194 | OUT= $(OUTBASE)$(MODE)/ |
| 195 | |
| 196 | # Additional libraries |
| 197 | LIBS= -lsocket |
| 198 | |
| 199 | # Utility macro: replacement for $^ |
| 200 | ^^= $(filter-out %$A,$^) |
| 201 | # Use $(L^) to link with all libraries specified as dependencies |
| 202 | L^= $(addprefix -l,$(basename $(notdir $(filter %$A,$+)))) |
| 203 | |
| 204 | # Build rules |
| 205 | $(OUT)%$O: %.c |
| 206 | $(CC) $(CFLAGS.LIB) -c $< -o $@ |
| 207 | |
| 208 | %.a: |
| 209 | $(LD) $(LDFLAGS.A) -o $@ $(^^) $(L^) |
| 210 | |
| 211 | %.dll: |
| 212 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) |
| 213 | |
| 214 | %.pyd: $(OUT)%module$O $(OUT)%_m.def |
| 215 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(PYTHON.IMPLIB) $(LIBS) |
| 216 | |
| 217 | %.exe: |
| 218 | $(LD) $(LDFLAGS.EXE) -o $@ $(^^) $(L^) |
| 219 | |
| 220 | %_m.def: |
| 221 | @echo Creating .DEF file: $@ |
| 222 | @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ |
| 223 | ifeq ($(DESCRIPTION.$(notdir $*)$(MODULE.EXT)),) |
| 224 | @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@ |
| 225 | else |
| 226 | @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@ |
| 227 | endif |
| 228 | @echo DATA MULTIPLE NONSHARED >>$@ |
| 229 | @echo EXPORTS >>$@ |
| 230 | @echo init$(notdir $*) >>$@ |
| 231 | |
| 232 | %.def: |
| 233 | @echo Creating .DEF file: $@ |
| 234 | @echo NAME $(notdir $*) $(EXETYPE.$(notdir $*).exe) >$@ |
| 235 | @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*).exe)$(DQUOTE) >>$@ |
Andrew MacIntyre | ff59f3c | 2005-01-17 12:18:12 +0000 | [diff] [blame] | 236 | @echo STACKSIZE 2097152 >>$@ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 237 | |
| 238 | # Output file names |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 239 | PYTHON_VER= 2.6 |
| 240 | PYTHON_LIB= python26 |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 241 | PYTHON.LIB= $(PYTHON_LIB)_s$A |
| 242 | PYTHON.IMPLIB= $(PYTHON_LIB)$A |
| 243 | ifeq ($(EXEOMF),yes) |
| 244 | PYTHON.EXEIMP= $(PYTHON.IMPLIB) |
| 245 | LDMODE.EXE= -Zomf |
| 246 | else |
| 247 | PYTHON.EXEIMP= $(PYTHON_LIB).a |
| 248 | LDMODE.EXE = |
| 249 | endif |
| 250 | PYTHON.DLL= $(PYTHON_LIB).dll |
| 251 | PYTHON.DEF= $(PYTHON_LIB).def |
| 252 | PYTHON.EXE= python.exe |
| 253 | PYTHONPM.EXE= pythonpm.exe |
| 254 | PGEN.EXE= pgen.exe |
| 255 | LIBRARY= $(PYTHON.LIB) |
| 256 | LD_LIBRARY= $(PYTHON.IMPLIB) |
| 257 | |
| 258 | # Additional executable parameters |
| 259 | EXETYPE.$(PYTHON.EXE)= WINDOWCOMPAT |
| 260 | EXETYPE.$(PYTHONPM.EXE)= WINDOWAPI |
| 261 | EXETYPE.$(PGEN.EXE)= WINDOWCOMPAT |
| 262 | DESCRIPTION.$(PYTHON.EXE)= Python object-oriented programming language interpreter for OS/2 |
| 263 | DESCRIPTION.$(PYTHONPM.EXE)= $(DESCRIPTION.$(PYTHON.EXE)) |
| 264 | DESCRIPTION.$(PGEN.EXE)= Python object-oriented programming language parser generator for OS/2 |
| 265 | |
| 266 | # Module descriptions |
| 267 | DESCRIPTION.zlib$(MODULE.EXT)= Python Extension DLL for accessing the InfoZip compression library |
| 268 | DESCRIPTION.crypt$(MODULE.EXT)= Python Extension DLL implementing the crypt$(BRO)$(BRC) function |
| 269 | DESCRIPTION._tkinter$(MODULE.EXT)= Python Extension DLL for access to Tcl/Tk Environment |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 270 | DESCRIPTION.readline$(MODULE.EXT)= Python Extension DLL for access to GNU ReadLine library |
Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 271 | DESCRIPTION._curses$(MODLIB.EXT)= Python Extension DLL for access to ncurses library |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 272 | DESCRIPTION.pyexpat$(MODULE.EXT)= Python Extension DLL for access to expat library |
Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 273 | 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] | 274 | |
| 275 | # Source files |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 276 | SRC.OS2EMX= config.c dlfcn.c getpathp.c |
| 277 | SRC.MAIN= $(addprefix $(TOP), \ |
| 278 | Modules/getbuildinfo.c \ |
| 279 | Modules/main.c) |
| 280 | SRC.MODULES= $(addprefix $(TOP), \ |
| 281 | Modules/gcmodule.c \ |
| 282 | Modules/signalmodule.c \ |
| 283 | Modules/posixmodule.c \ |
Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 284 | Modules/_threadmodule.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 285 | Modules/arraymodule.c \ |
| 286 | Modules/binascii.c \ |
| 287 | Modules/cmathmodule.c \ |
| 288 | Modules/_codecsmodule.c \ |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 289 | Modules/collectionsmodule.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 290 | Modules/_csv.c \ |
| 291 | Modules/datetimemodule.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 292 | Modules/errnomodule.c \ |
| 293 | Modules/fcntlmodule.c \ |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 294 | Modules/_functoolsmodule.c \ |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 295 | Modules/_heapqmodule.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 296 | Modules/imageop.c \ |
| 297 | Modules/itertoolsmodule.c \ |
| 298 | Modules/_localemodule.c \ |
| 299 | Modules/mathmodule.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 300 | Modules/operator.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 301 | Modules/_randommodule.c \ |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 302 | Modules/sha256module.c \ |
| 303 | Modules/sha512module.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 304 | Modules/_sre.c \ |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 305 | Modules/_struct.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 306 | Modules/symtablemodule.c \ |
| 307 | Modules/termios.c \ |
| 308 | Modules/timemodule.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 309 | Modules/_weakref.c \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 310 | Modules/xxsubtype.c \ |
| 311 | Modules/zipimport.c) |
Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 312 | SRC.PARSE1= $(addprefix $(TOP), \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 313 | Parser/acceler.c \ |
| 314 | Parser/grammar1.c \ |
| 315 | Parser/listnode.c \ |
| 316 | Parser/node.c \ |
| 317 | Parser/parser.c \ |
| 318 | Parser/parsetok.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 319 | Parser/bitset.c \ |
Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 320 | Parser/metagrammar.c) |
| 321 | SRC.PARSE2= $(addprefix $(TOP), \ |
| 322 | Parser/tokenizer.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 323 | Parser/myreadline.c) |
Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 324 | SRC.PARSER= $(SRC.PARSE1) \ |
| 325 | $(SRC.PARSE2) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 326 | SRC.PYTHON= $(addprefix $(TOP), \ |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 327 | Python/Python-ast.c \ |
| 328 | Python/asdl.c \ |
| 329 | Python/ast.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 330 | Python/bltinmodule.c \ |
| 331 | Python/exceptions.c \ |
| 332 | Python/ceval.c \ |
| 333 | Python/compile.c \ |
| 334 | Python/codecs.c \ |
| 335 | Python/errors.c \ |
| 336 | Python/frozen.c \ |
| 337 | Python/frozenmain.c \ |
| 338 | Python/future.c \ |
| 339 | Python/getargs.c \ |
| 340 | Python/getcompiler.c \ |
| 341 | Python/getcopyright.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 342 | Python/getplatform.c \ |
| 343 | Python/getversion.c \ |
| 344 | Python/graminit.c \ |
| 345 | Python/import.c \ |
| 346 | Python/importdl.c \ |
| 347 | Python/marshal.c \ |
| 348 | Python/modsupport.c \ |
| 349 | Python/mysnprintf.c \ |
| 350 | Python/mystrtoul.c \ |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 351 | Python/pyarena.c \ |
Eric Smith | 6dc46f5 | 2009-04-27 20:39:49 +0000 | [diff] [blame] | 352 | Python/pyctype.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 353 | Python/pyfpe.c \ |
| 354 | Python/pystate.c \ |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 355 | Python/pystrtod.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 356 | Python/pythonrun.c \ |
| 357 | Python/structmember.c \ |
| 358 | Python/symtable.c \ |
| 359 | Python/sysmodule.c \ |
| 360 | Python/traceback.c \ |
| 361 | Python/getopt.c \ |
| 362 | Python/dynload_shlib.c \ |
| 363 | Python/thread.c) |
| 364 | SRC.OBJECT= $(addprefix $(TOP), \ |
| 365 | Objects/abstract.c \ |
Andrew MacIntyre | 6c65531 | 2002-04-15 12:09:45 +0000 | [diff] [blame] | 366 | Objects/boolobject.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 367 | Objects/cellobject.c \ |
| 368 | Objects/classobject.c \ |
| 369 | Objects/cobject.c \ |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 370 | Objects/codeobject.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 371 | Objects/complexobject.c \ |
| 372 | Objects/descrobject.c \ |
| 373 | Objects/dictobject.c \ |
Andrew MacIntyre | 07c639f | 2002-04-30 13:06:32 +0000 | [diff] [blame] | 374 | Objects/enumobject.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 375 | Objects/fileobject.c \ |
| 376 | Objects/floatobject.c \ |
| 377 | Objects/frameobject.c \ |
| 378 | Objects/funcobject.c \ |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 379 | Objects/genobject.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 380 | Objects/iterobject.c \ |
| 381 | Objects/listobject.c \ |
| 382 | Objects/longobject.c \ |
| 383 | Objects/methodobject.c \ |
| 384 | Objects/moduleobject.c \ |
| 385 | Objects/object.c \ |
Andrew MacIntyre | 6c65531 | 2002-04-15 12:09:45 +0000 | [diff] [blame] | 386 | Objects/obmalloc.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 387 | Objects/rangeobject.c \ |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 388 | Objects/setobject.c \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 389 | Objects/sliceobject.c \ |
| 390 | Objects/stringobject.c \ |
| 391 | Objects/structseq.c \ |
| 392 | Objects/tupleobject.c \ |
| 393 | Objects/typeobject.c \ |
| 394 | Objects/unicodeobject.c \ |
| 395 | Objects/unicodectype.c \ |
| 396 | Objects/weakrefobject.c) |
| 397 | |
| 398 | SRC.LIB= $(SRC.OS2EMX) \ |
| 399 | $(SRC.MAIN) \ |
| 400 | $(SRC.PARSER) \ |
| 401 | $(SRC.OBJECT) \ |
| 402 | $(SRC.PYTHON) \ |
| 403 | $(SRC.MODULES) |
| 404 | OBJ.LIB= $(addprefix $(OUT),$(notdir $(SRC.LIB:.c=$O))) |
| 405 | |
Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 406 | SRC.PGEN= $(SRC.PARSE1) \ |
| 407 | $(addprefix $(TOP), \ |
| 408 | Objects/obmalloc.c) \ |
| 409 | $(addprefix $(TOP), \ |
| 410 | Python/mysnprintf.c) \ |
| 411 | $(addprefix $(TOP), \ |
| 412 | Parser/tokenizer_pgen.c \ |
| 413 | Parser/pgenmain.c \ |
| 414 | Parser/pgen.c \ |
| 415 | Parser/printgrammar.c \ |
| 416 | Parser/grammar.c \ |
| 417 | Parser/firstsets.c) \ |
Guido van Rossum | 0cb85a9 | 2007-08-07 22:09:52 +0000 | [diff] [blame] | 418 | |
Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 419 | OBJ.PGEN= $(addprefix $(OUT),$(notdir $(SRC.PGEN:.c=$O))) |
| 420 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 421 | SRC.EXE= $(TOP)Modules/python.c |
| 422 | SRC.PMEXE= pythonpm.c |
| 423 | |
| 424 | # Python modules to be dynamically loaded that: |
| 425 | # 1) have only single source file and require no extra libs |
| 426 | # 2) use the standard module naming convention |
| 427 | # (the 'module' in ?????module.c is assumed) |
| 428 | # - these can be built with implicit rules |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 429 | EASYEXTMODULES= fpectl \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 430 | fpetest \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 431 | parser \ |
| 432 | pwd \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 433 | select |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 434 | |
| 435 | # Python modules to be dynamically loaded that need explicit build rules |
| 436 | # (either multiple source files and/or non-standard module naming) |
| 437 | # (NOTE: use shortened names for modules affected by 8 char name limit) |
Neal Norwitz | c05d384 | 2007-10-13 18:56:00 +0000 | [diff] [blame] | 438 | HARDEXTMODULES= _socket \ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 439 | _testcap \ |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 440 | unicoded |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 441 | |
Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 442 | # Python modules that are used as libraries and therefore must use |
| 443 | # a .DLL extension |
| 444 | LIBEXTMODULES= |
| 445 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 446 | # Python external ($(MODULE.EXT)) modules - can be EASY or HARD |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 447 | ifeq ($(HAVE_ZLIB),yes) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 448 | HARDEXTMODULES+= zlib |
| 449 | endif |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 450 | ifeq ($(HAVE_UFC),yes) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 451 | HARDEXTMODULES+= crypt |
| 452 | endif |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 453 | ifeq ($(HAVE_TCLTK),yes) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 454 | HARDEXTMODULES+= _tkinter |
| 455 | CFLAGS+= -DHAS_DIRENT -I/TclTk80/include |
| 456 | TK_LIBS+= -L/TclTk80/lib -ltcl80 -ltk80 |
| 457 | endif |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 458 | ifeq ($(HAVE_GREADLINE),yes) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 459 | HARDEXTMODULES+= readline |
| 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) |
Georg Brandl | 0a7ac7d | 2008-05-26 10:29:35 +0000 | [diff] [blame] | 466 | HARDEXTMODULES+= _gdbm _dbm |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 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 | 744b313 | 2005-02-17 12:44:51 +0000 | [diff] [blame] | 471 | ifeq ($(HAVE_OPENSSL),yes) |
| 472 | HARDEXTMODULES+= _ssl |
| 473 | endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 474 | |
Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 475 | # Expat is now distributed with the Python source |
| 476 | HARDEXTMODULES+= pyexpat |
| 477 | EXPAT.INC= -I../../Modules/expat |
| 478 | 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] | 479 | -DXML_CONTENT_BYTES=1024 -DHAVE_MEMMOVE=1 -DHAVE_BCOPY=1 |
Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 480 | EXPAT.SRC= $(addprefix ../../Modules/expat/, \ |
| 481 | xmlparse.c \ |
| 482 | xmlrole.c \ |
| 483 | xmltok.c) |
| 484 | |
| 485 | # all the external modules |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 486 | EXTERNDLLS= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES))) |
| 487 | EXTERNDLLS+= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES))) |
Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 488 | EXTERNDLLS+= $(addsuffix $(MODLIB.EXT),$(patsubst %module,%,$(LIBEXTMODULES))) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 489 | |
| 490 | # Targets |
| 491 | all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \ |
Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 492 | python_noncore |
| 493 | |
| 494 | python_noncore: |
| 495 | make PY_DEF= $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 496 | |
| 497 | clean: |
| 498 | rm -f $(OUT)* |
| 499 | rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \ |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 500 | $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT) *.dll |
Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 501 | find ../../Lib -name "*.py[co]" -exec rm {} ";" |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 502 | |
| 503 | lx: |
| 504 | @echo Packing everything with lxLite... |
| 505 | lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) |
| 506 | |
| 507 | depend: $(OUTBASE) |
| 508 | makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \ |
| 509 | -r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN) |
| 510 | |
| 511 | $(OUT): $(OUTBASE) |
| 512 | |
| 513 | $(OUT) $(OUTBASE): |
| 514 | mkdir.exe $@ |
| 515 | |
| 516 | $(PYTHON.LIB): $(OBJ.LIB) |
| 517 | rm.exe -f $@ |
| 518 | $(AR) $(ARFLAGS) $@ $^ |
| 519 | |
Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 520 | # the Python core DLL .def file needs to have a number of non-static |
| 521 | # symbols that aren't part of the Python C API removed (commented out) |
| 522 | # from the DLL export list. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 523 | $(PYTHON.DEF): $(PYTHON.LIB) |
| 524 | @echo Creating .DEF file: $@ |
| 525 | @echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@ |
| 526 | @echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@ |
| 527 | @echo PROTMODE >>$@ |
| 528 | @echo DATA MULTIPLE NONSHARED >>$@ |
| 529 | @echo EXPORTS >>$@ |
Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 530 | $(EXPLIB) -u $(PYTHON.LIB) |\ |
Andrew MacIntyre | bac1ea9 | 2003-07-16 13:31:11 +0000 | [diff] [blame] | 531 | sed -e "/^ .init.*/s/^ /; /" \ |
| 532 | -e "/^ .pcre_.*/s/^ /; /" \ |
| 533 | -e "/^ .array_methods/s/^ /; /" \ |
| 534 | -e "/^ .fast_save_leave/s/^ /; /" \ |
| 535 | -e "/^ .dlopen/s/^ /; /" \ |
| 536 | -e "/^ .dlsym/s/^ /; /" \ |
| 537 | -e "/^ .dlclose/s/^ /; /" \ |
| 538 | -e "/^ .dlerror/s/^ /; /" \ |
| 539 | -e "/^ ._Py_re_.*/s/^ /; /" \ |
| 540 | -e "/^ ._Py_MD5.*/s/^ /; /" >>$@ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 541 | |
| 542 | $(PYTHON.IMPLIB): $(PYTHON.DEF) |
| 543 | $(IMPLIB) -o $@ $^ |
| 544 | |
| 545 | $(PYTHON.EXEIMP): $(PYTHON.DEF) |
| 546 | $(IMPLIB) -o $@ $^ |
| 547 | |
| 548 | $(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF) |
| 549 | |
| 550 | # Explicit make targets for the .EXEs to be able to use LD to link |
| 551 | # (so that fork() will work if required) |
| 552 | |
| 553 | $(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def |
| 554 | $(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] | 555 | $(EXEOPT) -aq $(PYTHON.EXE) -h$(NFILES) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 556 | |
| 557 | $(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def |
| 558 | $(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] | 559 | $(EXEOPT) -aq $(PYTHONPM.EXE) -h$(NFILES) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 560 | |
Andrew MacIntyre | 4fffdff | 2002-08-18 06:26:33 +0000 | [diff] [blame] | 561 | $(PGEN.EXE): $(OBJ.PGEN) $(OUT)pgen.def |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 562 | |
| 563 | # Explicit building instructions for those external modules that require |
| 564 | # awkward handling (due e.g. to non-std naming, or multiple source files) |
| 565 | # - standard modules |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 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 | crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB) |
| 585 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS) |
| 586 | |
| 587 | # The _curses_panel module requires a couple of ncurses library entry |
| 588 | # points, which are best exposed as exports from the _curses module DLL |
| 589 | $(OUT)_curses_m.def: |
| 590 | @echo Creating .DEF file: $@ |
| 591 | @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ |
Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 592 | @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODLIB.EXT))$(DQUOTE) >>$@ |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 593 | @echo DATA MULTIPLE NONSHARED >>$@ |
| 594 | @echo EXPORTS >>$@ |
| 595 | @echo init_curses >>$@ |
| 596 | @echo wnoutrefresh >>$@ |
| 597 | @echo _nc_panelhook >>$@ |
| 598 | @echo is_linetouched >>$@ |
| 599 | @echo mvwin >>$@ |
| 600 | @echo stdscr >>$@ |
| 601 | @echo wtouchln >>$@ |
| 602 | |
| 603 | $(OUT)_curses_panel_m.def: |
| 604 | @echo Creating .DEF file: $@ |
| 605 | @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ |
| 606 | @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@ |
| 607 | @echo DATA MULTIPLE NONSHARED >>$@ |
| 608 | @echo IMPORTS >>$@ |
| 609 | @echo _curses.wnoutrefresh >>$@ |
| 610 | @echo _curses._nc_panelhook >>$@ |
| 611 | @echo _curses.is_linetouched >>$@ |
| 612 | @echo _curses.mvwin >>$@ |
| 613 | @echo _curses.stdscr >>$@ |
| 614 | @echo _curses.wtouchln >>$@ |
| 615 | @echo EXPORTS >>$@ |
| 616 | @echo init_curses_panel >>$@ |
| 617 | |
Andrew MacIntyre | 51578ae | 2003-12-02 12:21:20 +0000 | [diff] [blame] | 618 | _curses$(MODLIB.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 619 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses |
| 620 | |
| 621 | # curses_panel needs to be renamed to be useful |
| 622 | _curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB) |
| 623 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel |
| 624 | |
| 625 | _curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT) |
| 626 | cp $^ $@ |
| 627 | |
Georg Brandl | 0a7ac7d | 2008-05-26 10:29:35 +0000 | [diff] [blame] | 628 | _dbm$(MODULE.EXT): $(OUT)_dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 629 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm |
| 630 | |
Georg Brandl | 0a7ac7d | 2008-05-26 10:29:35 +0000 | [diff] [blame] | 631 | _gdbm$(MODULE.EXT): $(OUT)_gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 632 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm |
| 633 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 634 | |
Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 635 | # Expat is now distributed with Python, so use the included version |
| 636 | $(OUT)pyexpat$O: ../../Modules/pyexpat.c |
| 637 | $(CC) $(CFLAGS) $(EXPAT.INC) -c -o $@ $^ |
| 638 | $(OUT)xmlparse$O: ../../Modules/expat/xmlparse.c |
| 639 | $(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^ |
| 640 | $(OUT)xmlrole$O: ../../Modules/expat/xmlrole.c |
| 641 | $(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^ |
| 642 | $(OUT)xmltok$O: ../../Modules/expat/xmltok.c |
| 643 | $(CC) $(CFLAGS) $(EXPAT.INC) $(EXPAT.DEF) -c -o $@ $^ |
| 644 | pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)xmlparse$O $(OUT)xmlrole$O \ |
| 645 | $(OUT)xmltok$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB) |
| 646 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 647 | |
| 648 | readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB) |
| 649 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses |
| 650 | |
| 651 | #_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O |
| 652 | _tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \ |
Andrew MacIntyre | 4ee893f | 2003-07-13 13:41:59 +0000 | [diff] [blame] | 653 | $(OUT)_tkinter_m.def $(PYTHON.IMPLIB) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 654 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS) |
| 655 | |
| 656 | zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB) |
| 657 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz |
| 658 | |
Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 659 | bz2$(MODULE.EXT): $(OUT)bz2module$O $(OUT)bz2_m.def $(PYTHON.IMPLIB) |
| 660 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lbz2 |
| 661 | |
Andrew MacIntyre | 744b313 | 2005-02-17 12:44:51 +0000 | [diff] [blame] | 662 | _ssl$(MODULE.EXT): $(OUT)_ssl$O $(OUT)_ssl_m.def $(PYTHON.IMPLIB) |
| 663 | $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lssl -lcrypto |
| 664 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 665 | # the test target |
| 666 | test: |
Andrew MacIntyre | 978697b | 2002-12-31 11:18:08 +0000 | [diff] [blame] | 667 | -find ../../Lib -name "*.py[co]" -exec rm {} ";" |
Georg Brandl | e1b5ac6 | 2008-06-04 13:06:58 +0000 | [diff] [blame] | 668 | -./python -E ../../lib/test/regrtest.py -l -u "network" |
| 669 | ./python -E ../../lib/test/regrtest.py -l -u "network" |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 670 | |
| 671 | -include $(OUTBASE)python.dep |