1# 2# $FreeBSD$ 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 27LDADD+= -lmd 28DPADD+= ${LIBMD} 29 30# Include this early to pick up the definitions of SHLIB_MAJOR and 31# SHLIB_MINOR which are used in the existence tests. 32.include "${.CURDIR}/../Makefile.inc" 33 34# We only install the links if they do not already exist. 35# This may have to be revised 36.if !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}.a) 37SYMLINKS+= ${LSCRYPTBASE}.a ${LIBDIR}/${LCRYPTBASE}.a 38.endif 39.if !defined(NOPROFILE) && !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}_p.a) 40SYMLINKS+= ${LSCRYPTBASE}_p.a ${LIBDIR}/${LCRYPTBASE}_p.a 41.endif 42.if !defined(NOPIC) && !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTSO}) 43SYMLINKS+= ${LSCRYPTSO} ${SHLIBDIR}/${LCRYPTSO} 44.endif 45.if !defined(NOPIC) && ${OBJFORMAT} == elf && \ 46 !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTBASE}.so) 47SYMLINKS+= ${LSCRYPTBASE}.so ${SHLIBDIR}/${LCRYPTBASE}.so 48.endif 49 50.include <bsd.lib.mk> 51 52afterinstall: 53.if !defined(NOPIC) 54 @cd ${DESTDIR}${SHLIBDIR}; \ 55 rm -f ${LCRYPTSO}; \ 56 ln -sf ${LSCRYPTSO} ${LCRYPTSO}; 57.endif 58.if !defined(NOPIC) && ${OBJFORMAT} == elf 59 @cd ${DESTDIR}${SHLIBDIR}; \ 60 rm -f ${LCRYPTBASE}.so; \ 61 ln -sf ${LSCRYPTBASE}.so libcrypt.so 62.endif 63 @cd ${DESTDIR}${LIBDIR}; \ 64 rm -f ${LCRYPTBASE}.a; \ 65 ln -sf ${LSCRYPTBASE}.a libcrypt.a 66.if !defined(NOPROFILE) 67 @cd ${DESTDIR}${LIBDIR}; \ 68 rm -f ${LCRYPTBASE}_p.a; \ 69 ln -sf ${LSCRYPTBASE}_p.a libcrypt_p.a 70.endif 71