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