Makefile revision 54751
1#
2# $FreeBSD: head/lib/libcrypt/Makefile 54751 1999-12-17 20:04:01Z peter $
3#
4
5SHLIB_MAJOR=	2
6LIB=		scrypt
7
8LCRYPTBASE=	libcrypt
9LSCRYPTBASE=	lib${LIB}
10
11LCRYPTSO=	${LCRYPTBASE}.so.${SHLIB_MAJOR}
12LSCRYPTSO=	${LSCRYPTBASE}.so.${SHLIB_MAJOR}
13
14.if ${OBJFORMAT} == elf
15SONAME=		${LCRYPTSO}
16.endif
17
18.PATH:		${.CURDIR}/../libmd
19SRCS=		crypt.c crypt-md5.c crypt-shs.c misc.c
20STATICSRCS=	md5c.c sha0c.c sha1c.c
21STATICOBJS=	${STATICSRCS:S/.c/.o/g}
22MAN3=		crypt.3
23CFLAGS+=	-I${.CURDIR}/../libmd
24CFLAGS+=	-DLIBC_SCCS -Wall
25PRECIOUSLIB=	yes
26
27# Include this early to pick up the definitions of SHLIB_MAJOR and
28# SHLIB_MINOR which are used in the existence tests.
29.include "${.CURDIR}/../Makefile.inc"
30
31# We only install the links if they do not already exist.
32# This may have to be revised
33.if !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}.a)
34SYMLINKS+=	${LSCRYPTBASE}.a ${LIBDIR}/${LCRYPTBASE}.a
35.endif
36.if !defined(NOPROFILE) && !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}_p.a)
37SYMLINKS+=	${LSCRYPTBASE}_p.a ${LIBDIR}/${LCRYPTBASE}_p.a
38.endif
39.if !defined(NOPIC) && !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTSO})
40SYMLINKS+=	${LSCRYPTSO} ${SHLIBDIR}/${LCRYPTSO}
41.endif
42.if !defined(NOPIC) && ${OBJFORMAT} == elf && \
43    !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTBASE}.so)
44SYMLINKS+=	${LSCRYPTBASE}.so ${SHLIBDIR}/${LCRYPTBASE}.so
45.endif
46
47.include <bsd.lib.mk>
48
49afterinstall:
50.if !defined(NOPIC)
51	@cd ${DESTDIR}${SHLIBDIR}; \
52	rm -f ${LCRYPTSO}; \
53	ln -sf ${LSCRYPTSO} ${LCRYPTSO};
54.endif
55.if !defined(NOPIC) && ${OBJFORMAT} == elf
56	@cd ${DESTDIR}${SHLIBDIR}; \
57	rm -f ${LCRYPTBASE}.so; \
58	ln -sf ${LSCRYPTBASE}.so libcrypt.so
59.endif
60	@cd  ${DESTDIR}${LIBDIR}; \
61	rm -f ${LCRYPTBASE}.a; \
62	ln -sf ${LSCRYPTBASE}.a libcrypt.a
63.if !defined(NOPROFILE)
64	@cd  ${DESTDIR}${LIBDIR}; \
65	rm -f ${LCRYPTBASE}_p.a; \
66	ln -sf ${LSCRYPTBASE}_p.a libcrypt_p.a
67.endif
68