xref: /illumos-gate/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24# Copyright 2018 Jason King
25#
26# Copyright (c) 2018, Joyent, Inc.
27
28LIBRARY =	pkcs11_tpm.a
29VERS =		.1
30
31RSA_DIR =		$(SRC)/common/crypto/rsa
32RSA_FLAGS =		-I$(RSA_DIR)
33
34BIGNUM_DIR =		$(SRC)/common/bignum
35BIGNUM_FLAGS =		-I$(BIGNUM_DIR)
36
37PADDING_DIR =		$(SRC)/common/crypto/padding
38PADDING_FLAGS =		-I$(PADDING_DIR)
39
40SOFTCRYPTOFLAGS =	$(RSA_FLAGS) $(PADDING_FLAGS) $(BIGNUM_FLAGS)
41
42OBJECTS= api_interface.o \
43	apiutil.o \
44	asn1.o \
45	cert.o \
46	data_obj.o \
47	decr_mgr.o \
48	dig_mgr.o \
49	encr_mgr.o \
50	globals.o \
51	hwf_obj.o \
52	key.o \
53	key_mgr.o \
54	loadsave.o \
55	log.o \
56	mech_md5.o \
57	mech_rsa.o \
58	mech_sha.o \
59	new_host.o \
60	obj_mgr.o \
61	object.o \
62	sess_mgr.o \
63	sign_mgr.o \
64	template.o \
65	tpm_specific.o \
66	utility.o \
67	verify_mgr.o
68
69
70include $(SRC)/lib/Makefile.lib
71
72SRCDIR= ../common
73
74SRCS=	$(OBJECTS:%.o=$(SRCDIR)/%.c)
75
76#       set signing mode
77POST_PROCESS_SO +=      ; $(ELFSIGN_CRYPTO)
78
79ROOTLIBDIR=$(ROOT)/usr/lib/security
80ROOTLIBDIR64=$(ROOT)/usr/lib/security/$(MACH64)
81
82LIBS=$(DYNLIB) $(DYNLIB64)
83
84TSSROOT=$(ADJUNCT_PROTO)
85TSPILIBDIR=$(TSSROOT)/usr/lib
86TSPIINCDIR=$(TSSROOT)/usr/include
87TSSLIB=-L$(TSPILIBDIR)
88TSSLIB64=-L$(TSPILIBDIR)/$(MACH64)
89TSSINC=-I$(TSPIINCDIR)
90
91LDLIBS += $(TSSLIB) -L$(ADJUNCT_PROTO)/lib -lc -luuid -lmd -ltspi -lsoftcrypto
92CPPFLAGS += -xCC -D_POSIX_PTHREAD_SEMANTICS $(TSSINC) $(SOFTCRYPTOFLAGS)
93CPPFLAGS64 += $(CPPFLAGS)
94CSTD=        $(CSTD_GNU99)
95
96CERRWARN +=	-_gcc=-Wno-parentheses
97CERRWARN +=	-_gcc=-Wno-unused-label
98CERRWARN +=	$(CNOWARN_UNINIT)
99
100# not linted
101SMATCH=off
102
103.KEEP_STATE:
104
105all: $(LIBS)
106
107
108pics/%.o: $(SRCDIR)/%.c
109	$(COMPILE.c) -o $@ $<
110	$(POST_PROCESS_O)
111
112include $(SRC)/lib/Makefile.targ
113