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#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26LIBRARY= pkcs11_kernel.a
27VERS= .1
28
29CORE_OBJECTS= \
30	kernelGeneral.o 	\
31	kernelSlottable.o 	\
32	kernelSlotToken.o 	\
33	kernelObject.o 		\
34	kernelDigest.o	 	\
35	kernelSign.o 		\
36	kernelVerify.o 		\
37	kernelDualCrypt.o 	\
38	kernelKeys.o 		\
39	kernelRand.o		\
40	kernelSession.o		\
41	kernelSessionUtil.o	\
42	kernelUtil.o		\
43	kernelEncrypt.o		\
44	kernelDecrypt.o		\
45	kernelObjectUtil.o	\
46	kernelAttributeUtil.o	\
47	kernelEmulate.o
48
49OTHER_OBJECTS = kernelSoftCommon.o
50ST_OBJECTS = softDigestUtil.o softMAC.o
51
52OBJECTS= \
53	$(CORE_OBJECTS)		\
54	$(OTHER_OBJECTS)	\
55	$(ST_OBJECTS)
56
57AESDIR=		$(SRC)/common/crypto/aes
58ARCFOURDIR=	$(SRC)/common/crypto/arcfour
59BLOWFISHDIR=	$(SRC)/common/crypto/blowfish
60DESDIR=		$(SRC)/common/crypto/des
61ECCDIR=		$(SRC)/common/crypto/ecc
62ST_DIR=		$(SRC)/lib/pkcs11/pkcs11_softtoken/common
63
64lint \
65pics/kernelAttributeUtil.o := \
66	CPPFLAGS += -I$(AESDIR) -I$(BLOWFISHDIR) -I$(ARCFOURDIR) -I$(DESDIR) \
67	-I$(ECCDIR)
68pics/kernelKeys.o := \
69	CPPFLAGS += -I$(ECCDIR)
70pics/kernelSoftCommon.o := \
71	CPPFLAGS = -I$(ST_DIR) $(CPPFLAGS.master)
72
73include $(SRC)/lib/Makefile.lib
74
75#	set signing mode
76POST_PROCESS_SO	+=	; $(ELFSIGN_CRYPTO)
77
78SRCDIR=		../common
79CORESRCS =  \
80	$(CORE_OBJECTS:%.o=$(SRCDIR)/%.c)
81
82LIBS	=	$(DYNLIB)
83LDLIBS  +=      -lc -lcryptoutil -lmd
84
85CFLAGS  +=      $(CCVERBOSE)
86
87CERRWARN +=	-_gcc=-Wno-uninitialized
88CERRWARN +=	-_gcc=-Wno-unused-label
89
90ROOTLIBDIR=     $(ROOT)/usr/lib/security
91ROOTLIBDIR64=   $(ROOT)/usr/lib/security/$(MACH64)
92
93.KEEP_STATE:
94
95all:    $(LIBS)
96
97# we don't need to lint ST_OBJECTS since they are linted elsewhere.
98lintcheck := SRCS = $(CORESRCS)
99lintother := OSRCS = ../common/kernelSoftCommon.c
100lintother := CPPFLAGS = -I$(ST_DIR) $(CPPFLAGS.master)
101
102lintother: $$(OSRCS)
103	$(LINT.c) $(LINTCHECKFLAGS) $(OSRCS) $(LDLIBS)
104
105lint: lintcheck lintother
106
107pics/%.o:	$(ST_DIR)/%.c
108	$(COMPILE.c) -o $@ $< -I$(ST_DIR)
109	$(POST_PROCESS_O)
110
111include $(SRC)/lib/Makefile.targ
112