Makefile.am 3.99 KB
Newer Older
Marc-André Lureau's avatar
Marc-André Lureau committed
1 2 3 4 5 6 7
SUBDIRS = src
ACLOCAL_AMFLAGS = --install -I m4

lib_LTLIBRARIES = libcacard.la

libcacard_la_SOURCES =				\
	src/cac.c				\
Jakub Jelen's avatar
Jakub Jelen committed
8 9
	src/cac-aca.c				\
	src/cac-aca.h				\
Jakub Jelen's avatar
Jakub Jelen committed
10 11
	src/gp.c				\
	src/gp.h				\
12
	src/capcsc.h				\
Marc-André Lureau's avatar
Marc-André Lureau committed
13
	src/card_7816.c				\
14 15
	src/common.c				\
	src/common.h				\
Marc-André Lureau's avatar
Marc-André Lureau committed
16 17
	src/event.c				\
	src/glib-compat.h			\
18 19
	src/simpletlv.c				\
	src/simpletlv.h				\
Marc-André Lureau's avatar
Marc-André Lureau committed
20 21 22 23
	src/vcard.c				\
	src/vcard_emul_nss.c			\
	src/vcard_emul_type.c			\
	src/vcardt.c				\
24
	src/vcardt_internal.h			\
Marc-André Lureau's avatar
Marc-André Lureau committed
25 26 27
	src/vreader.c				\
	$(NULL)

28 29 30 31
if ENABLE_PCSC
libcacard_la_SOURCES += src/capcsc.c
endif

Marc-André Lureau's avatar
Marc-André Lureau committed
32 33 34 35 36 37
libcacard_includedir = $(includedir)/cacard
libcacard_include_HEADERS =			\
	src/cac.h				\
	src/card_7816.h				\
	src/card_7816t.h			\
	src/eventt.h				\
Marc-André Lureau's avatar
Marc-André Lureau committed
38
	src/libcacard.h				\
Marc-André Lureau's avatar
Marc-André Lureau committed
39 40 41 42 43 44 45 46 47 48
	src/vcard.h				\
	src/vcard_emul.h			\
	src/vcard_emul_type.h			\
	src/vcardt.h				\
	src/vevent.h				\
	src/vreader.h				\
	src/vreadert.h				\
	src/vscard_common.h			\
	$(NULL)

49
libcacard_la_LIBADD = $(CACARD_LIBS) $(PCSC_LIBS)
Marc-André Lureau's avatar
Marc-André Lureau committed
50 51 52 53
libcacard_la_LDFLAGS =					\
	-export-symbols $(srcdir)/src/libcacard.syms	\
	-no-undefined					\
	-version-info 0:0:0				\
54
	$(AM_LDFLAGS)					\
Marc-André Lureau's avatar
Marc-André Lureau committed
55 56
	$(NULL)

57 58 59 60
if OS_WIN32
libcacard_la_LIBADD += -lws2_32
endif

Marc-André Lureau's avatar
Marc-André Lureau committed
61 62 63
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcacard.pc

64 65 66
include $(srcdir)/build-aux/glib-tap.mk

noinst_PROGRAMS += vscclient
Marc-André Lureau's avatar
Marc-André Lureau committed
67
vscclient_SOURCES = src/vscclient.c
68 69
vscclient_LDADD = libcacard.la $(GTHREAD_LIBS) $(PCSC_LIBS)
vscclient_CFLAGS = $(AM_CPPFLAGS) $(GTHREAD_CFLAGS) $(PCSC_CFLAGS)
Marc-André Lureau's avatar
Marc-André Lureau committed
70

71 72 73 74
if OS_WIN32
vscclient_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
endif

75 76 77 78 79 80 81 82 83 84 85
tests/softhsm2.conf:
	$(AM_V_GEN)(cd tests/ && $(abs_srcdir)/tests/setup-softhsm2.sh)

clean-local:
	rm -rf tests/hwdb tests/tokens tests/softhsm2.conf

EXTRA_DIST += tests/setup-softhsm2.sh

