annotate swig/Makefile @ 285:89fe52066db1 tip master

MSCV missing ssize_t fix
author Jamie Bullock <jamie@jamiebullock.com>
date Tue, 16 Jul 2019 18:29:20 +0100
parents 7063ad521438
children
rev   line source
jamie@262 1 NAME = xtract
jamie@262 2
jamie@262 3 OS := $(shell uname)
jamie@262 4
jamie@262 5 # Assume that since we're building the python bindings, we have a python installed!
jamie@262 6 INCLUDEPY = $(shell python -m sysconfig | grep -w INCLUDEPY | awk '{print $$3}')
jamie@262 7
jamie@262 8 ifeq ($(OS), Darwin)
jamie@262 9 CFLAGS=-g -c
jamie@262 10 LD=gcc
jamie@262 11 LDFLAGS=-bundle -flat_namespace -undefined suppress
jamie@262 12 else
jamie@262 13 CFLAGS=-g -c -fPIC
jamie@262 14 LD=ld
jamie@262 15 LDFLAGS=-shared
jamie@262 16 endif
jamie@262 17
jamie@262 18 .PHONY: python
jamie@262 19
jamie@262 20 python:
jamie@262 21 @swig -I../include -python $(NAME).i
jamie@262 22 @$(CC) $(CFLAGS) $(NAME)_wrap.c -o $(NAME)_wrap.o -I$(INCLUDEPY) -I../include
jamie@262 23 @$(CC) $(LDFLAGS) ../src/lib$(NAME).a $(NAME)_wrap.o -o _$(NAME).so -framework Accelerate
jamie@262 24
jamie@262 25 clean:
jamie@262 26 @$(RM) *.o
jamie@262 27 @$(RM) *.pyc
jamie@262 28 @$(RM) *.so
jamie@262 29 @$(RM) $(NAME)_wrap.c
jamie@262 30 @$(RM) $(NAME).py
jamie@262 31