xref: /titanic_41/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com (revision f9ead4a57883f3ef04ef20d83cc47987d98c0687)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# lib/pkcs11/pkcs11_softtoken/Makefile.com
26#
27
28LIBRARY = pkcs11_softtoken.a
29VERS= .1
30
31LCL_OBJECTS = \
32	softGeneral.o 		\
33	softSlotToken.o 	\
34	softSession.o 		\
35	softObject.o 		\
36	softDigest.o	 	\
37	softSign.o 		\
38	softVerify.o 		\
39	softDualCrypt.o 	\
40	softKeys.o 		\
41	softRand.o		\
42	softSessionUtil.o	\
43	softDigestUtil.o	\
44	softAttributeUtil.o	\
45	softObjectUtil.o	\
46	softDESCrypt.o		\
47	softEncrypt.o		\
48	softDecrypt.o		\
49	softEncryptUtil.o	\
50	softDecryptUtil.o	\
51	softSignUtil.o		\
52	softVerifyUtil.o	\
53	softMAC.o		\
54	softRSA.o		\
55	softRandUtil.o		\
56	softKeysUtil.o		\
57	softARCFourCrypt.o	\
58	softDSA.o		\
59	softDH.o		\
60	softAESCrypt.o		\
61	softCrypt.o		\
62	softKeystore.o		\
63	softKeystoreUtil.o	\
64	softSSL.o		\
65	softASN1.o		\
66	softBlowfishCrypt.o	\
67	softEC.o		\
68	softFipsPost.o		\
69	softFipsPostUtil.o	\
70	softFipsDSAUtil.o
71
72ASFLAGS = $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS)
73
74ECC_COBJECTS = \
75	ec.o ec2_163.o ec2_mont.o ecdecode.o ecl_mult.o ecp_384.o \
76	ecp_jac.o ec2_193.o ecl.o ecp_192.o ecp_521.o \
77	ecp_jm.o ec2_233.o ecl_curve.o ecp_224.o ecp_aff.o ecp_mont.o \
78	ec2_aff.o ec_naf.o ecl_gf.o ecp_256.o oid.o secitem.o \
79	ec2_test.o ecp_test.o
80
81MPI_COBJECTS = mp_gf2m.o mpi.o mplogic.o mpmontg.o mpprime.o
82RSA_COBJECTS = rsa_impl.o
83RNG_COBJECTS = fips_random.o
84FIPS_COBJECTS = fips_des_util.o \
85		fips_aes_util.o fips_sha1_util.o fips_sha2_util.o \
86		fips_rsa_util.o fips_ecc_util.o fips_random_util.o
87
88ECC_OBJECTS = $(ECC_COBJECTS) $(ECC_PSR_OBJECTS)
89MPI_OBJECTS = $(MPI_COBJECTS) $(MPI_PSR_OBJECTS)
90RSA_OBJECTS = $(RSA_COBJECTS) $(RSA_PSR_OBJECTS)
91RNG_OBJECTS = $(RNG_COBJECTS)
92FIPS_OBJECTS = $(FIPS_COBJECTS)
93BER_OBJECTS = bprint.o decode.o encode.o io.o
94
95OBJECTS = \
96	$(LCL_OBJECTS)		\
97	$(MPI_OBJECTS)		\
98	$(RSA_OBJECTS)		\
99	$(RNG_OBJECTS)		\
100	$(FIPS_OBJECTS)		\
101	$(BIGNUM_OBJECTS)       \
102	$(BER_OBJECTS)		\
103	$(ECC_OBJECTS)
104
105AESDIR=         $(SRC)/common/crypto/aes
106BLOWFISHDIR=    $(SRC)/common/crypto/blowfish
107ARCFOURDIR=     $(SRC)/common/crypto/arcfour
108DESDIR=         $(SRC)/common/crypto/des
109ECCDIR=		$(SRC)/common/crypto/ecc
110MPIDIR=		$(SRC)/common/mpi
111RSADIR=		$(SRC)/common/crypto/rsa
112RNGDIR=		$(SRC)/common/crypto/rng
113FIPSDIR=	$(SRC)/common/crypto/fips
114SHA1DIR=	$(SRC)/common/crypto/sha1
115SHA2DIR=	$(SRC)/common/crypto/sha2
116BIGNUMDIR=	$(SRC)/common/bignum
117BERDIR=		../../../libldap5/sources/ldap/ber
118
119include $(SRC)/lib/Makefile.lib
120
121#	set signing mode
122POST_PROCESS_SO +=	; $(ELFSIGN_CRYPTO)
123
124SRCDIR= ../common
125
126SRCS =	\
127	$(LCL_OBJECTS:%.o=$(SRCDIR)/%.c) \
128	$(MPI_COBJECTS:%.o=$(MPIDIR)/%.c) \
129	$(RSA_COBJECTS:%.o=$(RSADIR)/%.c) \
130	$(ECC_COBJECTS:%.o=$(ECCDIR)/%.c) \
131	$(RNG_COBJECTS:%.o=$(RNGDIR)/%.c) \
132	$(FIPS_COBJECTS:%.o=$(FIPSDIR)/%.c)
133
134# libelfsign needs a static pkcs11_softtoken
135LIBS    =       $(DYNLIB)
136LDLIBS  +=      -lc -lmd -lcryptoutil -lsoftcrypto
137
138CFLAGS 	+=      $(CCVERBOSE)
139
140CPPFLAGS += -I$(AESDIR) -I$(BLOWFISHDIR) -I$(ARCFOURDIR) -I$(DESDIR) \
141	    -I$(ECCDIR) -I$(SRC)/common/crypto -I$(MPIDIR) -I$(RSADIR) -I$(RNGDIR) \
142	    -I$(FIPSDIR) -I$(SHA1DIR) -I$(SHA2DIR) -I$(SRCDIR) \
143	    -I$(BIGNUMDIR) -D_POSIX_PTHREAD_SEMANTICS \
144	    -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B
145
146LINTFLAGS64 += -errchk=longptr64
147
148ROOTLIBDIR=     $(ROOT)/usr/lib/security
149ROOTLIBDIR64=   $(ROOT)/usr/lib/security/$(MACH64)
150
151LINTSRC = \
152	$(LCL_OBJECTS:%.o=$(SRCDIR)/%.c) \
153	$(RSA_COBJECTS:%.o=$(RSADIR)/%.c) \
154	$(RNG_COBJECTS:%.o=$(RNGDIR)/%.c) \
155	$(FIPS_COBJECTS:%.o=$(FIPSDIR)/%.c)
156
157.KEEP_STATE:
158
159all:	$(LIBS)
160
161lint:	$$(LINTSRC)
162	$(LINT.c) $(LINTCHECKFLAGS) $(LINTSRC) $(LDLIBS)
163
164pics/%.o:	$(BERDIR)/%.c
165	$(COMPILE.c) -o $@ $< -D_SOLARIS_SDK -I$(BERDIR) \
166		-I../../../libldap5/include/ldap
167	$(POST_PROCESS_O)
168
169pics/%.o:	$(ECCDIR)/%.c
170	$(COMPILE.c) -o $@ $<
171	$(POST_PROCESS_O)
172
173pics/%.o:	$(MPIDIR)/%.c
174	$(COMPILE.c) -o $@ $<
175	$(POST_PROCESS_O)
176
177pics/%.o:	$(RSADIR)/%.c
178	$(COMPILE.c) -o $@ $<
179	$(POST_PROCESS_O)
180
181pics/%.o:	$(RNGDIR)/%.c
182	$(COMPILE.c) -o $@ $<
183	$(POST_PROCESS_O)
184
185pics/%.o:	$(FIPSDIR)/%.c
186	$(COMPILE.c) -o $@ $<
187	$(POST_PROCESS_O)
188
189include $(SRC)/lib/Makefile.targ
190