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