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