Unbreak example and add autotool stuff to help building.
This commit is contained in:
parent
0c0d8e77a3
commit
2b76328c78
3 changed files with 11 additions and 5 deletions
|
@ -41,5 +41,5 @@ PKG_CHECK_MODULES([LIBNFC], [libnfc], [], [AC_MSG_ERROR([libnfc is mandatory.])]
|
||||||
PKG_CONFIG_REQUIRES="libnfc"
|
PKG_CONFIG_REQUIRES="libnfc"
|
||||||
AC_SUBST([PKG_CONFIG_REQUIRES])
|
AC_SUBST([PKG_CONFIG_REQUIRES])
|
||||||
|
|
||||||
AC_OUTPUT([Makefile libfreefare/Makefile libfreefare.pc])
|
AC_OUTPUT([Makefile examples/Makefile libfreefare/Makefile libfreefare.pc])
|
||||||
|
|
||||||
|
|
7
examples/Makefile.am
Normal file
7
examples/Makefile.am
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
AM_CFLAGS = -I. @LIBNFC_CFLAGS@
|
||||||
|
AM_LDFLAGS = @LIBNFC_LIBS@
|
||||||
|
|
||||||
|
bin_PROGRAMS = mifare-classic-format
|
||||||
|
|
||||||
|
mifare_classic_format_SOURCES = mifare-classic-format.c
|
||||||
|
mifare_classic_format_LDADD = -lnfc $(top_builddir)/libfreefare/libfreefare.la
|
|
@ -4,17 +4,16 @@
|
||||||
|
|
||||||
#include <nfc/nfc.h>
|
#include <nfc/nfc.h>
|
||||||
|
|
||||||
#include <mifare_common.h>
|
#include <freefare.h>
|
||||||
#include <mifare_classic.h>
|
|
||||||
|
|
||||||
#define DEBUG 1
|
#define DEBUG
|
||||||
|
|
||||||
// Useful macros
|
// Useful macros
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// #define DBG(x, args...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__,## args )
|
// #define DBG(x, args...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__,## args )
|
||||||
#define DBG(x, ...) fprintf(stderr, "DBG %s:%d: " x "\n", __FILE__, __LINE__, ## __VA_ARGS__ )
|
#define DBG(x, ...) fprintf(stderr, "DBG %s:%d: " x "\n", __FILE__, __LINE__, ## __VA_ARGS__ )
|
||||||
#else
|
#else
|
||||||
#define DBG(...) {}
|
#define DBG(...) do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static nfc_device_t *device = NULL;
|
static nfc_device_t *device = NULL;
|
||||||
|
|
Loading…
Reference in a new issue