1 # $NetBSD: Makefile,v 1.4 2026/07/29 20:22:26 riastradh 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 CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto -I${OPENSSLSRC} 29 CPPFLAGS+= -I${OPENSSLSRC}/include -I${OPENSSLSRC}/crypto/include 30 CPPFLAGS+= -I${OPENSSLSRC}/crypto/asn1 -I${OPENSSLSRC}/crypto/evp 31 CPPFLAGS+= -I${OPENSSLSRC}/crypto/modes 32 CPPFLAGS+= -I${OPENSSLSRC}/../include 33 34 CRYPTODIST= ${NETBSDSRCDIR}/crypto 35 OPENSSLINC= ${OPENSSLSRC}/include/openssl 36 37 .include "${NETBSDSRCDIR}/crypto/Makefile.openssl" 38 .PATH: ${OPENSSLSRC} ${OPENSSLINC} 39 .PATH: ${OPENSSLSRC}/../include/openssl 40 41 .include "srcs.inc" 42 .include "${.CURDIR}/../libdefault/srcs.inc" 43 CPPFLAGS+= -I${.CURDIR}/../libdefault 44 CPPFLAGS+= -I${OPENSSLSRC}/providers/common/include 45 CPPFLAGS+= -I${OPENSSLSRC}/providers/fips/include 46 CPPFLAGS+= -I${OPENSSLSRC}/providers/implementations/include 47 .PATH: ${.CURDIR}/../libdefault 48 .include "${.CURDIR}/../libcommon/srcs.inc" 49 .PATH: ${.CURDIR}/../libcommon 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 asn1err.h \ 75 asn1t.h \ 76 async.h \ 77 asyncerr.h \ 78 bio.h \ 79 bioerr.h \ 80 blowfish.h \ 81 bn.h \ 82 bnerr.h \ 83 buffer.h \ 84 buffererr.h \ 85 byteorder.h \ 86 camellia.h \ 87 cast.h \ 88 cmac.h \ 89 cmp.h \ 90 cmp_util.h \ 91 cmperr.h \ 92 cms.h \ 93 cmserr.h \ 94 comp.h \ 95 comperr.h \ 96 conf.h \ 97 conf_api.h \ 98 conferr.h \ 99 configuration.h \ 100 conftypes.h \ 101 core.h \ 102 core_dispatch.h \ 103 core_names.h \ 104 core_object.h \ 105 crmf.h \ 106 crmferr.h \ 107 crypto.h \ 108 cryptoerr.h \ 109 cryptoerr_legacy.h \ 110 ct.h \ 111 cterr.h \ 112 decoder.h \ 113 decodererr.h \ 114 des.h \ 115 dh.h \ 116 dherr.h \ 117 dsa.h \ 118 dsaerr.h \ 119 dtls1.h \ 120 e_os2.h \ 121 e_ostime.h \ 122 ebcdic.h \ 123 ec.h \ 124 ecdh.h \ 125 ecdsa.h \ 126 ecerr.h \ 127 encoder.h \ 128 encodererr.h \ 129 engine.h \ 130 engineerr.h \ 131 err.h \ 132 ess.h \ 133 esserr.h \ 134 evp.h \ 135 evperr.h \ 136 fips_names.h \ 137 fipskey.h \ 138 hmac.h \ 139 hpke.h \ 140 http.h \ 141 httperr.h \ 142 idea.h \ 143 indicator.h \ 144 kdf.h \ 145 kdferr.h \ 146 lhash.h \ 147 macros.h \ 148 md2.h \ 149 md4.h \ 150 md5.h \ 151 mdc2.h \ 152 ml_kem.h \ 153 modes.h \ 154 obj_mac.h \ 155 objects.h \ 156 objectserr.h \ 157 ocsp.h \ 158 ocsperr.h \ 159 opensslconf.h \ 160 opensslv.h \ 161 ossl_typ.h \ 162 param_build.h \ 163 params.h \ 164 pem.h \ 165 pem2.h \ 166 pemerr.h \ 167 pkcs12.h \ 168 pkcs12err.h \ 169 pkcs7.h \ 170 pkcs7err.h \ 171 prov_ssl.h \ 172 proverr.h \ 173 provider.h \ 174 quic.h \ 175 rand.h \ 176 randerr.h \ 177 rc2.h \ 178 rc4.h \ 179 rc5.h \ 180 ripemd.h \ 181 rsa.h \ 182 rsaerr.h \ 183 safestack.h \ 184 seed.h \ 185 self_test.h \ 186 sha.h \ 187 srp.h \ 188 srtp.h \ 189 ssl.h \ 190 ssl2.h \ 191 ssl3.h \ 192 sslerr.h \ 193 sslerr_legacy.h \ 194 stack.h \ 195 store.h \ 196 storeerr.h \ 197 symhacks.h \ 198 thread.h \ 199 tls1.h \ 200 trace.h \ 201 ts.h \ 202 tserr.h \ 203 txt_db.h \ 204 types.h \ 205 ui.h \ 206 uierr.h \ 207 whrlpool.h \ 208 x509.h \ 209 x509_acert.h \ 210 x509_vfy.h \ 211 x509err.h \ 212 x509v3.h \ 213 x509v3err.h \ 214 # end of INCS 215 216 .if (${USE_FIPS} != "no") 217 # FIPS 218 # This part is always included, because OpenSSL does not protect 219 # The FIPS include files 220 .PATH: ${OPENSSLSRC}/fips ${OPENSSLSRC}/fips/rand 221 INCS+= fips.h fips_rand.h 222 .endif 223 224 .if (${USE_FIPS} != "no") 225 CPPFLAGS+=-DOPENSSL_FIPS 226 .PATH: ${OPENSSLSRC}/fips/aes 227 SRCS+=fips_aes_core.c fips_aes_selftest.c 228 .PATH: ${OPENSSLSRC}/fips/des 229 SRCS+=fips_des_enc.c fips_des_selftest.c fips_set_key.c 230 # asm/fips-dx86-elf.s 231 .PATH: ${OPENSSLSRC}/fips/dh 232 SRCS+=fips_dh_check.c fips_dh_gen.c fips_dh_key.c 233 .PATH: ${OPENSSLSRC}/fips/dsa 234 SRCS+=fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c 235 #.PATH: ${OPENSSLSRC}/fips/rand 236 SRCS+=fips_rand.c 237 .PATH: ${OPENSSLSRC}/fips/rsa 238 SRCS+=fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c 239 SRCS+=fips_sha1dgst.c fips_sha1_selftest.c 240 # asm/sx86-elf.s 241 .PATH: ${OPENSSLSRC}/fips/sha1 242 #.PATH: ${OPENSSLSRC}/fips 243 SRCS+=fips.c fips_err_wrapper.c 244 245 SRCS+=rc5_skey.c i_skey.c mdc2dgst.c 246 .endif 247 248 COPTS.eng_padlock.c = -Wno-error=stack-protector 249 COPTS.bn_exp.c = -Wno-error=stack-protector 250 251 INCSDIR=/usr/include/openssl 252 253 VERSION_MAP= crypto.map 254 255 PKGCONFIG=libcrypto 256 .include "${.CURDIR}/../../pkgconfig.mk" 257 258 # too much of a pain to generate opensslv.h / configuration.h / fipskey.h 259 # core_names.h 260 GENH = \ 261 asn1.h \ 262 asn1t.h \ 263 bio.h \ 264 cmp.h \ 265 cms.h \ 266 comp.h \ 267 conf.h \ 268 crmf.h \ 269 crypto.h \ 270 ct.h \ 271 err.h \ 272 ess.h \ 273 lhash.h \ 274 ocsp.h \ 275 pkcs12.h \ 276 pkcs7.h \ 277 safestack.h \ 278 srp.h \ 279 ssl.h \ 280 ui.h \ 281 x509.h \ 282 x509_acert.h \ 283 x509_vfy.h \ 284 x509v3.h 285 286 .for i in ${GENH} 287 $i: $i.in 288 ${_MKTARGET_CREATE} 289 ${HOST_SH} ${.CURDIR}/gen ${.ALLSRC} > ${.TARGET} 290 .endfor 291 292 .include <bsd.lib.mk> 293