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