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 misc.c 20STATICSRCS= md5c.c 21STATICOBJS= ${STATICSRCS:S/.c/.o/g} 22MAN3= crypt.3 23MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3 24CFLAGS+= -I${.CURDIR}/../libmd 25CFLAGS+= -DLIBC_SCCS -Wall 26PRECIOUSLIB= yes 27 28# Include this early to pick up the definitions of SHLIB_MAJOR and 29# SHLIB_MINOR which are used in the existence tests. 30.include "${.CURDIR}/../Makefile.inc" 31 32# We only install the links if they do not already exist. 33# This may have to be revised 34.if !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}.a) 35SYMLINKS+= ${LSCRYPTBASE}.a ${LIBDIR}/${LCRYPTBASE}.a 36.endif 37.if !defined(NOPROFILE) && !exists(${DESTDIR}${LIBDIR}/${LCRYPTBASE}_p.a) 38SYMLINKS+= ${LSCRYPTBASE}_p.a ${LIBDIR}/${LCRYPTBASE}_p.a 39.endif 40.if !defined(NOPIC) && !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTSO}) 41SYMLINKS+= ${LSCRYPTSO} ${SHLIBDIR}/${LCRYPTSO} 42.endif 43.if !defined(NOPIC) && ${OBJFORMAT} == elf && \ 44 !exists(${DESTDIR}${SHLIBDIR}/${LCRYPTBASE}.so) 45SYMLINKS+= ${LSCRYPTBASE}.so ${SHLIBDIR}/${LCRYPTBASE}.so 46.endif 47 48.include <bsd.lib.mk> 49 50afterinstall: 51.if !defined(NOPIC) 52 @cd ${DESTDIR}${SHLIBDIR}; \ 53 rm -f ${LCRYPTSO}; \ 54 ln -sf ${LSCRYPTSO} ${LCRYPTSO}; 55.endif 56.if !defined(NOPIC) && ${OBJFORMAT} == elf 57 @cd ${DESTDIR}${SHLIBDIR}; \ 58 rm -f ${LCRYPTBASE}.so; \ 59 ln -sf ${LSCRYPTBASE}.so libcrypt.so 60.endif 61 @cd ${DESTDIR}${LIBDIR}; \ 62 rm -f ${LCRYPTBASE}.a; \ 63 ln -sf ${LSCRYPTBASE}.a libcrypt.a 64.if !defined(NOPROFILE) 65 @cd ${DESTDIR}${LIBDIR}; \ 66 rm -f ${LCRYPTBASE}_p.a; \ 67 ln -sf ${LSCRYPTBASE}_p.a libcrypt_p.a 68.endif 69