xref: /illumos-gate/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile (revision 05ede3db5e3b7d540afbccdc872c735770e82ef3)
171269a22SAnthony Scarpino#
271269a22SAnthony Scarpino# CDDL HEADER START
371269a22SAnthony Scarpino#
471269a22SAnthony Scarpino# The contents of this file are subject to the terms of the
571269a22SAnthony Scarpino# Common Development and Distribution License (the "License").
671269a22SAnthony Scarpino# You may not use this file except in compliance with the License.
771269a22SAnthony Scarpino#
871269a22SAnthony Scarpino# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
971269a22SAnthony Scarpino# or http://www.opensolaris.org/os/licensing.
1071269a22SAnthony Scarpino# See the License for the specific language governing permissions
1171269a22SAnthony Scarpino# and limitations under the License.
1271269a22SAnthony Scarpino#
1371269a22SAnthony Scarpino# When distributing Covered Code, include this CDDL HEADER in each
1471269a22SAnthony Scarpino# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1571269a22SAnthony Scarpino# If applicable, add the following below this CDDL HEADER, with the
1671269a22SAnthony Scarpino# fields enclosed by brackets "[]" replaced with your own identifying
1771269a22SAnthony Scarpino# information: Portions Copyright [yyyy] [name of copyright owner]
1871269a22SAnthony Scarpino#
1971269a22SAnthony Scarpino# CDDL HEADER END
2071269a22SAnthony Scarpino#
21726fad2aSDina K Nimeh
2271269a22SAnthony Scarpino#
23726fad2aSDina K Nimeh# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24fb261280SJason King# Copyright 2017 Jason King
25fb261280SJason King# Copyright (c) 2018, Joyent, Inc.
26726fad2aSDina K Nimeh#
27*05ede3dbSJohn Levon# Copyright (c) 2018, Joyent, Inc.
28726fad2aSDina K Nimeh
2971269a22SAnthony ScarpinoLIBRARY =	libsoftcrypto.a
3071269a22SAnthony ScarpinoVERS =		.1
3171269a22SAnthony Scarpino
321e49577aSRod Evansinclude		../Makefile.com
331e49577aSRod Evans
3454034eb2SDan OpenSolaris AndersonAES_PSM_OBJS =	aes_amd64.o aes_intel.o aeskey.o
3571269a22SAnthony ScarpinoARCFOUR_PSM_OBJS = arcfour-x86_64.o
3671269a22SAnthony ScarpinoBIGNUM_PSM_OBJS = bignum_amd64.o bignum_amd64_asm.o
37fb261280SJason KingMODES_PSM_OBJS = gcm_intel.o
381e49577aSRod Evans
391e49577aSRod Evansinclude		$(SRC)/lib/Makefile.lib
401e49577aSRod Evansinclude		$(SRC)/lib/Makefile.lib.64
411e49577aSRod Evans
427014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-type-limits
437014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
447014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
457014882cSRichard Lowe
46*05ede3dbSJohn Levon# not linted
47*05ede3dbSJohn LevonSMATCH=off
48*05ede3dbSJohn Levon
491e49577aSRod EvansAES_PSM_SRC =	$(AES_DIR)/$(MACH64)/aes_amd64.s \
501e49577aSRod Evans		$(AES_DIR)/$(MACH64)/aes_intel.s \
511e49577aSRod Evans		$(AES_DIR)/$(MACH64)/aeskey.c
521e49577aSRod EvansARCFOUR_PSM_SRC = arcfour-x86_64.s
5371269a22SAnthony ScarpinoBIGNUM_PSM_SRC = $(BIGNUM_DIR)/$(MACH64)/bignum_amd64.c \
5471269a22SAnthony Scarpino		$(BIGNUM_DIR)/$(MACH64)/bignum_amd64_asm.s
5571269a22SAnthony Scarpino
56fb261280SJason KingMODES_PSM_SRC = $(MODES_DIR)/$(MACH64)/gcm_intel.s
57fb261280SJason King
581e49577aSRod Evans# Sources need to be redefined after Makefile.lib inclusion.
591e49577aSRod EvansSRCS =		$(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) \
601e49577aSRod Evans		$(DES_SRC) $(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) \
611e49577aSRod Evans		$(PAD_SRC)
621e49577aSRod Evans
631e49577aSRod EvansSRCDIR =	$(SRC)/lib/pkcs11/libsoftcrypto/common
641e49577aSRod Evans
651e49577aSRod EvansLIBS =		$(DYNLIB) $(LINTLIB)
661e49577aSRod EvansMAPFILEDIR =	../common
6771269a22SAnthony Scarpino
688475e043SDan OpenSolaris AndersonCFLAGS +=	-xO4 -xcrossfile
691e49577aSRod EvansCPPFLAGS +=	-I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS
701e49577aSRod EvansASFLAGS +=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM
7171269a22SAnthony ScarpinoBIGNUM_FLAGS +=	-DPSR_MUL
7271269a22SAnthony ScarpinoCLEANFILES +=	arcfour-x86_64.s
731e49577aSRod EvansLDLIBS +=	-lcryptoutil -lc
741e49577aSRod EvansLINTFLAGS64 +=	$(EXTRA_LINT_FLAGS)
7571269a22SAnthony Scarpino
761e49577aSRod Evans.KEEP_STATE:
771e49577aSRod Evans
781e49577aSRod Evansall:		$(LIBS)
791e49577aSRod Evans
801e49577aSRod Evanslint:		$(SRCS)
8171269a22SAnthony Scarpino
8271269a22SAnthony Scarpinoinstall:	all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
8371269a22SAnthony Scarpino
8471269a22SAnthony Scarpinopics/%.o: $(AES_DIR)/$(MACH64)/%.c
8571269a22SAnthony Scarpino		$(COMPILE.c) $(AES_FLAGS) -o $@ $<
8671269a22SAnthony Scarpino		$(POST_PROCESS_O)
8771269a22SAnthony Scarpino
8871269a22SAnthony Scarpinopics/%.o: $(AES_DIR)/$(MACH64)/%.s
8971269a22SAnthony Scarpino		$(COMPILE.s) $(AES_FLAGS) -o $@ $<
9071269a22SAnthony Scarpino		$(POST_PROCESS_O)
9171269a22SAnthony Scarpino
9271269a22SAnthony Scarpinopics/%.o: $(BIGNUM_DIR)/$(MACH64)/%.c
9371269a22SAnthony Scarpino		$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ $<
9471269a22SAnthony Scarpino		$(POST_PROCESS_O)
9571269a22SAnthony Scarpino
9671269a22SAnthony Scarpinopics/%.o: $(BIGNUM_DIR)/$(MACH64)/%.s
9771269a22SAnthony Scarpino		$(COMPILE64.s) $(BIGNUM_FLAGS) -o $@ $<
9871269a22SAnthony Scarpino		$(POST_PROCESS_O)
9971269a22SAnthony Scarpino
100fb261280SJason Kingpics/%.o: $(MODES_DIR)/$(MACH64)/%.s
101fb261280SJason King		$(COMPILE64.s) $(MODES_FLAGS) -o $@ $<
102fb261280SJason King		$(POST_PROCESS_O)
103fb261280SJason King
1041e49577aSRod Evansinclude		../Makefile.targ
1051e49577aSRod Evans
1061e49577aSRod Evansarcfour-x86_64.s: $(ARCFOUR_DIR)/amd64/arcfour-x86_64.pl
1071e49577aSRod Evans		$(PERL) $? $@
1081e49577aSRod Evans
10971269a22SAnthony Scarpinopics/%.o: arcfour-x86_64.s
11071269a22SAnthony Scarpino		$(COMPILE64.s) $(ARCFOUR_FLAGS) -o $@ $<
11171269a22SAnthony Scarpino		$(POST_PROCESS_O)
112