| 1 |
# $Id$
|
| 2 |
|
| 3 |
CCID_BUNDLE = ifd-ccid.bundle
|
| 4 |
CCID_LIB = libccid.$(DYN_LIB_EXT)
|
| 5 |
CCIDTWIN_LIB = libccidtwin.$(DYN_LIB_EXT)
|
| 6 |
|
| 7 |
CCID_VERSION=CCID_VERSION=`$(srcdir)/convert_version.pl $(PACKAGE_VERSION)`
|
| 8 |
|
| 9 |
lib_LTLIBRARIES = libccid.la
|
| 10 |
LIBS_TO_INSTALL = install_ccid
|
| 11 |
if WITH_TWIN_SERIAL
|
| 12 |
lib_LTLIBRARIES += libccidtwin.la
|
| 13 |
LIBS_TO_INSTALL += install_ccidtwin
|
| 14 |
endif
|
| 15 |
bin_PROGRAMS = parse
|
| 16 |
|
| 17 |
COMMON = ccid.c \
|
| 18 |
ccid.h \
|
| 19 |
ccid_ifdhandler.h \
|
| 20 |
commands.c \
|
| 21 |
commands.h \
|
| 22 |
debug.h \
|
| 23 |
defs.h \
|
| 24 |
ifdhandler.c \
|
| 25 |
utils.c \
|
| 26 |
utils.h
|
| 27 |
USB = ccid_usb.c ccid_usb.h
|
| 28 |
SERIAL = ccid_serial.c ccid_serial.h
|
| 29 |
T1 = towitoko/atr.c \
|
| 30 |
towitoko/atr.h \
|
| 31 |
towitoko/defines.h \
|
| 32 |
towitoko/pps.c \
|
| 33 |
towitoko/pps.h \
|
| 34 |
openct/buffer.c \
|
| 35 |
openct/buffer.h \
|
| 36 |
openct/checksum.c \
|
| 37 |
openct/checksum.h \
|
| 38 |
openct/proto-t1.c \
|
| 39 |
openct/proto-t1.h
|
| 40 |
TOKEN_PARSER = tokenparser.l parser.h \
|
| 41 |
strlcpy.c \
|
| 42 |
misc.h \
|
| 43 |
strlcpycat.h
|
| 44 |
|
| 45 |
if WITHOUT_PCSC
|
| 46 |
PROVIDED_BY_PCSC = debug.c
|
| 47 |
endif
|
| 48 |
|
| 49 |
libccid_la_SOURCES = $(COMMON) $(USB) $(TOKEN_PARSER) $(PROVIDED_BY_PCSC) $(T1)
|
| 50 |
libccid_la_LIBADD = $(LEXLIB) $(COREFOUNDATION) $(IOKIT) \
|
| 51 |
$(LIBUSB_LIBS) $(PTHREAD_LIBS)
|
| 52 |
libccid_la_CFLAGS = $(PCSC_CFLAGS) $(LIBUSB_CFLAGS) $(PTHREAD_CFLAGS) \
|
| 53 |
$(SYMBOL_VISIBILITY) -D$(CCID_VERSION)
|
| 54 |
|
| 55 |
libccidtwin_la_SOURCES = $(COMMON) $(SERIAL) $(TOKEN_PARSER) \
|
| 56 |
$(PROVIDED_BY_PCSC) $(T1)
|
| 57 |
libccidtwin_la_CFLAGS = $(PCSC_CFLAGS) $(PTHREAD_CFLAGS) $(SYMBOL_VISIBILITY) \
|
| 58 |
-DTWIN_SERIAL -D$(CCID_VERSION)
|
| 59 |
libccidtwin_la_LIBADD = $(PTHREAD_LIBS)
|
| 60 |
|
| 61 |
parse_SOURCES = parse.c debug.c
|
| 62 |
parse_LDADD = libccid.la
|
| 63 |
parse_CFLAGS = $(PCSC_CFLAGS) $(LIBUSB_CFLAGS)
|
| 64 |
|
| 65 |
EXTRA_DIST = Info.plist create_Info_plist.pl reader.conf.in \
|
| 66 |
towitoko/COPYING towitoko/README openct/LICENSE \
|
| 67 |
convert_version.pl pcscd_ccid.rules
|
| 68 |
|
| 69 |
install: $(LIBS_TO_INSTALL)
|
| 70 |
|
| 71 |
if UDEV
|
| 72 |
ifdCapabilities=0x00000001
|
| 73 |
INSTALL_UDEV_RULE_FILE=$(mkinstalldirs) $(DESTDIR)/etc/udev/rules.d ; cp pcscd_ccid.rules $(DESTDIR)/etc/udev/ ; cd $(DESTDIR)/etc/udev/rules.d ; ln -s ../pcscd_ccid.rules 50-pcscd_ccid.rules
|
| 74 |
else
|
| 75 |
ifdCapabilities=0x00000000
|
| 76 |
endif
|
| 77 |
|
| 78 |
install_ccid: libccid.la
|
| 79 |
$(mkinstalldirs) $(DESTDIR)$(usbdropdir)/$(CCID_BUNDLE)/Contents/$(BUNDLE_HOST)/
|
| 80 |
$(srcdir)/create_Info_plist.pl $(srcdir)/../readers/supported_readers.txt $(srcdir)/Info.plist $(ifdCapabilities) | sed s/VERSION/$(VERSION)/ | sed s/TARGET/$(CCID_LIB)/ > $(DESTDIR)$(usbdropdir)/$(CCID_BUNDLE)/Contents/Info.plist
|
| 81 |
cp .libs/$(CCID_LIB) $(DESTDIR)$(usbdropdir)/$(CCID_BUNDLE)/Contents/$(BUNDLE_HOST)/$(CCID_LIB).$(VERSION)
|
| 82 |
$(INSTALL_UDEV_RULE_FILE)
|
| 83 |
|
| 84 |
install_ccidtwin: libccidtwin.la
|
| 85 |
$(mkinstalldirs) $(DESTDIR)$(ccidtwindir)
|
| 86 |
cp .libs/$(CCIDTWIN_LIB) $(DESTDIR)$(ccidtwindir)/$(CCIDTWIN_LIB).$(VERSION)
|
| 87 |
if [ -e $(DESTDIR)/etc/reader.conf ] ; \
|
| 88 |
then \
|
| 89 |
echo "Edit existing /etc/reader.conf" ; \
|
| 90 |
else \
|
| 91 |
$(mkinstalldirs) $(DESTDIR)/etc ; \
|
| 92 |
perl -ne "s|TARGET|$(ccidtwindir)/$(CCIDTWIN_LIB).$(VERSION)| ; print" $(srcdir)/reader.conf.in > $(DESTDIR)/etc/reader.conf ; \
|
| 93 |
fi
|
| 94 |
|
| 95 |
# do not uninstall the serial driver by default
|
| 96 |
# use explicitely 'make uninstall_ccidtwin'
|
| 97 |
uninstall: uninstall_ccid
|
| 98 |
|
| 99 |
uninstall_ccid:
|
| 100 |
rm -rf $(DESTDIR)$(usbdropdir)/$(CCID_BUNDLE)
|
| 101 |
|
| 102 |
uninstall_ccidtwin:
|
| 103 |
rm -f $(DESTDIR)$(ccidtwindir)/$(CCIDTWIN_LIB).$(VERSION)
|
| 104 |
|