summaryrefslogtreecommitdiff
path: root/python/Makefile
diff options
context:
space:
mode:
authormeri <meri@e0336214-984f-0b4b-a45f-81c69e1f0ede>2007-05-30 22:03:53 +0000
committermeri <meri@e0336214-984f-0b4b-a45f-81c69e1f0ede>2007-05-30 22:03:53 +0000
commitf323012d879181580bec0cff312819d678ed2e56 (patch)
tree819d0bf93be5ff83b50f9d63c2f730c0b88b21aa /python/Makefile
parenta91cd3d9e2a4e985c63850679e8242c6d08fed08 (diff)
python support by Kushal Das
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1997 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'python/Makefile')
-rw-r--r--python/Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/python/Makefile b/python/Makefile
new file mode 100644
index 0000000..28fd93c
--- /dev/null
+++ b/python/Makefile
@@ -0,0 +1,34 @@
+CC=gcc
+PYTHON=python
+PREFIX=/usr
+PYTHON_VER=2.5
+PYTHON_INC=$(PREFIX)/include/python$(PYTHON_VER)
+PYTHON_LIB=$(PREFIX)/lib/python$(PYTHON_VER)/site-packages/
+LIBRFID_DIR=../src/.libs/librfid.la
+LIBUSB_DIR=/usr/local/lib
+
+SOURCE_MAIN=pyrfid.c
+SOURCES=$(SOURCE_MAIN) ../utils/common.c
+INCLUDES=-I$(PYTHON_INC) -I../include/ -I../utils/
+CFLAGS=-O3 -Wall $(INCLUDES)
+LDFLAGS=-shared -L$(LIBRFID_DIR) -lrfid -L$(LIBUSB_DIR) -lusb -Wl,--rpath -Wl,/usr/local/lib $(LIBS)
+TARGET=$(SOURCE_MAIN:.c=.so)
+OBJECTS=$(SOURCES:.c=.o)
+
+all: $(SOURCE_MAIN) $(TARGET)
+
+test:
+ $(PYTHON) $@.py
+
+install: $(TARGET)
+ install $(TARGET) $(PYTHON_LIB)
+
+$(TARGET): $(OBJECTS)
+ $(CC) $(LDFLAGS) -o $@ $(OBJECTS)
+
+.c.o:
+ $(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+ rm -f $(OBJECTS) $(TARGET)
+
personal git repositories of Harald Welte. Your mileage may vary