1 # $NetBSD: Makefile,v 1.39 2025/09/18 13:57:34 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 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/implementations/include 46 .PATH: ${.CURDIR}/../libdefault 47 .include "${.CURDIR}/../libcommon/srcs.inc" 48 .PATH: ${.CURDIR}/../libcommon 49 50 AFLAGS+=-DELF 51 LIBDPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt 52 53 OS_VERSION!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 54 55 # XXX CFLAGS: While it would be nice to know which compiler flags 56 # XXX the library was built with, we don't want pathname information 57 # XXX for the host toolchain embedded in the image. 58 ${SRCS}: buildinf.h 59 buildinf.h: Makefile 60 @echo "#ifndef MK1MF_BUILD" >buildinf.h 61 @echo "#define compiler_flags \"`${CC} -v 2>&1 | grep 'gcc version'`\"" >>buildinf.h 62 @echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h 63 @echo "#define DATE \"NetBSD ${OS_VERSION}\"" >>buildinf.h 64 @echo "#endif" >>buildinf.h 65 66 CLEANFILES+= buildinf.h 67 68 # This list is built from the contents of the include/openssl 69 # directory in the OpenSSL source distribution. 70 INCS+= \ 71 aes.h \ 72 asn1.h \ 73 asn1_mac.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 camellia.h \ 86 cast.h \ 87 cmac.h \ 88 cmp.h \ 89 cmp_util.h \ 90 cmperr.h \ 91 cms.h \ 92 cmserr.h \ 93 comp.h \ 94 comperr.h \ 95 conf.h \ 96 conf_api.h \ 97 conferr.h \ 98 configuration.h \ 99 conftypes.h \ 100 core.h \ 101 core_dispatch.h \ 102 core_names.h \ 103 core_object.h \ 104 crmf.h \ 105 crmferr.h \ 106 crypto.h \ 107 cryptoerr.h \ 108 cryptoerr_legacy.h \ 109 ct.h \ 110 cterr.h \ 111 decoder.h \ 112 decodererr.h \ 113 des.h \ 114 dh.h \ 115 dherr.h \ 116 dsa.h \ 117 dsaerr.h \ 118 dtls1.h \ 119 e_os2.h \ 120 ebcdic.h \ 121 ec.h \ 122 ecdh.h \ 123 ecdsa.h \ 124 ecerr.h \ 125 encoder.h \ 126 encodererr.h \ 127 engine.h \ 128 engineerr.h \ 129 err.h \ 130 ess.h \ 131 esserr.h \ 132 evp.h \ 133 evperr.h \ 134 fips_names.h \ 135 fipskey.h \ 136 hmac.h \ 137 http.h \ 138 httperr.h \ 139 kdf.h \ 140 kdferr.h \ 141 lhash.h \ 142 macros.h \ 143 md2.h \ 144 md4.h \ 145 md5.h \ 146 modes.h \ 147 obj_mac.h \ 148 objects.h \ 149 objectserr.h \ 150 ocsp.h \ 151 ocsperr.h \ 152 opensslconf.h \ 153 opensslv.h \ 154 ossl_typ.h \ 155 param_build.h \ 156 params.h \ 157 pem.h \ 158 pem2.h \ 159 pemerr.h \ 160 pkcs12.h \ 161 pkcs12err.h \ 162 pkcs7.h \ 163 pkcs7err.h \ 164 prov_ssl.h \ 165 proverr.h \ 166 provider.h \ 167 rand.h \ 168 randerr.h \ 169 rc2.h \ 170 rc4.h \ 171 ripemd.h \ 172 rsa.h \ 173 rsaerr.h \ 174 safestack.h \ 175 seed.h \ 176 self_test.h \ 177 sha.h \ 178 srp.h \ 179 srtp.h \ 180 ssl.h \ 181 ssl2.h \ 182 ssl3.h \ 183 sslerr.h \ 184 sslerr_legacy.h \ 185 stack.h \ 186 store.h \ 187 storeerr.h \ 188 symhacks.h \ 189 thread.h \ 190 tls1.h \ 191 trace.h \ 192 ts.h \ 193 tserr.h \ 194 txt_db.h \ 195 types.h \ 196 ui.h \ 197 uierr.h \ 198 whrlpool.h \ 199 x509.h \ 200 x509_vfy.h \ 201 x509err.h \ 202 x509v3.h \ 203 x509v3err.h 204 205 # IDEA - patented, but we install the header anyways 206 INCS+= idea.h 207 208 # RC5 - patented, but we install the header anyways 209 INCS+= rc5.h 210 211 # MDC2 - patented, but we install the header anyways 212 INCS+= mdc2.h 213 214 .if (${USE_FIPS} != "no") 215 # FIPS 216 # This part is always included, because OpenSSL does not protect 217 # The FIPS include files 218 .PATH: ${OPENSSLSRC}/fips ${OPENSSLSRC}/fips/rand 219 INCS+= fips.h fips_rand.h 220 .endif 221 222 .if (${USE_FIPS} != "no") 223 CPPFLAGS+=-DOPENSSL_FIPS 224 .PATH: ${OPENSSLSRC}/fips/aes 225 SRCS+=fips_aes_core.c fips_aes_selftest.c 226 .PATH: ${OPENSSLSRC}/fips/des 227 SRCS+=fips_des_enc.c fips_des_selftest.c fips_set_key.c 228 # asm/fips-dx86-elf.s 229 .PATH: ${OPENSSLSRC}/fips/dh 230 SRCS+=fips_dh_check.c fips_dh_gen.c fips_dh_key.c 231 .PATH: ${OPENSSLSRC}/fips/dsa 232 SRCS+=fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c 233 #.PATH: ${OPENSSLSRC}/fips/rand 234 SRCS+=fips_rand.c 235 .PATH: ${OPENSSLSRC}/fips/rsa 236 SRCS+=fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c 237 SRCS+=fips_sha1dgst.c fips_sha1_selftest.c 238 # asm/sx86-elf.s 239 .PATH: ${OPENSSLSRC}/fips/sha1 240 #.PATH: ${OPENSSLSRC}/fips 241 SRCS+=fips.c fips_err_wrapper.c 242 243 SRCS+=rc5_skey.c i_skey.c mdc2dgst.c 244 .endif 245 246 COPTS.eng_padlock.c = -Wno-error=stack-protector 247 COPTS.bn_exp.c = -Wno-error=stack-protector 248 249 INCSDIR=/usr/include/openssl 250 251 VERSION_MAP= crypto.map 252 253 PKGCONFIG=libcrypto 254 .include "${.CURDIR}/../../pkgconfig.mk" 255 256 # too much of a pain to generate opensslv.h / configuration.h / fipskey.h 257 GENH = \ 258 asn1.h \ 259 asn1t.h \ 260 bio.h \ 261 cmp.h \ 262 cms.h \ 263 conf.h \ 264 crmf.h \ 265 crypto.h \ 266 ct.h \ 267 err.h \ 268 ess.h \ 269 lhash.h \ 270 ocsp.h \ 271 pkcs12.h \ 272 pkcs7.h \ 273 safestack.h \ 274 srp.h \ 275 ssl.h \ 276 ui.h \ 277 x509.h \ 278 x509_vfy.h \ 279 x509v3.h 280 281 .for i in ${GENH} 282 $i: $i.in 283 ${_MKTARGET_CREATE} 284 ${HOST_SH} ${.CURDIR}/gen ${.ALLSRC} > ${.TARGET} 285 .endfor 286 287 .include <bsd.lib.mk> 288