From: Steinar H. Gunderson Date: Sat, 12 Jul 2008 19:57:46 +0000 (+0200) Subject: Add a basic SWIG wrapper for Perl. X-Git-Url: https://git.sesse.net/?p=qscale;a=commitdiff_plain;h=a1446ef0a38e566288fc325be5eea86abb307ec3 Add a basic SWIG wrapper for Perl. --- diff --git a/Makefile b/Makefile index 37a0dd8..d199187 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,20 @@ CC=gcc OBJS=qscale.o libqscale.o -CFLAGS=-Wall -O2 -msse +CFLAGS=-Wall -O2 -msse -fPIC LDFLAGS=-lm -ljpeg qscale: qscale.o libqscale.o +# Perl stuff +qscale_wrap.c: qscale.i + swig -perl5 qscale.i +qscale_wrap.o: qscale_wrap.c + $(CC) $(CFLAGS) $(shell perl -MExtUtils::Embed -e ccopts) -c $< -o $@ +qscale.so: libqscale.o qscale_wrap.o + $(LD) $(LDFLAGS) -shared libqscale.o qscale_wrap.o -o $@ + clean: - $(RM) qscale $(OBJS) + $(RM) qscale $(OBJS) qscale_wrap.o qscale_wrap.c qscale.pm qscale.so .PHONY: clean diff --git a/qscale.i b/qscale.i new file mode 100644 index 0000000..09fba83 --- /dev/null +++ b/qscale.i @@ -0,0 +1,6 @@ +%module qscale + +%{ +#include "libqscale.h" +%} +%include "libqscale.h"