xref: /freebsd/lib/libcrypt/Makefile (revision 87c2aab0a0b3db2a4690773b869e8cfc8b3ac6c2)
118b2ee82SBaptiste DaroussinSHLIBDIR?=	/lib
2fcaa4668SRuslan Ermilov
3c6063d0dSWarner Losh.include <src.opts.mk>
4e1fe3dbaSRuslan Ermilov
5a7b5a3d4SEmmanuel VadotPACKAGE=	runtime
6a7b5a3d4SEmmanuel Vadot
73ca3047aSKen SmithSHLIB_MAJOR=	5
89886bcdfSPeter WemmLIB=		crypt
96b0e02e5SPeter Wemm
10bf513f69SMark MurraySRCS=		crypt.c misc.c \
11cb5e41b1SRobert Clausecker		crypt-md5.c \
12cb5e41b1SRobert Clausecker		crypt-nthash.c \
13cb5e41b1SRobert Clausecker		crypt-sha256.c \
14cb5e41b1SRobert Clausecker		crypt-sha512.c
154a558355SRuslan ErmilovMAN=		crypt.3
165f521d7bSEd SchoutenMLINKS=		crypt.3 crypt_get_format.3 crypt.3 crypt_r.3 \
175f521d7bSEd Schouten		crypt.3 crypt_set_format.3
18*87c2aab0SRobert ClauseckerCFLAGS+=	-I${SRCTOP}/lib/libmd \
19*87c2aab0SRobert Clausecker		-I${SRCTOP}/sys/crypto/sha2
20bf513f69SMark Murray
21bf513f69SMark Murray# Pull in the strong crypto, if it is present.
22562cbd7bSEnji Cooper.if exists(${SRCTOP}/secure/lib/libcrypt) && ${MK_CRYPT} != "no"
23562cbd7bSEnji Cooper.PATH:		${SRCTOP}/secure/lib/libcrypt
245c129616SMark MurraySRCS+=		crypt-des.c crypt-blowfish.c blowfish.c
255c129616SMark MurrayCFLAGS+=	-I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH
269886bcdfSPeter Wemm.endif
27bf513f69SMark Murray
28daaf5759SEd SchoutenWARNS?=		2
29daaf5759SEd Schouten
30a35d8893SRuslan ErmilovPRECIOUSLIB=
314fdd3d54SMark Murray
32d511b20aSEnji CooperHAS_TESTS=
334b330699SEnji CooperSUBDIR.${MK_TESTS}+= tests
34e2197f80SRui Paulo
35cb5e41b1SRobert ClauseckerLIBADD+=	md
36cb5e41b1SRobert ClauseckerSHLIB_LDSCRIPT=	libcrypt.ldscript
37cb5e41b1SRobert ClauseckerSTATIC_LDSCRIPT= libcrypt.aldscript
38cb5e41b1SRobert ClauseckerCLEANFILES+=	libcrypt.ald
39cb5e41b1SRobert Clausecker
40cb5e41b1SRobert Clauseckerlibcrypt.ald: ${.CURDIR}/${STATIC_LDSCRIPT}
41cb5e41b1SRobert Clausecker	sed -e 's,@@LIB@@,${LIB},g' \
42cb5e41b1SRobert Clausecker	    -e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \
43cb5e41b1SRobert Clausecker	    ${.ALLSRC} > ${.TARGET}
44cb5e41b1SRobert Clausecker
45cb5e41b1SRobert Clauseckerall: ${STATIC_LDSCRIPT} libcrypt.ald
46cb5e41b1SRobert Clausecker
47cb5e41b1SRobert Clauseckerinstall-libcrypt.a: libcrypt.ald
48cb5e41b1SRobert Clausecker	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
49cb5e41b1SRobert Clausecker	    ${_INSTALLFLAGS} libcrypt.ald ${DESTDIR}${_LIBDIR}/lib${LIB}.a
50cb5e41b1SRobert Clausecker
51cb5e41b1SRobert Clauseckerrealinstall: install-libcrypt.a
52cb5e41b1SRobert Clausecker
530e27b8d5SGeoff Rehmet.include <bsd.lib.mk>
54