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