AM_TESTS_ENVIRONMENT += \
	SOFTHSM2_CONF=tests/softhsm2.conf

86 87 88
test_programs =					\
	tests/libcacard				\
	tests/simpletlv				\
89
	tests/hwtests				\
90 91
	$(NULL)

92 93 94 95 96
tests_libcacard_SOURCES =			\
	tests/common.c				\
	tests/common.h				\
	tests/libcacard.c			\
	$(NULL)
97 98 99 100 101
tests_libcacard_LDADD =				\
	libcacard.la				\
	src/common.lo				\
	src/simpletlv.lo			\
	$(NULL)
102 103 104 105 106 107

tests_simpletlv_LDADD =				\
	libcacard.la				\
	src/common.lo				\
	src/simpletlv.lo			\
	$(NULL)
108

109 110 111 112 113 114 115 116 117 118 119 120
tests_hwtests_SOURCES =				\
	tests/common.c				\
	tests/common.h				\
	tests/hwtests.c				\
	$(NULL)
tests_hwtests_LDADD =				\
	libcacard.la				\
	src/common.lo				\
	src/simpletlv.lo			\
	$(NULL)
tests_hwtests_DEPENDENCIES = tests/softhsm2.conf

121 122 123
@CODE_COVERAGE_RULES@

AM_CPPFLAGS =					\
124
	-DG_LOG_DOMAIN=\"libcacard\"		\
125
	-DLIBCACARD_COMPILATION			\
126 127 128 129 130 131 132 133 134
	$(CACARD_CFLAGS)			\
	$(CODE_COVERAGE_CFLAGS)			\
	$(PCSC_CFLAGS)				\
	$(WARN_CFLAGS)				\
	-I$(srcdir)/src				\
	$(NULL)
AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) $(WARN_LDFLAGS)

EXTRA_DIST +=					\
Marc-André Lureau's avatar
Marc-André Lureau committed
135
	NEWS					\
Marc-André Lureau's avatar
Marc-André Lureau committed
136 137 138
	README.md				\
	docs/libcacard.txt			\
	src/libcacard.syms			\
139 140 141 142 143
	build-aux/tap-driver.sh			\
	build-aux/tap-test			\
	tests/db/cert8.db                       \
	tests/db/key3.db                        \
	tests/db/secmod.db                      \
144
	tests/cert.cfg				\
Marc-André Lureau's avatar
Marc-André Lureau committed
145 146
	$(NULL)

147
# aclocal will copy m4 files from pkg-config/autoconf-archives
148
MAINTAINERCLEANFILES +=	$(srcdir)/m4/pkg.m4
149
MAINTAINERCLEANFILES +=	$(srcdir)/m4/ax_*.m4
150

151
MAINTAINERCLEANFILES +=					\
Marc-André Lureau's avatar
Marc-André Lureau committed
152 153 154 155 156 157 158 159 160 161 162
	$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL)	\
	$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN)	\
	$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL)

# see git-version-gen
dist-hook: gen-ChangeLog
	echo $(VERSION) > $(distdir)/.tarball-version

$(top_srcdir)/.version:
	echo $(VERSION) > $@-t && mv $@-t $@

163
BUILT_SOURCES += $(top_srcdir)/.version
164 165 166 167 168
EXTRA_DIST +=				\
	$(top_srcdir)/.version		\
	build-aux/git-version-gen	\
	$(NULL)

Marc-André Lureau's avatar
Marc-André Lureau committed
169 170 171 172 173 174 175 176 177 178 179 180 181
gen-ChangeLog:
	@if test -d "$(srcdir)/.git"; then \
	  echo Generating ChangeLog... ; \
	  ( cd "$(srcdir)" \
	    && $(top_srcdir)/build-aux/missing --run git log --stat ) > ChangeLog.tmp \
	  && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
	  || ( rm -f ChangeLog.tmp; \
	       echo Failed to generate ChangeLog >&2 ); \
	else \
	  echo A git checkout is required to generate a ChangeLog >&2; \
	fi

-include $(top_srcdir)/git.mk