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