1 # $NetBSD: Makefile,v 1.21 2022/04/15 22:26:36 rillig 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 -Wno-implicit-int-float-conversion 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 LINTFLAGS+= -X 161 # constant in conditional context 38 LINTFLAGS+= -X 129 # expression has null effect 39 LINTFLAGS+= -X 117 # bitwise '>>' on signed value possibly nonportable 40 LINTFLAGS+= -X 231 # argument '%s' unused in function '%s' 41 LINTFLAGS+= -X 220 # fallthrough on case statement 42 LINTFLAGS+= -X 118 # semantics of '%s' change in ANSI C; use explicit cast 43 44 CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto -I${OPENSSLSRC} 45 CPPFLAGS+= -I${OPENSSLSRC}/include -I${OPENSSLSRC}/crypto/include 46 CPPFLAGS+= -I${OPENSSLSRC}/crypto/asn1 -I${OPENSSLSRC}/crypto/evp 47 CPPFLAGS+= -I${OPENSSLSRC}/crypto/modes 48 CPPFLAGS+= -I${OPENSSLSRC}/../include 49 50 CRYPTODIST= ${NETBSDSRCDIR}/crypto 51 52 .include "${NETBSDSRCDIR}/crypto/Makefile.openssl" 53 .PATH: ${OPENSSLSRC} ${OPENSSLSRC}/include/openssl 54 .PATH: ${OPENSSLSRC}/../include/openssl ${OPENSSLSRC}/include/internal 55 56 .include "srcs.inc" 57 58 AFLAGS+=-DELF 59 LIBDPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt 60 61 OS_VERSION!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 62 63 # XXX CFLAGS: While it would be nice to know which compiler flags 64 # XXX the library was built with, we don't want pathname information 65 # XXX for the host toolchain embedded in the image. 66 ${SRCS}: buildinf.h 67 buildinf.h: Makefile 68 @echo "#ifndef MK1MF_BUILD" >buildinf.h 69 @echo "#define compiler_flags \"`${CC} -v 2>&1 | grep 'gcc version'`\"" >>buildinf.h 70 @echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h 71 @echo "#define DATE \"NetBSD ${OS_VERSION}\"" >>buildinf.h 72 @echo "#endif" >>buildinf.h 73 74 CLEANFILES+= buildinf.h 75 76 # This list is built from the contents of the include/openssl 77 # directory in the OpenSSL source distribution. 78 INCS+= \ 79 aes.h \ 80 asn1.h \ 81 asn1_mac.h \ 82 asn1err.h \ 83 asn1t.h \ 84 async.h \ 85 asyncerr.h \ 86 bio.h \ 87 bioerr.h \ 88 blowfish.h \ 89 bn.h \ 90 bnerr.h \ 91 buffer.h \ 92 buffererr.h \ 93 camellia.h \ 94 cast.h \ 95 cmac.h \ 96 cms.h \ 97 cmserr.h \ 98 comp.h \ 99 comperr.h \ 100 conf.h \ 101 conf_api.h \ 102 conferr.h \ 103 crypto.h \ 104 cryptoerr.h \ 105 ct.h \ 106 cterr.h \ 107 des.h \ 108 dh.h \ 109 dherr.h \ 110 dsa.h \ 111 dsaerr.h \ 112 dtls1.h \ 113 e_os2.h \ 114 ebcdic.h \ 115 ec.h \ 116 ecdh.h \ 117 ecdsa.h \ 118 ecerr.h \ 119 engine.h \ 120 engineerr.h \ 121 err.h \ 122 evp.h \ 123 evperr.h \ 124 hmac.h \ 125 kdf.h \ 126 kdferr.h \ 127 lhash.h \ 128 md2.h \ 129 md4.h \ 130 md5.h \ 131 modes.h \ 132 obj_mac.h \ 133 objects.h \ 134 objectserr.h \ 135 ocsp.h \ 136 ocsperr.h \ 137 opensslconf.h \ 138 opensslv.h \ 139 ossl_typ.h \ 140 pem.h \ 141 pem2.h \ 142 pemerr.h \ 143 pkcs12.h \ 144 pkcs12err.h \ 145 pkcs7.h \ 146 pkcs7err.h \ 147 rand.h \ 148 rand_drbg.h \ 149 randerr.h \ 150 rc2.h \ 151 rc4.h \ 152 ripemd.h \ 153 rsa.h \ 154 rsaerr.h \ 155 safestack.h \ 156 seed.h \ 157 sha.h \ 158 srp.h \ 159 srtp.h \ 160 ssl.h \ 161 ssl2.h \ 162 ssl3.h \ 163 sslerr.h \ 164 stack.h \ 165 store.h \ 166 storeerr.h \ 167 symhacks.h \ 168 tls1.h \ 169 ts.h \ 170 tserr.h \ 171 txt_db.h \ 172 ui.h \ 173 uierr.h \ 174 whrlpool.h \ 175 x509.h \ 176 x509_vfy.h \ 177 x509err.h \ 178 x509v3.h \ 179 x509v3err.h 180 181 # IDEA - patented, but we install the header anyways 182 INCS+= idea.h 183 184 # RC5 - patented, but we install the header anyways 185 INCS+= rc5.h 186 187 # MDC2 - patented, but we install the header anyways 188 INCS+= mdc2.h 189 190 .if (${USE_FIPS} != "no") 191 # FIPS 192 # This part is always included, because OpenSSL does not protect 193 # The FIPS include files 194 .PATH: ${OPENSSLSRC}/fips ${OPENSSLSRC}/fips/rand 195 INCS+= fips.h fips_rand.h 196 .endif 197 198 .if (${USE_FIPS} != "no") 199 CPPFLAGS+=-DOPENSSL_FIPS 200 .PATH: ${OPENSSLSRC}/fips/aes 201 SRCS+=fips_aes_core.c fips_aes_selftest.c 202 .PATH: ${OPENSSLSRC}/fips/des 203 SRCS+=fips_des_enc.c fips_des_selftest.c fips_set_key.c 204 # asm/fips-dx86-elf.s 205 .PATH: ${OPENSSLSRC}/fips/dh 206 SRCS+=fips_dh_check.c fips_dh_gen.c fips_dh_key.c 207 .PATH: ${OPENSSLSRC}/fips/dsa 208 SRCS+=fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c 209 #.PATH: ${OPENSSLSRC}/fips/rand 210 SRCS+=fips_rand.c 211 .PATH: ${OPENSSLSRC}/fips/rsa 212 SRCS+=fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c 213 SRCS+=fips_sha1dgst.c fips_sha1_selftest.c 214 # asm/sx86-elf.s 215 .PATH: ${OPENSSLSRC}/fips/sha1 216 #.PATH: ${OPENSSLSRC}/fips 217 SRCS+=fips.c fips_err_wrapper.c 218 219 SRCS+=rc5_skey.c i_skey.c mdc2dgst.c 220 .endif 221 222 COPTS.eng_padlock.c = -Wno-stack-protector 223 224 INCSDIR=/usr/include/openssl 225 226 LDFLAGS+=-Wl,--version-script=${.CURDIR}/crypto.map 227 228 PKGCONFIG=libcrypto 229 .include "${.CURDIR}/../../pkgconfig.mk" 230 231 232 .include <bsd.lib.mk> 233 234