xref: /freebsd/lib/libcrypt/Makefile (revision 87c2aab0a0b3db2a4690773b869e8cfc8b3ac6c2)
1SHLIBDIR?=	/lib
2
3.include <src.opts.mk>
4
5PACKAGE=	runtime
6
7SHLIB_MAJOR=	5
8LIB=		crypt
9
10SRCS=		crypt.c misc.c \
11		crypt-md5.c \
12		crypt-nthash.c \
13		crypt-sha256.c \
14		crypt-sha512.c
15MAN=		crypt.3
16MLINKS=		crypt.3 crypt_get_format.3 crypt.3 crypt_r.3 \
17		crypt.3 crypt_set_format.3
18CFLAGS+=	-I${SRCTOP}/lib/libmd \
19		-I${SRCTOP}/sys/crypto/sha2
20
21# Pull in the strong crypto, if it is present.
22.if exists(${SRCTOP}/secure/lib/libcrypt) && ${MK_CRYPT} != "no"
23.PATH:		${SRCTOP}/secure/lib/libcrypt
24SRCS+=		crypt-des.c crypt-blowfish.c blowfish.c
25CFLAGS+=	-I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH
26.endif
27
28WARNS?=		2
29
30PRECIOUSLIB=
31
32HAS_TESTS=
33SUBDIR.${MK_TESTS}+= tests
34
35LIBADD+=	md
36SHLIB_LDSCRIPT=	libcrypt.ldscript
37STATIC_LDSCRIPT= libcrypt.aldscript
38CLEANFILES+=	libcrypt.ald
39
40libcrypt.ald: ${.CURDIR}/${STATIC_LDSCRIPT}
41	sed -e 's,@@LIB@@,${LIB},g' \
42	    -e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \
43	    ${.ALLSRC} > ${.TARGET}
44
45all: ${STATIC_LDSCRIPT} libcrypt.ald
46
47install-libcrypt.a: libcrypt.ald
48	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
49	    ${_INSTALLFLAGS} libcrypt.ald ${DESTDIR}${_LIBDIR}/lib${LIB}.a
50
51realinstall: install-libcrypt.a
52
53.include <bsd.lib.mk>
54