Skip to content

Commit

Permalink
Changed mpsse.py to use ctypes instead of swig.
Browse files Browse the repository at this point in the history
  • Loading branch information
devttys0 committed Jan 3, 2014
1 parent 759da5a commit 235fd68
Show file tree
Hide file tree
Showing 5 changed files with 349 additions and 439 deletions.
43 changes: 8 additions & 35 deletions src/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
CC=@CC@
SWIG=@SWIG@
PYDEV=@PYDEV@
PYLIB=@PYLIB@
SONAME=@SONAME@
FRAMEWORK=@FRAMEWORK@
BUILD=@BUILD@
LDFLAGS=@LDFLAGS@
CFLAGS=@CFLAGS@
LIBFTDI1=@LIBFTDI1@
prefix=@prefix@
exec_prefix=@exec_prefix@
LIBDIR=@libdir@
INCDIR=@includedir@
INC=-I$(PYDEV)
TARGET=mpsse

all: $(TARGET) py$(BUILD)-build
.PHONY: examples install uninstall clean distclean

all: $(TARGET)

$(TARGET): mpsse.o fast.o
$(CC) $(CFLAGS) -shared -Wl,$(SONAME),lib$(TARGET).so $(TARGET).o fast.o support.o \
-o lib$(TARGET).so $(LDFLAGS)
ar rcs lib$(TARGET).a $(TARGET).o fast.o support.o
$(CC) $(CFLAGS) -shared -Wl,$(SONAME),lib$(TARGET).so *.o -o lib$(TARGET).so $(LDFLAGS)
ar rcs lib$(TARGET).a *.o

example-code:
examples:
make -C examples

mpsse.o: support.o
Expand All @@ -34,30 +30,7 @@ fast.o: support.o
support.o:
$(CC) $(CFLAGS) $(LDFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c support.c

pyswig-build:
$(CC) $(CFLAGS) $(LDFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c support.c
$(CC) $(CFLAGS) $(LDFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c
$(SWIG) -python $(TARGET).i
$(CC) $(CFLAGS) -c -DLIBFTDI1=$(LIBFTDI1) $(TARGET)_wrap.c $(INC)
$(CC) $(CFLAGS) -shared $(FRAMEWORK) $(TARGET)_wrap.o mpsse.o support.o \
-o _pylib$(TARGET).so $(LDFLAGS) $(INC)

pyswig-install:
install -D -m644 pylib$(TARGET).py $(DESTDIR)/$(PYLIB)/pylib$(TARGET).py
install -D -m644 _pylib$(TARGET).so $(DESTDIR)/$(PYLIB)/_pylib$(TARGET).so
install -D -m644 $(TARGET).py $(DESTDIR)/$(PYLIB)/$(TARGET).py

pyswig-uninstall:
rm -f $(DESTDIR)/$(PYLIB)/$(TARGET).* \
$(DESTDIR)/$(PYLIB)/pylib$(TARGET).* \
$(DESTDIR)/$(PYLIB)/_pylib$(TARGET).*

# Dummy rules for when $BUILD == "" (if --disable-python was passed to ./configure)
py-build:
py-install:
py-uninstall:

install: py$(BUILD)-install
install:
install -D -m644 lib$(TARGET).so $(DESTDIR)/$(LIBDIR)/lib$(TARGET).so
install -D -m644 lib$(TARGET).a $(DESTDIR)/$(LIBDIR)/lib$(TARGET).a
install -D -m644 $(TARGET).h $(DESTDIR)/$(INCDIR)/$(TARGET).h
Expand All @@ -69,7 +42,7 @@ uninstall: py$(BUILD)-uninstall

clean:
make -C examples clean
rm -rf *.o *.so *.a _$(TARGET).py* pylib$(TARGET).py* $(TARGET)_wrap.c *.pyc
rm -rf *.o *.so *.a

distclean: clean
rm -rf *.cache config.* Makefile
Expand Down
Loading

0 comments on commit 235fd68

Please sign in to comment.