2010-01-08 12:46:23 +01:00
|
|
|
LMF_SRCDIR= ${.CURDIR}/../libfreefare
|
2009-12-19 03:06:21 +01:00
|
|
|
.PATH: ${LMF_SRCDIR}
|
|
|
|
|
|
|
|
#LMF_SRCS!= ${MAKE} -f ${LMF_SRCDIR}/Makefile -V SRCS
|
2010-01-08 12:46:23 +01:00
|
|
|
LMF_SRCS= ${LMF_SRCDIR}/mifare_classic.c \
|
|
|
|
${LMF_SRCDIR}/mad.c \
|
|
|
|
${LMF_SRCDIR}/mifare_application.c
|
2009-12-19 03:06:21 +01:00
|
|
|
|
|
|
|
TESTS= test_read_sector_0.c \
|
|
|
|
test_authenticate.c \
|
|
|
|
test_value_block.c \
|
|
|
|
test_access_bits.c \
|
2009-12-19 07:10:44 +01:00
|
|
|
test_format.c \
|
2009-12-21 01:02:40 +01:00
|
|
|
test_create_trailer_block.c \
|
2009-12-21 14:54:27 +01:00
|
|
|
test_mad.c \
|
|
|
|
test_mifare_application.c
|
2009-12-19 03:06:21 +01:00
|
|
|
|
|
|
|
SRCS= ${LMF_SRCS} \
|
|
|
|
${TESTS} \
|
|
|
|
main.c \
|
|
|
|
mifare_classic_test.c
|
|
|
|
|
|
|
|
# list.h must be up-to-date before building main.o
|
|
|
|
main.o: list.h
|
|
|
|
|
|
|
|
NO_MAN=
|
|
|
|
|
|
|
|
PROG= libfreefare_test
|
|
|
|
INTERNALPROG= yes
|
|
|
|
LDADD+= -lnfc
|
|
|
|
|
|
|
|
CFLAGS+= -std=c99
|
|
|
|
CFLAGS+= -ggdb
|
|
|
|
CFLAGS+= -Wall -pedantic
|
2010-01-08 12:46:23 +01:00
|
|
|
CFLAGS+= -I${LMF_SRCDIR} -I. -I..
|
2009-12-19 03:06:21 +01:00
|
|
|
|
|
|
|
.PHONY: check test
|
|
|
|
check test: libfreefare_test
|
|
|
|
./libfreefare_test
|
|
|
|
|
|
|
|
# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines
|
|
|
|
list.h: ${TESTS} Makefile
|
2009-12-19 07:10:44 +01:00
|
|
|
(cd ${.CURDIR}; cat ${TESTS}) | grep DEFINE_TEST > list.h
|
2009-12-19 03:06:21 +01:00
|
|
|
|
|
|
|
CLEANFILES+= list.h
|
|
|
|
|
|
|
|
cleantest:
|
|
|
|
-chmod -R +w /tmp/${PROG}.*
|
|
|
|
-rm -rf /tmp/${PROG}.*
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|