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