summaryrefslogtreecommitdiffstats
path: root/secure/lib/libcrypt/Makefile
blob: 91507911c01c50f918394d8bb9de22fd619da14f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# $FreeBSD$
#

SHLIB_MAJOR=	3
LIB=		descrypt

LCRYPTBASE=	libcrypt
LSCRYPTBASE=	lib${LIB}

LCRYPTSO=	${LCRYPTBASE}.so.${SHLIB_MAJOR}
LSCRYPTSO=	${LSCRYPTBASE}.so.${SHLIB_MAJOR}

.if ${OBJFORMAT} == elf
SONAME=		${LCRYPTSO}
.endif

.PATH:		${.CURDIR}/../../../lib/libmd ${.CURDIR}/../../../lib/libcrypt
SRCS=		crypt.c crypt-md5.c crypt-shs.c misc.c
STATICSRCS=	md5c.c sha0c.c sha1c.c
STATICOBJS=	${STATICSRCS:S/.c/.o/g}
SRCS+=		crypt-des.c
MAN3=		crypt.3
CFLAGS+=	-I${.CURDIR}/../../../lib/libmd
CFLAGS+=	-I${.CURDIR}/../../../lib/libcrypt
CFLAGS+=	-DNONEXPORTABLE_CRYPT
CFLAGS+=	-DLIBC_SCCS -Wall
PRECIOUSLIB=	yes

LDADD+=		-lmd
DPADD+=		${LIBMD}

# Include this early to pick up the definitions of SHLIB_MAJOR and
# SHLIB_MINOR which are used in the existence tests.
.include "${.CURDIR}/../../../lib/Makefile.inc"

# We only install the links if they do not already exist.
# This may have to be revised
.if !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}.a)
SYMLINKS+=	${LSCRYPTBASE}.a ${LIBDIR}/${LCRYPTBASE}.a
.endif
.if !defined(NOPROFILE) && !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}_p.a)
SYMLINKS+=	${LSCRYPTBASE}_p.a ${LIBDIR}/${LCRYPTBASE}_p.a
.endif
.if !defined(NOPIC) && !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTSO})
SYMLINKS+=	${LSCRYPTSO} ${SHLIBDIR}/${LCRYPTSO}
.endif
.if !defined(NOPIC) && ${OBJFORMAT} == elf && \
    !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTBASE}.so)
SYMLINKS+=	${LSCRYPTBASE}.so ${SHLIBDIR}/${LCRYPTBASE}.so
.endif

.include <bsd.lib.mk>

afterinstall:
.if !defined(NOPIC)
	@cd ${DESTDIR}${SHLIBDIR}; \
	rm -f ${LCRYPTSO}; \
	ln -sf ${LSCRYPTSO} ${LCRYPTSO};
.endif
.if !defined(NOPIC) && ${OBJFORMAT} == elf
	@cd ${DESTDIR}${SHLIBDIR}; \
	rm -f ${LCRYPTBASE}.so; \
	ln -sf ${LSCRYPTBASE}.so libcrypt.so
.endif
	@cd  ${DESTDIR}${LIBDIR}; \
	rm -f ${LCRYPTBASE}.a; \
	ln -sf ${LSCRYPTBASE}.a libcrypt.a
.if !defined(NOPROFILE)
	@cd  ${DESTDIR}${LIBDIR}; \
	rm -f ${LCRYPTBASE}_p.a; \
	ln -sf ${LSCRYPTBASE}_p.a libcrypt_p.a
.endif
OpenPOWER on IntegriCloud