xref: /titanic_52/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com (revision 174bc6499d233e329ecd3d98a880a7b07df16bfa)
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# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
25#
26# lib/pkcs11/pkcs11_softtoken/Makefile.com
27#
28
29LIBRARY = pkcs11_softtoken.a
30VERS= .1
31
32LCL_OBJECTS = \
33	softGeneral.o 		\
34	softSlotToken.o 	\
35	softSession.o 		\
36	softObject.o 		\
37	softDigest.o	 	\
38	softSign.o 		\
39	softVerify.o 		\
40	softDualCrypt.o 	\
41	softKeys.o 		\
42	softRand.o		\
43	softSessionUtil.o	\
44	softDigestUtil.o	\
45	softAttributeUtil.o	\
46	softObjectUtil.o	\
47	softDESCrypt.o		\
48	softEncrypt.o		\
49	softDecrypt.o		\
50	softEncryptUtil.o	\
51	softDecryptUtil.o	\
52	softSignUtil.o		\
53	softVerifyUtil.o	\
54	softMAC.o		\
55	softRSA.o		\
56	softKeysUtil.o		\
57	softARCFourCrypt.o	\
58	softDSA.o		\
59	softDH.o		\
60	softAESCrypt.o		\
61	softKeystore.o		\
62	softKeystoreUtil.o	\
63	softSSL.o		\
64	softASN1.o		\
65	softBlowfishCrypt.o	\
66	softEC.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
79
80ECC_OBJECTS = $(ECC_COBJECTS) $(ECC_PSR_OBJECTS)
81MPI_OBJECTS = $(MPI_COBJECTS) $(MPI_PSR_OBJECTS)
82RNG_OBJECTS = $(RNG_COBJECTS)
83BER_OBJECTS = bprint.o decode.o encode.o io.o
84
85OBJECTS = \
86	$(LCL_OBJECTS)		\
87	$(MPI_OBJECTS)		\
88	$(RNG_OBJECTS)		\
89	$(BIGNUM_OBJECTS)       \
90	$(BER_OBJECTS)		\
91	$(ECC_OBJECTS)
92
93AESDIR=         $(SRC)/common/crypto/aes
94BLOWFISHDIR=    $(SRC)/common/crypto/blowfish
95ARCFOURDIR=     $(SRC)/common/crypto/arcfour
96DESDIR=         $(SRC)/common/crypto/des
97DHDIR=		$(SRC)/common/crypto/dh
98DSADIR=		$(SRC)/common/crypto/dsa
99ECCDIR=		$(SRC)/common/crypto/ecc
100MPIDIR=		$(SRC)/common/mpi
101RSADIR=		$(SRC)/common/crypto/rsa
102RNGDIR=		$(SRC)/common/crypto/rng
103SHA1DIR=	$(SRC)/common/crypto/sha1
104SHA2DIR=	$(SRC)/common/crypto/sha2
105BIGNUMDIR=	$(SRC)/common/bignum
106PADDIR=		$(SRC)/common/crypto/padding
107BERDIR=		../../../libldap5/sources/ldap/ber
108
109include $(SRC)/lib/Makefile.lib
110
111#	set signing mode
112POST_PROCESS_SO +=	; $(ELFSIGN_CRYPTO)
113
114SRCDIR= ../common
115
116SRCS =	\
117	$(LCL_OBJECTS:%.o=$(SRCDIR)/%.c) \
118	$(MPI_COBJECTS:%.o=$(MPIDIR)/%.c) \
119	$(ECC_COBJECTS:%.o=$(ECCDIR)/%.c) \
120	$(RNG_COBJECTS:%.o=$(RNGDIR)/%.c)
121
122# libelfsign needs a static pkcs11_softtoken
123LIBS    =       $(DYNLIB)
124LDLIBS  +=      -lc -lmd -lcryptoutil -lsoftcrypto -lgen
125
126CFLAGS 	+=      $(CCVERBOSE)
127
128CERRWARN +=	-_gcc=-Wno-unused-label
129CERRWARN +=	-_gcc=-Wno-parentheses
130CERRWARN +=	-_gcc=-Wno-uninitialized
131CERRWARN +=	-_gcc=-Wno-type-limits
132CERRWARN +=	-_gcc=-Wno-unused-variable
133CERRWARN +=	-_gcc=-Wno-empty-body
134
135CPPFLAGS += -I$(AESDIR) -I$(BLOWFISHDIR) -I$(ARCFOURDIR) -I$(DESDIR) \
136	    -I$(DHDIR) -I$(DSADIR) -I$(ECCDIR) -I$(SRC)/common/crypto \
137	    -I$(MPIDIR) -I$(RSADIR) -I$(RNGDIR) \
138	    -I$(SHA1DIR) -I$(SHA2DIR) -I$(SRCDIR) \
139	    -I$(BIGNUMDIR) -I$(PADDIR) -D_POSIX_PTHREAD_SEMANTICS \
140	    -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B
141
142LINTFLAGS64 += -errchk=longptr64
143
144ROOTLIBDIR=     $(ROOT)/usr/lib/security
145ROOTLIBDIR64=   $(ROOT)/usr/lib/security/$(MACH64)
146
147LINTSRC = \
148	$(LCL_OBJECTS:%.o=$(SRCDIR)/%.c) \
149	$(RNG_COBJECTS:%.o=$(RNGDIR)/%.c)
150
151.KEEP_STATE:
152
153all:	$(LIBS)
154
155lint:	$$(LINTSRC)
156	$(LINT.c) $(LINTCHECKFLAGS) $(LINTSRC) $(LDLIBS)
157
158pics/%.o:	$(BERDIR)/%.c
159	$(COMPILE.c) -o $@ $< -D_SOLARIS_SDK -I$(BERDIR) \
160		-I../../../libldap5/include/ldap
161	$(POST_PROCESS_O)
162
163pics/%.o:	$(ECCDIR)/%.c
164	$(COMPILE.c) -o $@ $<
165	$(POST_PROCESS_O)
166
167pics/%.o:	$(MPIDIR)/%.c
168	$(COMPILE.c) -o $@ $<
169	$(POST_PROCESS_O)
170
171pics/%.o:	$(RNGDIR)/%.c
172	$(COMPILE.c) -o $@ $<
173	$(POST_PROCESS_O)
174
175include $(SRC)/lib/Makefile.targ
176