# This is a semi-generic makefile for compiling Python shared # libraries. # Created 5/6/2002, jchang # This should be SOLARIS, IRIX, OSX, or LINUX. PLATFORM=SOLARIS # Set this to point to the include files for your current installation # of python. PYINCLUDE=/home/jchang/include/python2.2 #PYINCLUDE=/home/jchang/include/python2.1 # Use this to pass any other flags to the C compiler. This should be # at least -I$(PYINCLUDE). MORECFLAGS=-I$(PYINCLUDE) # Use this to pass any other flags to the linker. MORELDFLAGS= # Specify the files to make. all: ctexhyphen.so stem.so ctype.so abbreviation _nr.so cMaxEntropy.so .PHONY: all abbreviation abbreviation: $(MAKE) -C abbreviation stem.so: stem.o stemmodule.o ${LD} ${LDFLAGS} ${MORELDFLAGS} stemmodule.o $< -o $@ SWIG=swig nr_wrap.c: nr.i nr.c ${SWIG} -python $< _nr.so: nr.c nr_wrap.c ${CC} -c ${CFLAGS} ${MORECFLAGS} nr.c nr_wrap.c ${LD} ${LDFLAGS} ${MORELDFLAGS} nr.o nr_wrap.o -o _nr.so @rm -f nr.o @rm -f nr_wrap.o # You should not have to change things past here, unless you want to # tweak flags for your platform. # Set platform-specific values for these variables. SOLARIS_CC=gcc SOLARIS_LD=ld SOLARIS_CFLAGS=-O2 -Wall SOLARIS_LDFLAGS=-G IRIX_CC=gcc IRIX_LD=ld IRIX_CFLAGS=-O2 -Wall -g -shared IRIX_LDFLAGS=-shared -all OSX_CC=cc OSX_LD=cc OSX_CFLAGS=-O2 -Wall -g -traditional-cpp OSX_LDFLAGS=-bundle -undefined suppress -flat_namespace LINUX_CC=gcc LINUX_LD=ld LINUX_CFLAGS=-O2 -Wall LINUX_LDFLAGS=-G CC=$($(PLATFORM)_CC) LD=$($(PLATFORM)_LD) CFLAGS=$($(PLATFORM)_CFLAGS) LDFLAGS=$($(PLATFORM)_LDFLAGS) # Export these variables to sub-makes. export PYINCLUDE export MORECFLAGS export MORELDFLAGS export CC export LD export CFLAGS export LDFLAGS # Implicit in make, except for the MORECFLAGS thing. %.o: %.c ${CC} -c ${CFLAGS} ${MORECFLAGS} $< -o $@ %.so: %module.o ${LD} ${LDFLAGS} ${MORELDFLAGS} $< -o $@ %.so: %.o ${LD} ${LDFLAGS} ${MORELDFLAGS} $< -o $@ .PHONY : clean clean: @find . -name '*.py[oc]' -print -exec rm -f {} \; @find . -name '*~' -print -exec rm -f {} \; @find . -name '*.so' -print -exec rm -f {} \; @find . -name '*.o' -print -exec rm -f {} \; @rm -f *_wrap.c $(MAKE) clean -C abbreviation