diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2014-11-08 00:07:02 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2014-11-08 00:07:02 +0000 |
commit | ba706261d3fc5b436aa6f09d57e62eeb77377d8f (patch) | |
tree | 4faadd5931a89a847ae9bb2345d9fe7bb0e2f778 /swig/Makefile | |
parent | 89890e226e5da72743f885cefb5273c51baf094e (diff) | |
parent | 89a9ec7a352dc35141b8f9a87c202fdd448e9a6f (diff) | |
download | LibXtract-ba706261d3fc5b436aa6f09d57e62eeb77377d8f.tar.gz LibXtract-ba706261d3fc5b436aa6f09d57e62eeb77377d8f.tar.bz2 LibXtract-ba706261d3fc5b436aa6f09d57e62eeb77377d8f.zip |
Merge branch 'feature/no-autotools' into develop
Diffstat (limited to 'swig/Makefile')
-rw-r--r-- | swig/Makefile | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/swig/Makefile b/swig/Makefile new file mode 100644 index 0000000..2d47e12 --- /dev/null +++ b/swig/Makefile @@ -0,0 +1,31 @@ +NAME = xtract + +OS := $(shell uname) + +# Assume that since we're building the python bindings, we have a python installed! +INCLUDEPY = $(shell python -m sysconfig | grep -w INCLUDEPY | awk '{print $$3}') + +ifeq ($(OS), Darwin) + CFLAGS=-g -c + LD=gcc + LDFLAGS=-bundle -flat_namespace -undefined suppress +else + CFLAGS=-g -c -fPIC + LD=ld + LDFLAGS=-shared +endif + +.PHONY: python + +python: + @swig -I../include -python $(NAME).i + @$(CC) $(CFLAGS) $(NAME)_wrap.c -o $(NAME)_wrap.o -I$(INCLUDEPY) -I../include + @$(CC) $(LDFLAGS) ../src/lib$(NAME).a $(NAME)_wrap.o -o _$(NAME).so -framework Accelerate + +clean: + @$(RM) *.o + @$(RM) *.pyc + @$(RM) *.so + @$(RM) $(NAME)_wrap.c + @$(RM) $(NAME).py + |