* Add spidev reader driver
* restructure automake usage, introduce shared Makefile.flags.am git-svn-id: https://svn.gnumonks.org/trunk/librfid@2047 e0336214-984f-0b4b-a45f-81c69e1f0ede
This commit is contained in:
parent
5fed5fd6d7
commit
685d1c4a5a
18
Makefile.am
18
Makefile.am
|
@ -1,22 +1,16 @@
|
||||||
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
|
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
|
||||||
|
|
||||||
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
SUBDIRS = etc include src
|
SUBDIRS = etc include src
|
||||||
|
|
||||||
DEFAULT_AM_CFLAGS = -std=gnu99
|
if ENABLE_FIRMWARE
|
||||||
|
else
|
||||||
|
SUBDIRS += utils
|
||||||
|
endif
|
||||||
|
|
||||||
if ENABLE_WIN32
|
if ENABLE_WIN32
|
||||||
SUBDIRS += win32
|
SUBDIRS += win32
|
||||||
LINKOPTS = -mno-cygwin
|
|
||||||
AM_CFLAGS = $(DEFAULT_AM_CFLAGS) -mno-cygwin
|
|
||||||
else
|
|
||||||
LINKOPTS = -lusb
|
|
||||||
AM_CFLAGS = $(DEFAULT_AM_CFLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if ENABLE_FIRMWARE
|
|
||||||
AM_CFLAGS += -DLIBRFID_FIRMWARE
|
|
||||||
else
|
|
||||||
SUBDIRS += utils
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch
|
EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
LIBVERSION= 0:0:0
|
||||||
|
|
||||||
|
AM_CFLAGS = -std=gnu99
|
||||||
|
INCLUDES = $(all_includes) -I$(top_srcdir)/include
|
||||||
|
|
||||||
|
if ENABLE_WIN32
|
||||||
|
AM_LDFLAGS = -mno-cygwin
|
||||||
|
AM_CFLAGS += -mno-cygwin
|
||||||
|
else
|
||||||
|
if HAVE_LIBUSB
|
||||||
|
AM_LDFLAGS = -lusb
|
||||||
|
AM_CFLAGS += -DHAVE_LIBUSB
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_FIRMWARE
|
||||||
|
AM_CFLAGS += -DLIBRFID_FIRMWARE
|
||||||
|
endif
|
|
@ -37,6 +37,11 @@ AC_ARG_ENABLE(openct,
|
||||||
[ENABLE_OPENCT="${enableval}"],
|
[ENABLE_OPENCT="${enableval}"],
|
||||||
[ENABLE_OPENCT="no"])
|
[ENABLE_OPENCT="no"])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(spidev,
|
||||||
|
[ --enable-spidev Enable spidev reader],
|
||||||
|
[ENABLE_SPIDEV=1], [ENABLE_SPIDEV=0])
|
||||||
|
AM_CONDITIONAL(ENABLE_SPIDEV, test "$ENABLE_SPIDEV" == "1")
|
||||||
|
|
||||||
OPENCT_MSG=no
|
OPENCT_MSG=no
|
||||||
if test "x${ENABLE_OPENCT}" = "xyes"; then
|
if test "x${ENABLE_OPENCT}" = "xyes"; then
|
||||||
PKG_CHECK_MODULES(OPENCT, [libopenct], [
|
PKG_CHECK_MODULES(OPENCT, [libopenct], [
|
||||||
|
@ -63,8 +68,8 @@ AM_CONDITIONAL(ENABLE_STATIC, test "$ENABLE_STATIC" == "1")
|
||||||
|
|
||||||
AC_ARG_WITH()
|
AC_ARG_WITH()
|
||||||
|
|
||||||
AC_CHECK_LIB(usb, usb_close,,)
|
AC_CHECK_LIB(usb, usb_close, [HAVE_LIBUSB=1], [HAVE_LIBUSB=0])
|
||||||
AM_CONDITIONAL(HAVE_LIBUSB, test "x$have_libusb" = "xyes")
|
AM_CONDITIONAL(HAVE_LIBUSB, test "$HAVE_LIBUSB" == "1")
|
||||||
|
|
||||||
dnl Output the makefile
|
dnl Output the makefile
|
||||||
AC_OUTPUT(Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile)
|
AC_OUTPUT(Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc win32/Makefile)
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
SUBDIRS = udev
|
SUBDIRS = udev
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
EXTRA_DIST = librfid.rules
|
EXTRA_DIST = librfid.rules
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
SUBDIRS = librfid
|
SUBDIRS = librfid
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \
|
pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \
|
||||||
rfid_layer2.h rfid_layer2_iso14443a.h \
|
rfid_layer2.h rfid_layer2_iso14443a.h \
|
||||||
|
|
|
@ -67,6 +67,7 @@ enum rfid_reader_id {
|
||||||
RFID_READER_CM5121,
|
RFID_READER_CM5121,
|
||||||
RFID_READER_PEGODA,
|
RFID_READER_PEGODA,
|
||||||
RFID_READER_OPENPCD,
|
RFID_READER_OPENPCD,
|
||||||
|
RFID_READER_SPIDEV,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfid_reader_handle {
|
struct rfid_reader_handle {
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
LIBVERSION= 0:0:0
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
|
AM_CFLAGS += -D__LIBRFID__
|
||||||
|
INCLUDES += @OPENCT_CFLAGS@
|
||||||
|
|
||||||
if ENABLE_FIRMWARE
|
if ENABLE_FIRMWARE
|
||||||
INCLUDES_FIRMWARE = -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include
|
INCLUDES += -I$(FIRMWARE_PATH)/include -I$(FIRMWARE_PATH)/src -I$(GNUARM_PATH)/arm-elf/include
|
||||||
AM_CFLAGS_FIRMWARE = -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__
|
AM_CFLAGS += -DLIBRFID_FIRMWARE -DLIBRFID_STATIC -D__MS_types__
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_STATIC
|
if ENABLE_STATIC
|
||||||
AM_CFLAGS_STATIC = -DLIBRFID_STATIC
|
AM_CFLAGS += -DLIBRFID_STATIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
noinst_HEADERS=rfid_iso14443_common.h rc632.h libusb_dyn.h usleep.h
|
noinst_HEADERS=rfid_iso14443_common.h rc632.h libusb_dyn.h usleep.h
|
||||||
|
@ -15,38 +18,40 @@ 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
|
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
|
PROTO=rfid_proto_tcl.c rfid_proto_mifare_ul.c rfid_proto_mifare_classic.c
|
||||||
ASIC=rfid_asic_rc632.c
|
ASIC=rfid_asic_rc632.c
|
||||||
READER=rfid_reader_openpcd.c
|
|
||||||
MISC=rfid_access_mifare_classic.c
|
MISC=rfid_access_mifare_classic.c
|
||||||
|
|
||||||
if ENABLE_WIN32
|
if ENABLE_WIN32
|
||||||
WIN32=usleep.c libusb_dyn.c
|
WIN32=usleep.c libusb_dyn.c
|
||||||
AM_LDLAGS_WIN32=-mno-cygwin -lwinmm
|
AM_LDLAGS_WIN32=-mno-cygwin -lwinmm
|
||||||
AM_CFLAGS_WIN32=-mno-cygwin
|
AM_CFLAGS_WIN32=-mno-cygwin
|
||||||
|
librfid_la_LIBADD = -lwinmm
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_LIBUSB
|
||||||
|
READER_OPENPCD=rfid_reader_openpcd.c
|
||||||
|
AM_CFLAGS += -DENABLE_OPENPCD
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_SPIDEV
|
||||||
|
READER_SPIDEV=rfid_reader_spidev.c
|
||||||
|
AM_CFLAGS += -DENABLE_SPIDEV
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_CCID
|
if ENABLE_CCID
|
||||||
READER_CM5121=rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c
|
READER_CM5121=rfid_reader_cm5121.c ccid/rfid_reader_cm5121_ccid_direct.c ccid/ccid-driver.c
|
||||||
AM_CFLAGS_CM5121= -DENABLE_CM5121
|
AM_CFLAGS += -DENABLE_CM5121
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if HAVE_OPENCT
|
if HAVE_OPENCT
|
||||||
READER_CM5121=rfid_reader_cm5121.c rfid_reader_cm5121_openct.c
|
READER_CM5121=rfid_reader_cm5121.c rfid_reader_cm5121_openct.c
|
||||||
AM_CFLAGS_CM5121= -DENABLE_CM5121
|
AM_CFLAGS += -DENABLE_CM5121
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INCLUDES = $(all_includes) -I$(top_srcdir)/include $(INCLUDES_FIRMWARE) \
|
|
||||||
$(INCLUDES_STATIC) @OPENCT_CFLAGS@
|
|
||||||
AM_CFLAGS = -std=gnu99 -D__LIBRFID__ $(AM_CFLAGS_FIRMWARE) $(AM_CFLAGS_STATIC) \
|
|
||||||
$(AM_CFLAGS_CM5121) $(AM_CFLAGS_WIN32)
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = librfid.la
|
lib_LTLIBRARIES = librfid.la
|
||||||
librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) $(AM_LDFLAGS_WIN32) @OPENCT_LIBS@
|
librfid_la_LDFLAGS = -Wc,-nostartfiles -version-info $(LIBVERSION) $(AM_LDFLAGS_WIN32) @OPENCT_LIBS@
|
||||||
librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(ASIC) $(MISC) \
|
librfid_la_SOURCES = $(CORE) $(L2) $(PROTO) $(ASIC) $(MISC) $(WIN32) \
|
||||||
$(READER) $(READER_CM5121) $(WIN32)
|
$(READER_OPENPCD) $(READER_CM5121) $(READER_SPIDEV)
|
||||||
|
|
||||||
if ENABLE_WIN32
|
|
||||||
librfid_la_LIBADD = -lwinmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = librfid.pc
|
pkgconfig_DATA = librfid.pc
|
||||||
|
|
|
@ -24,12 +24,18 @@
|
||||||
#include <librfid/rfid_reader.h>
|
#include <librfid/rfid_reader.h>
|
||||||
#include <librfid/rfid_reader_cm5121.h>
|
#include <librfid/rfid_reader_cm5121.h>
|
||||||
#include <librfid/rfid_reader_openpcd.h>
|
#include <librfid/rfid_reader_openpcd.h>
|
||||||
|
#include <librfid/rfid_reader_spidev.h>
|
||||||
|
|
||||||
static const struct rfid_reader *rfid_readers[] = {
|
static const struct rfid_reader *rfid_readers[] = {
|
||||||
|
#ifdef HAVE_LIBUSB
|
||||||
#ifdef ENABLE_CM5121
|
#ifdef ENABLE_CM5121
|
||||||
[RFID_READER_CM5121] = &rfid_reader_cm5121,
|
[RFID_READER_CM5121] = &rfid_reader_cm5121,
|
||||||
#endif
|
#endif
|
||||||
[RFID_READER_OPENPCD] = &rfid_reader_openpcd,
|
[RFID_READER_OPENPCD] = &rfid_reader_openpcd,
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_SPIDEV
|
||||||
|
[RFID_READER_SPIDEV] = &rfid_reader_spidev,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfid_reader_handle *
|
struct rfid_reader_handle *
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
INCLUDES = $(all_includes) -I$(top_srcdir)/include
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
if ENABLE_FIRMWARE
|
|
||||||
else
|
|
||||||
|
|
||||||
man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1
|
man_MANS = librfid-tool.1 mifare-tool.1 librfid-send_script.1
|
||||||
|
|
||||||
|
@ -26,5 +23,3 @@ librfid_send_script_LDFLAGS = $(LINKOPTS)
|
||||||
librfid_tool_LDFLAGS = $(LINKOPTS)
|
librfid_tool_LDFLAGS = $(LINKOPTS)
|
||||||
mifare_tool_LDFLAGS = $(LINKOPTS)
|
mifare_tool_LDFLAGS = $(LINKOPTS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
LIBVERSION= 0:0:0
|
include $(top_srcdir)/Makefile.flags.am
|
||||||
|
|
||||||
noinst_HEADERS = openpcd.h
|
noinst_HEADERS = openpcd.h
|
||||||
noinst_DATA = openpcd.dll
|
noinst_DATA = openpcd.dll
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/include
|
|
||||||
LIBRFID_DIR = $(top_builddir)/src/.libs/
|
LIBRFID_DIR = $(top_builddir)/src/.libs/
|
||||||
CLEANFILES = $(noinst_DATA)
|
CLEANFILES = $(noinst_DATA)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue