summaryrefslogtreecommitdiffstats
path: root/PC/os2emx/Makefile
diff options
context:
space:
mode:
authorAndrew MacIntyre <andymac@bullseye.apana.org.au>2003-07-13 13:41:59 (GMT)
committerAndrew MacIntyre <andymac@bullseye.apana.org.au>2003-07-13 13:41:59 (GMT)
commit4ee893fe39f11aca1cfcf7472c95c10e61d4aedd (patch)
tree089c7001a6a17428885304665d30e574534f5148 /PC/os2emx/Makefile
parentf9ce67d65fc86e1efee60a960e15eea27c6ab108 (diff)
downloadcpython-4ee893fe39f11aca1cfcf7472c95c10e61d4aedd.zip
cpython-4ee893fe39f11aca1cfcf7472c95c10e61d4aedd.tar.gz
cpython-4ee893fe39f11aca1cfcf7472c95c10e61d4aedd.tar.bz2
More pre-2.3 build tweaks for the OS/2 EMX port:
- separate the building of the core from the wrapper executables and the external modules (.PYDs), based on the Py_BUILD_CORE define; - clean up the generated import library definiton (.DEF file) to remove references to a number of non-static symbols that aren't part of the Python API and which shouldn't be exported by the core DLL; - compile the release build with -fomit-frame-pointer, for a small performance gain; - make "make clean" remove byte compiled Python library files.
Diffstat (limited to 'PC/os2emx/Makefile')
-rw-r--r--PC/os2emx/Makefile39
1 files changed, 35 insertions, 4 deletions
diff --git a/PC/os2emx/Makefile b/PC/os2emx/Makefile
index 1726613..296200b 100644
--- a/PC/os2emx/Makefile
+++ b/PC/os2emx/Makefile
@@ -83,6 +83,7 @@ ARFLAGS= crs
IMPLIB= emximp
EXPLIB= emxexp
EXEOPT= emxbind
+PY_DEF= -DPy_BUILD_CORE
# adjust C compiler settings based on build options
@@ -90,9 +91,10 @@ ifeq ($(MODE),debug)
CFLAGS+= -g -O
LDFLAGS+= -g
else
- CFLAGS+= -s -O2
+ CFLAGS+= -s -O2 -fomit-frame-pointer
LDFLAGS+= -s
endif
+CFLAGS+= $(PY_DEF)
ifeq ($(ASSERTIONS),no)
CFLAGS+= -DNDEBUG
endif
@@ -474,12 +476,16 @@ EXTERNDLLS+= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES)))
# Targets
all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
- $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
+ python_noncore
+
+python_noncore:
+ make PY_DEF= $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
clean:
rm -f $(OUT)*
rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \
$(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT)
+ find ../../Lib -name "*.py[co]" -exec rm {} ";"
lx:
@echo Packing everything with lxLite...
@@ -498,6 +504,9 @@ $(PYTHON.LIB): $(OBJ.LIB)
rm.exe -f $@
$(AR) $(ARFLAGS) $@ $^
+# the Python core DLL .def file needs to have a number of non-static
+# symbols that aren't part of the Python C API removed (commented out)
+# from the DLL export list.
$(PYTHON.DEF): $(PYTHON.LIB)
@echo Creating .DEF file: $@
@echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@
@@ -505,7 +514,29 @@ $(PYTHON.DEF): $(PYTHON.LIB)
@echo PROTMODE >>$@
@echo DATA MULTIPLE NONSHARED >>$@
@echo EXPORTS >>$@
- $(EXPLIB) -u $(PYTHON.LIB) >>$@
+ $(EXPLIB) -u $(PYTHON.LIB) |\
+ sed -e "/ .init.*/s/^ /; /" \
+ -e "/ .pcre_.*/s/^ /; /" \
+ -e "/ .array_methods/s/^ /; /" \
+ -e "/ .fast_save_leave/s/^ /; /" \
+ -e "/ .dlopen/s/^ /; /" \
+ -e "/ .dlsym/s/^ /; /" \
+ -e "/ .dlclose/s/^ /; /" \
+ -e "/ .dlerror/s/^ /; /" \
+ -e "/ .cycle_type/s/^ /; /" \
+ -e "/ .dropwhile_type/s/^ /; /" \
+ -e "/ .takewhile_type/s/^ /; /" \
+ -e "/ .islice_type/s/^ /; /" \
+ -e "/ .starmap_type/s/^ /; /" \
+ -e "/ .imap_type/s/^ /; /" \
+ -e "/ .chain_type/s/^ /; /" \
+ -e "/ .ifilter_type/s/^ /; /" \
+ -e "/ .ifilterfalse_type/s/^ /; /" \
+ -e "/ .count_type/s/^ /; /" \
+ -e "/ .izip_type/s/^ /; /" \
+ -e "/ .repeat_type/s/^ /; /" \
+ -e "/ ._Py_re_.*/s/^ /; /" \
+ -e "/ ._Py_MD5.*/s/^ /; /" >>$@
$(PYTHON.IMPLIB): $(PYTHON.DEF)
$(IMPLIB) -o $@ $^
@@ -627,7 +658,7 @@ readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB)
#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
- $(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
+ $(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB)