summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am29
-rw-r--r--src/rfid_reader.c2
-rw-r--r--src/rfid_reader_openpcd.c2
3 files changed, 25 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c0cbfbe..0c4be7c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,21 +1,38 @@
LIBVERSION= 0:0:0
-INCLUDES = $(all_includes) -I$(top_srcdir)/include -D__LIBRFID__
+INCLUDES = $(all_includes) -I$(top_srcdir)/include
+AM_CFLAGS = -std=gnu99 -D__LIBRFID__
-AM_CFLAGS = -std=gnu99
+if ENABLE_FIRMWARE
+INCLUDES += -I$(FIRMWARE_PATH)/include -I$(GNUARM_PATH)/arm-elf/include
+AM_CFLAGS += -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__
+endif
+
+if ENABLE_STATIC
+AM_CFLAGS += -DLIBRFID_STATIC
+endif
lib_LTLIBRARIES = librfid.la
CORE=rfid.c rfid_layer2.c rfid_protocol.c rfid_reader.c rfid_scan.c
L2=rfid_layer2_iso14443a.c rfid_layer2_iso14443b.c rfid_layer2_iso15693.c rfid_iso14443_common.c
PROTO=rfid_proto_tcl.c rfid_proto_mifare_ul.c rfid_proto_mifare_classic.c
-READER=rfid_reader_cm5121.c rfid_asic_rc632.c rfid_reader_openpcd.c
+ASIC=rfid_asic_rc632.c
+READER=rfid_reader_openpcd.c
+
+if ENABLE_CM5121
+READER += rfid_reader_cm5121.c
+AM_CFLAGS += -DENABLE_CM5121
-if MY_CCID
+if ENABLE_CCID
READER_LOW=ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c
-else
+endif
+
+if ENABLE_OPENCT
READER_LOW=rfid_reader_cm5121_openct.c
endif
+endif
+
librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) -lopenct
-librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(READER) $(READER_LOW)
+librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(READER) $(READER_LOW) $(ASIC)
diff --git a/src/rfid_reader.c b/src/rfid_reader.c
index a5dbeb2..af947ac 100644
--- a/src/rfid_reader.c
+++ b/src/rfid_reader.c
@@ -26,7 +26,7 @@
#include <librfid/rfid_reader_openpcd.h>
static const struct rfid_reader *rfid_readers[] = {
-#ifndef LIBRFID_FIRMWARE
+#ifdef ENABLE_CM5121
[RFID_READER_CM5121] = &rfid_reader_cm5121,
#endif
[RFID_READER_OPENPCD] = &rfid_reader_openpcd,
diff --git a/src/rfid_reader_openpcd.c b/src/rfid_reader_openpcd.c
index aee3d18..9397cb0 100644
--- a/src/rfid_reader_openpcd.c
+++ b/src/rfid_reader_openpcd.c
@@ -32,7 +32,6 @@
#include <string.h>
#include <errno.h>
-#include <usb.h>
#include <librfid/rfid.h>
#include <librfid/rfid_reader.h>
@@ -57,6 +56,7 @@ static struct openpcd_hdr *rcv_hdr;
#ifndef LIBRFID_FIRMWARE
+#include <usb.h>
static struct usb_device *dev;
static struct usb_dev_handle *hdl;
personal git repositories of Harald Welte. Your mileage may vary