1 # Makefile for Python bindings
2 # (C) 2007-2008 by Kushal Das <kushal@openpcd.org>
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
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.
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
23 PYTHON_INC=$(PREFIX)/include/python$(PYTHON_VER)
24 PYTHON_LIB=$(PREFIX)/lib/python$(PYTHON_VER)/site-packages/
25 LIBRFID_DIR=../src/.libs
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)
35 all: $(SOURCE_MAIN) $(TARGET)
41 install $(TARGET) $(PYTHON_LIB)
44 $(CC) $(LDFLAGS) -o $@ $(OBJECTS)
47 $(CC) $(CFLAGS) -c $< -o $@
50 rm -f $(OBJECTS) $(TARGET)