summaryrefslogtreecommitdiff
path: root/python/Makefile
blob: 5a77b1515d81a40d32b2ecef33964708a17a95ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
LIBOPENPCD_DIR=/usr/local/openpcd/lib

SOURCE_MAIN=pyrfid.c
SOURCES=$(SOURCE_MAIN)  openpcd.c
INCLUDES=-I$(PYTHON_INC) -I../include/ -I../utils/
CFLAGS=-O3 -Wall $(INCLUDES)
LDFLAGS=-shared -L$(LIBRFID_DIR) -lrfid -L$(LIBOPENPCD_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