1ab3b3d65158d3b08dde70367b5dde71e0520b6f
[platform/upstream/p11-kit.git] / p11-kit / Makefile.am
1
2 include $(top_srcdir)/build/Makefile.decl
3
4 SUBDIRS = . tests
5
6 COMMON = $(top_srcdir)/common
7
8 INCLUDES = \
9         -I$(top_srcdir) \
10         -I$(COMMON) \
11         -DP11_KIT_FUTURE_UNSTABLE_API \
12         $(NULL)
13
14 incdir = $(includedir)/p11-kit-1/p11-kit
15
16 inc_HEADERS = \
17         iter.h \
18         p11-kit.h \
19         pin.h \
20         uri.h \
21         $(NULL)
22
23 MODULE_SRCS = \
24         util.c \
25         conf.c conf.h \
26         iter.c \
27         modules.c \
28         pkcs11.h \
29         pin.c \
30         pkcs11.h \
31         proxy.c \
32         private.h \
33         messages.c \
34         uri.c \
35         $(inc_HEADERS)
36
37 lib_LTLIBRARIES = \
38         libp11-kit.la
39
40 libp11_kit_la_CFLAGS = \
41         -DP11_SYSTEM_CONFIG_FILE=\""$(p11_system_config_file)"\" \
42         -DP11_SYSTEM_CONFIG_MODULES=\""$(p11_system_config_modules)"\" \
43         -DP11_PACKAGE_CONFIG_MODULES=\""$(p11_package_config_modules)"\" \
44         -DP11_USER_CONFIG_FILE=\""$(p11_user_config_file)"\" \
45         -DP11_USER_CONFIG_MODULES=\""$(p11_user_config_modules)"\" \
46         -DP11_MODULE_PATH=\""$(p11_module_path)"\" \
47         $(NULL)
48
49 libp11_kit_la_LDFLAGS = \
50         -no-undefined \
51         -version-info $(P11KIT_LT_RELEASE) \
52         -export-symbols-regex '^C_GetFunctionList|^p11_kit_'
53
54 libp11_kit_la_SOURCES = $(MODULE_SRCS)
55
56 libp11_kit_la_LIBADD = \
57         $(LTLIBINTL) \
58         $(top_builddir)/common/libp11-common.la \
59         $(top_builddir)/common/libp11-library.la \
60         $(NULL)
61
62 noinst_LTLIBRARIES = \
63         libp11-kit-testable.la
64
65 libp11_kit_testable_la_LDFLAGS = -no-undefined
66 libp11_kit_testable_la_SOURCES = $(MODULE_SRCS)
67 libp11_kit_testable_la_LIBADD = $(libp11_kit_la_LIBADD)
68
69 if OS_WIN32
70
71 libp11_kit_testable_la_CFLAGS = \
72         -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \
73         -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules/win32"\" \
74         -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules/win32"\" \
75         -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \
76         -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules/win32"\" \
77         -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \
78         $(NULL)
79
80 else
81
82 libp11_kit_testable_la_CFLAGS = \
83         -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \
84         -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules"\" \
85         -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules"\" \
86         -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \
87         -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules"\" \
88         -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \
89         $(NULL)
90
91 endif
92
93 pkgconfigdir = $(libdir)/pkgconfig
94 pkgconfig_DATA = p11-kit-1.pc
95
96 exampledir = $(p11_system_config)
97 example_DATA = pkcs11.conf.example
98
99 EXTRA_DIST = \
100         p11-kit-1.pc.in \
101         pkcs11.conf.example.in
102
103 # Proxy module is actually same as library, so install a link
104 install-exec-hook:
105         $(LN_S) -f `readlink $(DESTDIR)$(libdir)/libp11-kit.so` $(DESTDIR)$(libdir)/p11-kit-proxy.so
106         $(MKDIR_P) $(DESTDIR)$(p11_package_config_modules)