1 # $NetBSD: Makefile,v 1.19 2018/10/06 15:31:09 christos Exp $ 2 3 # RCSid: 4 # Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp 5 # 6 # @(#) Copyright (c) 1994 Simon J. Gerraty 7 # 8 # This file is provided in the hope that it will 9 # be of use. There is absolutely NO WARRANTY. 10 # Permission to copy, redistribute or otherwise 11 # use this file is hereby granted provided that 12 # the above copyright notice and this notice are 13 # left intact. 14 # 15 # Please send copies of changes and bug-fixes to: 16 # sjg (at] quick.com.au 17 # 18 19 LIB= crypto 20 USE_FORT?= yes # cryptographic software 21 USE_SHLIBDIR= yes 22 USE_FIPS= no 23 #DBG=-g 24 25 .include <bsd.own.mk> 26 .include <bsd.shlib.mk> 27 28 # XXX: There's a bit of work to do before we can enable warnings. 29 WARNS=0 30 CWARNFLAGS.clang+= -Wno-empty-body -Wno-unused-value -Wno-parentheses 31 # XXX: This warning seems to trigger incorrectly 32 CWARNFLAGS.clang+= -Wno-atomic-alignment 33 34 # XXX Not yet. 35 LINTFLAGS+=-D__int128='long long' 36 37 CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto -I${OPENSSLSRC} 38 CPPFLAGS+= -I${OPENSSLSRC}/include -I${OPENSSLSRC}/crypto/include 39 CPPFLAGS+= -I${OPENSSLSRC}/crypto/asn1 -I${OPENSSLSRC}/crypto/evp 40 CPPFLAGS+= -I${OPENSSLSRC}/crypto/modes 41 CPPFLAGS+= -I${OPENSSLSRC}/../include 42 43 CRYPTODIST= ${NETBSDSRCDIR}/crypto 44 45 .include "${NETBSDSRCDIR}/crypto/Makefile.openssl" 46 .PATH: ${OPENSSLSRC} ${OPENSSLSRC}/include/openssl 47 .PATH: ${OPENSSLSRC}/../include/openssl ${OPENSSLSRC}/include/internal 48 49 .include "srcs.inc" 50 51 AFLAGS+=-DELF 52 LIBDPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt 53 54 OS_VERSION!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 55 56 # XXX CFLAGS: While it would be nice to know which compiler flags 57 # XXX the library was built with, we don't want pathname information 58 # XXX for the host toolchain embedded in the image. 59 ${SRCS}: buildinf.h 60 buildinf.h: Makefile 61 @echo "#ifndef MK1MF_BUILD" >buildinf.h 62 @echo "#define compiler_flags \"`${CC} -v 2>&1 | grep 'gcc version'`\"" >>buildinf.h 63 @echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h 64 @echo "#define DATE \"NetBSD ${OS_VERSION}\"" >>buildinf.h 65 @echo "#endif" >>buildinf.h 66 67 CLEANFILES+= buildinf.h 68 69 # This list is built from the contents of the include/openssl 70 # directory in the OpenSSL source distribution. 71 INCS+= \ 72 aes.h \ 73 asn1.h \ 74 asn1_mac.h \ 75 asn1err.h \ 76 asn1t.h \ 77 async.h \ 78 asyncerr.h \ 79 bio.h \ 80 bioerr.h \ 81 blowfish.h \ 82 bn.h \ 83 bnerr.h \ 84 buffer.h \ 85 buffererr.h \ 86 camellia.h \ 87 cast.h \ 88 cmac.h \ 89 cms.h \ 90 cmserr.h \ 91 comp.h \ 92 comperr.h \ 93 conf.h \ 94 conf_api.h \ 95 conferr.h \ 96 crypto.h \ 97 cryptoerr.h \ 98 ct.h \ 99 cterr.h \ 100 des.h \ 101 dh.h \ 102 dherr.h \ 103 dsa.h \ 104 dsaerr.h \ 105 dtls1.h \ 106 e_os2.h \ 107 ebcdic.h \ 108 ec.h \ 109 ecdh.h \ 110 ecdsa.h \ 111 ecerr.h \ 112 engine.h \ 113 engineerr.h \ 114 err.h \ 115 evp.h \ 116 evperr.h \ 117 hmac.h \ 118 kdf.h \ 119 kdferr.h \ 120 lhash.h \ 121 md2.h \ 122 md4.h \ 123 md5.h \ 124 modes.h \ 125 obj_mac.h \ 126 objects.h \ 127 objectserr.h \ 128 ocsp.h \ 129 ocsperr.h \ 130 opensslconf.h \ 131 opensslv.h \ 132 ossl_typ.h \ 133 pem.h \ 134 pem2.h \ 135 pemerr.h \ 136 pkcs12.h \ 137 pkcs12err.h \ 138 pkcs7.h \ 139 pkcs7err.h \ 140 rand.h \ 141 rand_drbg.h \ 142 randerr.h \ 143 rc2.h \ 144 rc4.h \ 145 ripemd.h \ 146 rsa.h \ 147 rsaerr.h \ 148 safestack.h \ 149 seed.h \ 150 sha.h \ 151 srp.h \ 152 srtp.h \ 153 ssl.h \ 154 ssl2.h \ 155 ssl3.h \ 156 sslerr.h \ 157 stack.h \ 158 store.h \ 159 storeerr.h \ 160 symhacks.h \ 161 tls1.h \ 162 ts.h \ 163 tserr.h \ 164 txt_db.h \ 165 ui.h \ 166 uierr.h \ 167 whrlpool.h \ 168 x509.h \ 169 x509_vfy.h \ 170 x509err.h \ 171 x509v3.h \ 172 x509v3err.h 173 174 # IDEA - patented, but we install the header anyways 175 INCS+= idea.h 176 177 # RC5 - patented, but we install the header anyways 178 INCS+= rc5.h 179 180 # MDC2 - patented, but we install the header anyways 181 INCS+= mdc2.h 182 183 .if (${USE_FIPS} != "no") 184 # FIPS 185 # This part is always included, because OpenSSL does not protect 186 # The FIPS include files 187 .PATH: ${OPENSSLSRC}/fips ${OPENSSLSRC}/fips/rand 188 INCS+= fips.h fips_rand.h 189 .endif 190 191 .if (${USE_FIPS} != "no") 192 CPPFLAGS+=-DOPENSSL_FIPS 193 .PATH: ${OPENSSLSRC}/fips/aes 194 SRCS+=fips_aes_core.c fips_aes_selftest.c 195 .PATH: ${OPENSSLSRC}/fips/des 196 SRCS+=fips_des_enc.c fips_des_selftest.c fips_set_key.c 197 # asm/fips-dx86-elf.s 198 .PATH: ${OPENSSLSRC}/fips/dh 199 SRCS+=fips_dh_check.c fips_dh_gen.c fips_dh_key.c 200 .PATH: ${OPENSSLSRC}/fips/dsa 201 SRCS+=fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c 202 #.PATH: ${OPENSSLSRC}/fips/rand 203 SRCS+=fips_rand.c 204 .PATH: ${OPENSSLSRC}/fips/rsa 205 SRCS+=fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c 206 SRCS+=fips_sha1dgst.c fips_sha1_selftest.c 207 # asm/sx86-elf.s 208 .PATH: ${OPENSSLSRC}/fips/sha1 209 #.PATH: ${OPENSSLSRC}/fips 210 SRCS+=fips.c fips_err_wrapper.c 211 212 SRCS+=rc5_skey.c i_skey.c mdc2dgst.c 213 .endif 214 215 COPTS.eng_padlock.c = -Wno-stack-protector 216 217 INCSDIR=/usr/include/openssl 218 219 LDFLAGS+=-Wl,--version-script=${.CURDIR}/crypto.map 220 221 PKGCONFIG=libcrypto 222 .include "${.CURDIR}/../../pkgconfig.mk" 223 224 225 .include <bsd.lib.mk> 226 227