xref: /titanic_41/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com (revision ff5ca3bd17dee7e2bf2e4f2e3a2b354e0ecbd00d)
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 2008 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
69ASFLAGS = $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS)
70
71ECC_COBJECTS = \
72	ec.o ec2_163.o ec2_mont.o ecdecode.o ecl_mult.o ecp_384.o \
73	ecp_jac.o ec2_193.o ecl.o ecp_192.o ecp_521.o \
74	ecp_jm.o ec2_233.o ecl_curve.o ecp_224.o ecp_aff.o ecp_mont.o \
75	ec2_aff.o ec_naf.o ecl_gf.o ecp_256.o oid.o secitem.o \
76	ec2_test.o ecp_test.o
77
78MPI_COBJECTS = mp_gf2m.o mpi.o mplogic.o mpmontg.o mpprime.o
79RSA_COBJECTS = rsa_impl.o
80
81ECC_OBJECTS = $(ECC_COBJECTS) $(ECC_PSR_OBJECTS)
82MPI_OBJECTS = $(MPI_COBJECTS) $(MPI_PSR_OBJECTS)
83RSA_OBJECTS = $(RSA_COBJECTS) $(RSA_PSR_OBJECTS)
84BER_OBJECTS = bprint.o decode.o encode.o io.o
85
86OBJECTS = \
87	$(LCL_OBJECTS)		\
88	$(MPI_OBJECTS)		\
89	$(RSA_OBJECTS)		\
90	$(BIGNUM_OBJECTS)       \
91	$(BER_OBJECTS)		\
92	$(ECC_OBJECTS)
93
94AESDIR=         $(SRC)/common/crypto/aes
95BLOWFISHDIR=    $(SRC)/common/crypto/blowfish
96ARCFOURDIR=     $(SRC)/common/crypto/arcfour
97DESDIR=         $(SRC)/common/crypto/des
98ECCDIR=		$(SRC)/common/crypto/ecc
99MPIDIR=		$(SRC)/common/mpi
100RSADIR=		$(SRC)/common/crypto/rsa
101BIGNUMDIR=	$(SRC)/common/bignum
102BERDIR=		../../../libldap5/sources/ldap/ber
103
104include $(SRC)/lib/Makefile.lib
105
106#	set signing mode
107POST_PROCESS_SO +=	; $(ELFSIGN_CRYPTO)
108
109SRCDIR= ../common
110
111SRCS =	\
112	$(LCL_OBJECTS:%.o=$(SRCDIR)/%.c) \
113	$(MPI_COBJECTS:%.o=$(MPIDIR)/%.c) \
114	$(RSA_COBJECTS:%.o=$(RSADIR)/%.c) \
115	$(ECC_COBJECTS:%.o=$(ECCDIR)/%.c)
116
117# libelfsign needs a static pkcs11_softtoken
118LIBS    =       $(DYNLIB)
119LDLIBS  +=      -lc -lmd -lcryptoutil -lsoftcrypto
120
121CFLAGS 	+=      $(CCVERBOSE)
122
123CPPFLAGS += -I$(AESDIR) -I$(BLOWFISHDIR) -I$(ARCFOURDIR) -I$(DESDIR) \
124	    -I$(ECCDIR) -I$(SRC)/common/crypto -I$(MPIDIR) -I$(RSADIR) \
125	    -I$(SRCDIR) -I$(BIGNUMDIR) -D_POSIX_PTHREAD_SEMANTICS \
126	    -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B
127
128LINTFLAGS64 += -errchk=longptr64
129
130ROOTLIBDIR=     $(ROOT)/usr/lib/security
131ROOTLIBDIR64=   $(ROOT)/usr/lib/security/$(MACH64)
132
133LINTSRC = \
134	$(LCL_OBJECTS:%.o=$(SRCDIR)/%.c) \
135	$(RSA_COBJECTS:%.o=$(RSADIR)/%.c)
136
137
138.KEEP_STATE:
139
140all:	$(LIBS)
141
142lint:	$$(LINTSRC)
143	$(LINT.c) $(LINTCHECKFLAGS) $(LINTSRC) $(LDLIBS)
144
145pics/%.o:	$(BERDIR)/%.c
146	$(COMPILE.c) -o $@ $< -D_SOLARIS_SDK -I$(BERDIR) \
147		-I../../../libldap5/include/ldap
148	$(POST_PROCESS_O)
149
150pics/%.o:	$(ECCDIR)/%.c
151	$(COMPILE.c) -o $@ $<
152	$(POST_PROCESS_O)
153
154pics/%.o:	$(MPIDIR)/%.c
155	$(COMPILE.c) -o $@ $<
156	$(POST_PROCESS_O)
157
158pics/%.o:	$(RSADIR)/%.c
159	$(COMPILE.c) -o $@ $<
160	$(POST_PROCESS_O)
161
162include $(SRC)/lib/Makefile.targ
163