1 # $NetBSD: Makefile,v 1.6 2012/07/26 19:58:40 christos 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 24 .include <bsd.own.mk> 25 .include <bsd.shlib.mk> 26 .include <bsd.sys.mk> # for HOST_SH 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 31 32 CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto -I${OPENSSLSRC} 33 CPPFLAGS+= -I${OPENSSLSRC}/crypto/asn1 -I${OPENSSLSRC}/crypto/evp 34 35 CRYPTODIST= ${NETBSDSRCDIR}/crypto 36 37 .include "${NETBSDSRCDIR}/crypto/Makefile.openssl" 38 .PATH: ${OPENSSLSRC} 39 40 .include "srcs.inc" 41 42 43 AFLAGS+=-DELF 44 LIBDPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt 45 46 OS_VERSION!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 47 48 # XXX CFLAGS: While it would be nice to know which compiler flags 49 # XXX the library was built with, we don't want pathname information 50 # XXX for the host toolchain embedded in the image. 51 ${SRCS}: buildinf.h 52 buildinf.h: Makefile 53 @echo "#ifndef MK1MF_BUILD" >buildinf.h 54 @echo "#define CFLAGS \"`${CC} -v 2>&1 | grep 'gcc version'`\"" >>buildinf.h 55 @echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h 56 @echo "#define DATE \"NetBSD ${OS_VERSION}\"" >>buildinf.h 57 @echo "#endif" >>buildinf.h 58 59 CLEANFILES+= buildinf.h 60 61 # This list is built from the contents of the include/openssl 62 # directory in the OpenSSL source distribution. 63 INCS+= aes.h asn1.h asn1_mac.h asn1t.h bio.h blowfish.h bn.h \ 64 buffer.h cast.h cmac.h cms.h comp.h conf.h conf_api.h crypto.h des.h \ 65 dh.h dsa.h dso.h e_os2.h ebcdic.h ec.h ecdh.h ecdsa.h engine.h \ 66 err.h evp.h hmac.h krb5_asn.h lhash.h md2.h md4.h md5.h modes.h \ 67 obj_mac.h objects.h ocsp.h opensslconf.h opensslv.h ossl_typ.h \ 68 pem.h pem2.h pkcs12.h pkcs7.h rand.h rc2.h rc4.h ripemd.h \ 69 rsa.h safestack.h sha.h srp.h stack.h store.h symhacks.h ts.h txt_db.h \ 70 ui.h ui_compat.h x509.h x509_vfy.h x509v3.h pqueue.h camellia.h \ 71 whrlpool.h seed.h 72 # des_old.h 73 74 # IDEA - patented, but we install the header anyways 75 INCS+= idea.h 76 77 # RC5 - patented, but we install the header anyways 78 INCS+= rc5.h 79 80 # MDC2 - patented, but we install the header anyways 81 INCS+= mdc2.h 82 83 .if (${USE_FIPS} != "no") 84 # FIPS 85 # This part is always included, because OpenSSL does not protect 86 # The FIPS include files 87 .PATH: ${OPENSSLSRC}/fips ${OPENSSLSRC}/fips/rand 88 INCS+= fips.h fips_rand.h 89 .endif 90 91 .if (${USE_FIPS} != "no") 92 CPPFLAGS+=-DOPENSSL_FIPS 93 .PATH: ${OPENSSLSRC}/fips/aes 94 SRCS+=fips_aes_core.c fips_aes_selftest.c 95 .PATH: ${OPENSSLSRC}/fips/des 96 SRCS+=fips_des_enc.c fips_des_selftest.c fips_set_key.c 97 # asm/fips-dx86-elf.s 98 .PATH: ${OPENSSLSRC}/fips/dh 99 SRCS+=fips_dh_check.c fips_dh_gen.c fips_dh_key.c 100 .PATH: ${OPENSSLSRC}/fips/dsa 101 SRCS+=fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c 102 #.PATH: ${OPENSSLSRC}/fips/rand 103 SRCS+=fips_rand.c 104 .PATH: ${OPENSSLSRC}/fips/rsa 105 SRCS+=fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c 106 SRCS+=fips_sha1dgst.c fips_sha1_selftest.c 107 # asm/sx86-elf.s 108 .PATH: ${OPENSSLSRC}/fips/sha1 109 #.PATH: ${OPENSSLSRC}/fips 110 SRCS+=fips.c fips_err_wrapper.c 111 112 SRCS+=rc5_skey.c i_skey.c mdc2dgst.c 113 .endif 114 115 COPTS.eng_padlock.c = -Wno-stack-protector 116 117 INCSDIR=/usr/include/openssl 118 119 .include <bsd.lib.mk> 120