jamie@262: NAME = xtract jamie@262: jamie@262: OS := $(shell uname) jamie@262: jamie@262: # Assume that since we're building the python bindings, we have a python installed! jamie@262: INCLUDEPY = $(shell python -m sysconfig | grep -w INCLUDEPY | awk '{print $$3}') jamie@262: jamie@262: ifeq ($(OS), Darwin) jamie@262: CFLAGS=-g -c jamie@262: LD=gcc jamie@262: LDFLAGS=-bundle -flat_namespace -undefined suppress jamie@262: else jamie@262: CFLAGS=-g -c -fPIC jamie@262: LD=ld jamie@262: LDFLAGS=-shared jamie@262: endif jamie@262: jamie@262: .PHONY: python jamie@262: jamie@262: python: jamie@262: @swig -I../include -python $(NAME).i jamie@262: @$(CC) $(CFLAGS) $(NAME)_wrap.c -o $(NAME)_wrap.o -I$(INCLUDEPY) -I../include jamie@262: @$(CC) $(LDFLAGS) ../src/lib$(NAME).a $(NAME)_wrap.o -o _$(NAME).so -framework Accelerate jamie@262: jamie@262: clean: jamie@262: @$(RM) *.o jamie@262: @$(RM) *.pyc jamie@262: @$(RM) *.so jamie@262: @$(RM) $(NAME)_wrap.c jamie@262: @$(RM) $(NAME).py jamie@262: