xref: /freebsd/secure/lib/libcrypto/Makefile.inc (revision 27beb2e98db3193bd22010b9eb00cc7787bb0a2f)
1# $FreeBSD$
2
3LCRYPTO_SRC=	${.CURDIR}/../../../crypto/openssl/crypto
4CFLAGS+= -DTERMIOS -DANSI_SOURCE -I${LCRYPTO_SRC} -I${.OBJDIR}
5.if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
6CFLAGS+= -DNO_IDEA
7.endif
8
9.if ${MACHINE_ARCH} == "i386"
10CFLAGS+= -DL_ENDIAN
11# -DBN_ASM -DSHA1_ASM -DMD5_ASM -DRMD160_ASM - XXX notyet
12.elif ${MACHINE_ARCH} == "alpha"
13# no ENDIAN stuff defined for alpha (64-bit)
14.endif
15
16WITH_RSA?= YES
17
18HDRS=	asn1/asn1.h asn1/asn1_mac.h bio/bio.h bf/blowfish.h bn/bn.h \
19	buffer/buffer.h cast/cast.h comp/comp.h conf/conf.h crypto.h \
20	des/des.h dh/dh.h dsa/dsa.h ../e_os.h ../e_os2.h ebcdic.h \
21	err/err.h hmac/hmac.h lhash/lhash.h md2/md2.h \
22	md5/md5.h mdc2/mdc2.h objects/objects.h opensslv.h pem/pem.h \
23	pem/pem2.h pkcs12/pkcs12.h pkcs7/pkcs7.h rand/rand.h rc2/rc2.h \
24	rc4/rc4.h rc5/rc5.h ripemd/ripemd.h rsa/rsa.h stack/safestack.h \
25	sha/sha.h stack/stack.h tmdiff.h txt_db/txt_db.h x509/x509.h \
26	x509/x509_vfy.h x509v3/x509v3.h
27
28.if defined(MAKE_IDEA) && ${MAKE_IDEA} == YES
29HDRS+=	idea/idea.h
30.endif
31
32.for h in ${HDRS}
33CRYPTO_HDRS+= ${LCRYPTO_SRC}/${h}
34.endfor
35
36SRCS+=		buildinf.h openssl/opensslconf.h openssl/evp.h
37CLEANFILES+=	buildinf.h openssl/opensslconf.h openssl/evp.h
38CLEANDIRS+=	openssl
39
40buildinf.h:
41	( echo "#ifndef MK1MF_BUILD"; \
42	echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
43	echo "  #define CFLAGS \"$(CC)\""; \
44	echo "  #define PLATFORM \"`uname -s`-`uname -m`\""; \
45	echo "  #define DATE \"`LC_TIME=C date`\""; \
46	echo "#endif" ) > ${.TARGET}
47
48#	XXX:  The openssl/ dependencies are not correct, in that a change in
49#	any of ${CRYPTO_HDRS} ${EXTRA_HDRS} will no repopulate openssl/.
50#	This deficiency will be fixed in a later commit.
51
52.ORDER:	openssl/opensslconf.h openssl/evp.h
53
54openssl/opensslconf.h:  ../libcrypto/opensslconf-${MACHINE_ARCH}.h
55	mkdir -p openssl
56	cp ${.OODATE} ${.TARGET}
57	${INSTALL} ${COPY} -m 444 ${CRYPTO_HDRS} ${EXTRA_HDRS} openssl
58
59openssl/evp.h: ${LCRYPTO_SRC}/evp/evp.h
60.if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
61	sed '/^#ifndef NO_IDEA$$/,/^#endif$$/d' ${.OODATE} > ${.TARGET}
62.else
63	${INSTALL} ${COPY} -m 444 ${.OODATE} ${.TARGET}
64.endif
65