dependencies for debian install
[librfid] / python / Makefile
1 # Makefile for Python bindings 
2 # (C) 2007-2008 by Kushal Das <kushal@openpcd.org>
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 2 
6 # as published by the Free Software Foundation
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
17
18
19 CC=gcc
20 PYTHON=python
21 PREFIX=/usr
22 PYTHON_VER=2.5
23 PYTHON_INC=$(PREFIX)/include/python$(PYTHON_VER)
24 PYTHON_LIB=$(PREFIX)/lib/python$(PYTHON_VER)/site-packages/
25 LIBRFID_DIR=../src/.libs
26
27 SOURCE_MAIN=pyrfid.c
28 SOURCES=$(SOURCE_MAIN)  openpcd.c
29 INCLUDES=-I$(PYTHON_INC) -I../include/ -I../utils/
30 CFLAGS=-O3 -Wall $(INCLUDES)
31 LDFLAGS=-shared -L$(LIBRFID_DIR) -lrfid -lusb  -Wl,--rpath -Wl,/usr/local/lib $(LIBS)
32 TARGET=$(SOURCE_MAIN:.c=.so)
33 OBJECTS=$(SOURCES:.c=.o)
34
35 all: $(SOURCE_MAIN) $(TARGET)
36
37 test:
38         $(PYTHON) $@.py
39
40 install: $(TARGET)
41         install $(TARGET) $(PYTHON_LIB)
42
43 $(TARGET): $(OBJECTS)
44         $(CC) $(LDFLAGS) -o $@ $(OBJECTS)
45
46 .c.o:
47         $(CC) $(CFLAGS) -c $< -o $@
48
49 clean:
50         rm -f $(OBJECTS) $(TARGET)
51