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