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