# This makefile demonstrates the building of native extensions # for Python for Series 60 using Pyrex and sdk2unix. # # For information about Pyrex, see # # http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ # # The library built by this makefile can be found from # # http://pymbian.sourceforge.net/misc/s60pyrex-v0.20051119.zip # # Extract the contents of the zip file and put this makefile # in the directory s60pyrex/examples/wrapping. # Convert the DOS-style linefeeds of the .pyx file to Unix style, # or pyrexc will complain. # # This makefile is for builds with sdk2unix-style SDKs, # and has been tested with sdk2unix v1.6a, PyS60 SDK v1.2, # and Series 60 C++ SDK v2.6 (2nd Ed FP2). # # To use this makefile, you must define the environment # variable "EPOC" so that it points to the root of the SDK # you wish to use. Additionally, you must set your PATH # so that it points the the "bin" directory of the SDK. # # To use a non-SDK-default GCC, you may also specify # a path to the GCC tree that you wish to use by setting # the "GCCPATH" environment variable. In that case, your # path should point to the "bin" directory of the GCC # tree instead of that of the SDK tree. LIBNAME := uiutils default : $(LIBNAME).pyd ifdef GCCPATH include $(GCCPATH)/lib/makerules/dll else ifndef EPOC $(error EPOC not set) else include $(EPOC)/lib/makerules/dll endif endif LIBLIST := edllstub.lib estlib.lib euser.lib python222.lib avkon.lib eikcdlg.lib eikctl.lib LIBS := $(patsubst %,$(EPOCTRGREL)/%,$(LIBLIST)) OBJECTS := dllentry.o notewrap.o $(LIBNAME).o U1 := 10000079 # dynamic library U2 := 1000008d # Python extension U3 := 00000000 # application specific (looks like may be zero) CFLAGS += -O -I. CFLAGS += -I$(EPOC)/python-port-s60/symbian_python/include CFLAGS += -I$(EPOC)/python-port-s60/symbian_python/python CFLAGS += -I$(EPOC)/python-port-s60/symbian_python/symbian CFLAGS += -DUID3=0x$(U3) clean : -rm *~ *.o $(LIBNAME).cpp $(LIBNAME).c *.def2 *.def3 *.ex1 *.Lib *.pyd $(LIBNAME).def1 : $(OBJECTS) $(LIBNAME).cpp : $(LIBNAME).pyx pyrexc -o $@ $< %.o : %.cpp $(CCC) $(CFLAGS) -c $*.cpp # We want what we would get with these .mmp options: # # EPOCDATALINKADDRESS 0x33100000 # EPOCALLOWDLLDATA # EPOCCALLDLLENTRYPOINTS # # For this, we must omit -nocall, and have -allow # and -datalinkaddress 0x33100000. %.pyd : %.ex2 $(PT) $*.ex2 $*.pyd -allow -datalinkaddress 0x33100000 -uid1 0x$(U1) -uid2 0x$(U2) -uid3 0x$(U3)