xref: /illumos-gate/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com (revision 91419a03c0bb1b3a6ce59ebc16bd5ccfe25c9d39)
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#
26LIBRARY =	pkcs11_tpm.a
27VERS =		.1
28
29RSA_DIR =		$(SRC)/common/crypto/rsa
30RSA_FLAGS =		-I$(RSA_DIR)
31
32BIGNUM_DIR =		$(SRC)/common/bignum
33BIGNUM_FLAGS =		-I$(BIGNUM_DIR)
34
35PADDING_DIR =		$(SRC)/common/crypto/padding
36PADDING_FLAGS =		-I$(PADDING_DIR)
37
38SOFTCRYPTOFLAGS =	$(RSA_FLAGS) $(PADDING_FLAGS) $(BIGNUM_FLAGS)
39
40OBJECTS= api_interface.o \
41	apiutil.o \
42	asn1.o \
43	cert.o \
44	data_obj.o \
45	decr_mgr.o \
46	dig_mgr.o \
47	encr_mgr.o \
48	globals.o \
49	hwf_obj.o \
50	key.o \
51	key_mgr.o \
52	loadsave.o \
53	log.o \
54	mech_md5.o \
55	mech_rsa.o \
56	mech_sha.o \
57	new_host.o \
58	obj_mgr.o \
59	object.o \
60	sess_mgr.o \
61	sign_mgr.o \
62	template.o \
63	tpm_specific.o \
64	utility.o \
65	verify_mgr.o
66
67
68include $(SRC)/lib/Makefile.lib
69
70SRCDIR= ../common
71
72SRCS=	$(OBJECTS:%.o=$(SRCDIR)/%.c)
73
74#       set signing mode
75POST_PROCESS_SO +=      ; $(ELFSIGN_CRYPTO)
76
77ROOTLIBDIR=$(ROOT)/usr/lib/security
78ROOTLIBDIR64=$(ROOT)/usr/lib/security/$(MACH64)
79
80LIBS=$(DYNLIB) $(DYNLIB64)
81
82TSSROOT=$(ADJUNCT_PROTO)
83TSPILIBDIR=$(TSSROOT)/usr/lib
84TSPIINCDIR=$(TSSROOT)/usr/include
85TSSLIB=-L$(TSPILIBDIR)
86TSSLIB64=-L$(TSPILIBDIR)/$(MACH64)
87TSSINC=-I$(TSPIINCDIR)
88
89LDLIBS += $(TSSLIB) -L$(ADJUNCT_PROTO)/lib -lc -luuid -lmd -ltspi -lsoftcrypto
90CPPFLAGS += -xCC -D_POSIX_PTHREAD_SEMANTICS $(TSSINC) $(SOFTCRYPTOFLAGS)
91CPPFLAGS64 += $(CPPFLAGS)
92CSTD=        $(CSTD_GNU99)
93
94CERRWARN +=	-_gcc=-Wno-parentheses
95CERRWARN +=	-_gcc=-Wno-unused-label
96CERRWARN +=	-_gcc=-Wno-uninitialized
97
98LINTSRC= $(OBJECTS:%.o=$(SRCDIR)/%.c)
99
100$(LINTLIB):=	SRCS	=	$(SRCDIR)/$(LINTSRC)
101LINTSRC= $(SRCS)
102
103CLOBBERFILES += C.ln
104
105.KEEP_STATE:
106
107all: $(LIBS)
108
109lint: $$(LINTSRC)
110	$(LINT.c) $(LINTCHECKFLAGS) $(LINTSRC) $(LDLIBS)
111
112pics/%.o: $(SRCDIR)/%.c
113	$(COMPILE.c) -o $@ $<
114	$(POST_PROCESS_O)
115
116include $(SRC)/lib/Makefile.targ
117