1 1.2 rillig # $NetBSD: Makefile,v 1.2 2025/04/06 23:03:05 rillig 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.2 rillig #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.2 rillig # XXX: There's a bit of work to do before we can enable warnings. 29 1.1 christos WARNS=0 30 1.2 rillig CWARNFLAGS.clang+= -Wno-empty-body -Wno-unused-value -Wno-parentheses -Wno-implicit-int-float-conversion 31 1.2 rillig # XXX: This warning seems to trigger incorrectly 32 1.2 rillig CWARNFLAGS.clang+= -Wno-atomic-alignment 33 1.2 rillig 34 1.2 rillig LINTFLAGS+= -X 129 # expression has null effect 35 1.2 rillig LINTFLAGS+= -X 117 # bitwise '>>' on signed value possibly nonportable 36 1.2 rillig LINTFLAGS+= -X 231 # argument '%s' unused in function '%s' 37 1.2 rillig LINTFLAGS+= -X 220 # fallthrough on case statement 38 1.2 rillig LINTFLAGS+= -X 118 # semantics of '%s' change in ANSI C; use explicit cast 39 1.1 christos 40 1.1 christos CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto -I${OPENSSLSRC} 41 1.2 rillig CPPFLAGS+= -I${OPENSSLSRC}/include -I${OPENSSLSRC}/crypto/include 42 1.1 christos CPPFLAGS+= -I${OPENSSLSRC}/crypto/asn1 -I${OPENSSLSRC}/crypto/evp 43 1.1 christos CPPFLAGS+= -I${OPENSSLSRC}/crypto/modes 44 1.2 rillig CPPFLAGS+= -I${OPENSSLSRC}/../include 45 1.1 christos 46 1.1 christos CRYPTODIST= ${NETBSDSRCDIR}/crypto 47 1.1 christos 48 1.1 christos .include "${NETBSDSRCDIR}/crypto/Makefile.openssl" 49 1.2 rillig .PATH: ${OPENSSLSRC} ${OPENSSLSRC}/include/openssl 50 1.2 rillig .PATH: ${OPENSSLSRC}/../include/openssl ${OPENSSLSRC}/include/internal 51 1.1 christos 52 1.1 christos .include "srcs.inc" 53 1.1 christos 54 1.1 christos AFLAGS+=-DELF 55 1.1 christos LIBDPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt 56 1.1 christos 57 1.1 christos OS_VERSION!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 58 1.1 christos 59 1.1 christos # XXX CFLAGS: While it would be nice to know which compiler flags 60 1.1 christos # XXX the library was built with, we don't want pathname information 61 1.1 christos # XXX for the host toolchain embedded in the image. 62 1.1 christos ${SRCS}: buildinf.h 63 1.1 christos buildinf.h: Makefile 64 1.1 christos @echo "#ifndef MK1MF_BUILD" >buildinf.h 65 1.2 rillig @echo "#define compiler_flags \"`${CC} -v 2>&1 | grep 'gcc version'`\"" >>buildinf.h 66 1.1 christos @echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h 67 1.1 christos @echo "#define DATE \"NetBSD ${OS_VERSION}\"" >>buildinf.h 68 1.1 christos @echo "#endif" >>buildinf.h 69 1.1 christos 70 1.1 christos CLEANFILES+= buildinf.h 71 1.1 christos 72 1.1 christos # This list is built from the contents of the include/openssl 73 1.1 christos # directory in the OpenSSL source distribution. 74 1.2 rillig INCS+= \ 75 1.2 rillig aes.h \ 76 1.2 rillig asn1.h \ 77 1.2 rillig asn1_mac.h \ 78 1.2 rillig asn1err.h \ 79 1.2 rillig asn1t.h \ 80 1.2 rillig async.h \ 81 1.2 rillig asyncerr.h \ 82 1.2 rillig bio.h \ 83 1.2 rillig bioerr.h \ 84 1.2 rillig blowfish.h \ 85 1.2 rillig bn.h \ 86 1.2 rillig bnerr.h \ 87 1.2 rillig buffer.h \ 88 1.2 rillig buffererr.h \ 89 1.2 rillig camellia.h \ 90 1.2 rillig cast.h \ 91 1.2 rillig cmac.h \ 92 1.2 rillig cms.h \ 93 1.2 rillig cmserr.h \ 94 1.2 rillig comp.h \ 95 1.2 rillig comperr.h \ 96 1.2 rillig conf.h \ 97 1.2 rillig conf_api.h \ 98 1.2 rillig conferr.h \ 99 1.2 rillig crypto.h \ 100 1.2 rillig cryptoerr.h \ 101 1.2 rillig ct.h \ 102 1.2 rillig cterr.h \ 103 1.2 rillig des.h \ 104 1.2 rillig dh.h \ 105 1.2 rillig dherr.h \ 106 1.2 rillig dsa.h \ 107 1.2 rillig dsaerr.h \ 108 1.2 rillig dtls1.h \ 109 1.2 rillig e_os2.h \ 110 1.2 rillig ebcdic.h \ 111 1.2 rillig ec.h \ 112 1.2 rillig ecdh.h \ 113 1.2 rillig ecdsa.h \ 114 1.2 rillig ecerr.h \ 115 1.2 rillig engine.h \ 116 1.2 rillig engineerr.h \ 117 1.2 rillig err.h \ 118 1.2 rillig evp.h \ 119 1.2 rillig evperr.h \ 120 1.2 rillig hmac.h \ 121 1.2 rillig kdf.h \ 122 1.2 rillig kdferr.h \ 123 1.2 rillig lhash.h \ 124 1.2 rillig md2.h \ 125 1.2 rillig md4.h \ 126 1.2 rillig md5.h \ 127 1.2 rillig modes.h \ 128 1.2 rillig obj_mac.h \ 129 1.2 rillig objects.h \ 130 1.2 rillig objectserr.h \ 131 1.2 rillig ocsp.h \ 132 1.2 rillig ocsperr.h \ 133 1.2 rillig opensslconf.h \ 134 1.2 rillig opensslv.h \ 135 1.2 rillig ossl_typ.h \ 136 1.2 rillig pem.h \ 137 1.2 rillig pem2.h \ 138 1.2 rillig pemerr.h \ 139 1.2 rillig pkcs12.h \ 140 1.2 rillig pkcs12err.h \ 141 1.2 rillig pkcs7.h \ 142 1.2 rillig pkcs7err.h \ 143 1.2 rillig rand.h \ 144 1.2 rillig rand_drbg.h \ 145 1.2 rillig randerr.h \ 146 1.2 rillig rc2.h \ 147 1.2 rillig rc4.h \ 148 1.2 rillig ripemd.h \ 149 1.2 rillig rsa.h \ 150 1.2 rillig rsaerr.h \ 151 1.2 rillig safestack.h \ 152 1.2 rillig seed.h \ 153 1.2 rillig sha.h \ 154 1.2 rillig srp.h \ 155 1.2 rillig srtp.h \ 156 1.2 rillig ssl.h \ 157 1.2 rillig ssl2.h \ 158 1.2 rillig ssl3.h \ 159 1.2 rillig sslerr.h \ 160 1.2 rillig stack.h \ 161 1.2 rillig store.h \ 162 1.2 rillig storeerr.h \ 163 1.2 rillig symhacks.h \ 164 1.2 rillig tls1.h \ 165 1.2 rillig ts.h \ 166 1.2 rillig tserr.h \ 167 1.2 rillig txt_db.h \ 168 1.2 rillig ui.h \ 169 1.2 rillig uierr.h \ 170 1.2 rillig whrlpool.h \ 171 1.2 rillig x509.h \ 172 1.2 rillig x509_vfy.h \ 173 1.2 rillig x509err.h \ 174 1.2 rillig x509v3.h \ 175 1.2 rillig x509v3err.h 176 1.1 christos 177 1.1 christos # IDEA - patented, but we install the header anyways 178 1.1 christos INCS+= idea.h 179 1.1 christos 180 1.1 christos # RC5 - patented, but we install the header anyways 181 1.1 christos INCS+= rc5.h 182 1.1 christos 183 1.1 christos # MDC2 - patented, but we install the header anyways 184 1.1 christos INCS+= mdc2.h 185 1.1 christos 186 1.1 christos .if (${USE_FIPS} != "no") 187 1.1 christos # FIPS 188 1.1 christos # This part is always included, because OpenSSL does not protect 189 1.1 christos # The FIPS include files 190 1.1 christos .PATH: ${OPENSSLSRC}/fips ${OPENSSLSRC}/fips/rand 191 1.1 christos INCS+= fips.h fips_rand.h 192 1.1 christos .endif 193 1.1 christos 194 1.1 christos .if (${USE_FIPS} != "no") 195 1.1 christos CPPFLAGS+=-DOPENSSL_FIPS 196 1.1 christos .PATH: ${OPENSSLSRC}/fips/aes 197 1.1 christos SRCS+=fips_aes_core.c fips_aes_selftest.c 198 1.1 christos .PATH: ${OPENSSLSRC}/fips/des 199 1.1 christos SRCS+=fips_des_enc.c fips_des_selftest.c fips_set_key.c 200 1.1 christos # asm/fips-dx86-elf.s 201 1.1 christos .PATH: ${OPENSSLSRC}/fips/dh 202 1.1 christos SRCS+=fips_dh_check.c fips_dh_gen.c fips_dh_key.c 203 1.1 christos .PATH: ${OPENSSLSRC}/fips/dsa 204 1.1 christos SRCS+=fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c 205 1.1 christos #.PATH: ${OPENSSLSRC}/fips/rand 206 1.1 christos SRCS+=fips_rand.c 207 1.1 christos .PATH: ${OPENSSLSRC}/fips/rsa 208 1.1 christos SRCS+=fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c 209 1.1 christos SRCS+=fips_sha1dgst.c fips_sha1_selftest.c 210 1.1 christos # asm/sx86-elf.s 211 1.1 christos .PATH: ${OPENSSLSRC}/fips/sha1 212 1.1 christos #.PATH: ${OPENSSLSRC}/fips 213 1.1 christos SRCS+=fips.c fips_err_wrapper.c 214 1.1 christos 215 1.1 christos SRCS+=rc5_skey.c i_skey.c mdc2dgst.c 216 1.1 christos .endif 217 1.1 christos 218 1.1 christos COPTS.eng_padlock.c = -Wno-stack-protector 219 1.1 christos 220 1.1 christos INCSDIR=/usr/include/openssl 221 1.1 christos 222 1.2 rillig LDFLAGS+=-Wl,--version-script=${.CURDIR}/crypto.map 223 1.2 rillig 224 1.1 christos PKGCONFIG=libcrypto 225 1.1 christos .include "${.CURDIR}/../../pkgconfig.mk" 226 1.1 christos 227 1.2 rillig 228 1.1 christos .include <bsd.lib.mk> 229 1.2 rillig 230