aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2014-11-25 11:07:26 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2014-11-25 11:07:26 +0000
commit6b129086dcee14496517fae085b448e3edc69bc7 (patch)
tree9490af12e8dfdddce4107ac3a4cefe6c56ba0614 /lib
parentd98c8ac029f43d6d1b790246c01075b6eabf6a77 (diff)
downloadsrc-6b129086dcee14496517fae085b448e3edc69bc7.tar.gz
src-6b129086dcee14496517fae085b448e3edc69bc7.zip
Convert libraries to use LIBADD
While here reduce a bit overlinking
Notes
Notes: svn path=/head/; revision=275024
Diffstat (limited to 'lib')
-rw-r--r--lib/atf/libatf-c++/Makefile3
-rw-r--r--lib/libarchive/Makefile20
-rw-r--r--lib/libarchive/test/Makefile3
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile3
-rw-r--r--lib/libc++/Makefile3
-rw-r--r--lib/libc/Makefile6
-rw-r--r--lib/libcam/Makefile3
-rw-r--r--lib/libcapsicum/Makefile3
-rw-r--r--lib/libcasper/Makefile3
-rw-r--r--lib/libcrypt/tests/Makefile3
-rw-r--r--lib/libcuse/Makefile4
-rw-r--r--lib/libdevstat/Makefile3
-rw-r--r--lib/libdpv/Makefile3
-rw-r--r--lib/libdwarf/Makefile3
-rw-r--r--lib/libedit/Makefile3
-rw-r--r--lib/libexecinfo/Makefile3
-rw-r--r--lib/libfetch/Makefile6
-rw-r--r--lib/libgeom/Makefile3
-rw-r--r--lib/libldns/Makefile3
-rw-r--r--lib/libmagic/Makefile3
-rw-r--r--lib/libmemstat/Makefile3
-rw-r--r--lib/libmp/Makefile3
-rw-r--r--lib/libmp/tests/Makefile3
-rw-r--r--lib/libnv/tests/Makefile3
-rw-r--r--lib/libopie/Makefile3
-rw-r--r--lib/libpam/modules/Makefile.inc3
-rw-r--r--lib/libpam/modules/pam_krb5/Makefile3
-rw-r--r--lib/libpam/modules/pam_ksu/Makefile3
-rw-r--r--lib/libpam/modules/pam_nologin/Makefile3
-rw-r--r--lib/libpam/modules/pam_opie/Makefile3
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile3
-rw-r--r--lib/libpam/modules/pam_passwdqc/Makefile3
-rw-r--r--lib/libpam/modules/pam_radius/Makefile3
-rw-r--r--lib/libpam/modules/pam_ssh/Makefile4
-rw-r--r--lib/libpam/modules/pam_tacplus/Makefile3
-rw-r--r--lib/libpam/modules/pam_unix/Makefile6
-rw-r--r--lib/libpjdlog/Makefile3
-rw-r--r--lib/libproc/Makefile9
-rw-r--r--lib/libprocstat/Makefile3
-rw-r--r--lib/libradius/Makefile10
-rw-r--r--lib/librpcsec_gss/Makefile3
-rw-r--r--lib/librt/Makefile3
-rw-r--r--lib/librt/tests/Makefile3
-rw-r--r--lib/libsmb/Makefile3
-rw-r--r--lib/libsqlite3/Makefile1
-rw-r--r--lib/libstdthreads/Makefile3
-rw-r--r--lib/libtacplus/Makefile3
-rw-r--r--lib/libulog/Makefile3
-rw-r--r--lib/libunbound/Makefile3
-rw-r--r--lib/libusb/Makefile3
-rw-r--r--lib/libutil/tests/Makefile3
-rw-r--r--lib/msun/tests/Makefile3
-rw-r--r--lib/ncurses/form/Makefile3
-rw-r--r--lib/ncurses/menu/Makefile3
-rw-r--r--lib/ncurses/panel/Makefile3
55 files changed, 66 insertions, 138 deletions
diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile
index 352a8f4caa4d..c8fdfacf3686 100644
--- a/lib/atf/libatf-c++/Makefile
+++ b/lib/atf/libatf-c++/Makefile
@@ -33,8 +33,7 @@ PRIVATELIB= true
SHLIB_MAJOR= 2
# libatf-c++ depends on the C version of the ATF library to build.
-DPADD= ${LIBATF_C}
-LDADD= -latf-c
+LIBADD+= atf_c
LDFLAGS+= -L${.OBJDIR}/../libatf-c
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index b7e9d7fc95fe..2542a2053e01 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -4,19 +4,9 @@
LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
LIB= archive
-DPADD= ${LIBZ}
-LDADD= -lz
-DPADD+= ${LIBBZ2}
-LDADD+= -lbz2
-CFLAGS+= -DHAVE_BZLIB_H=1
-
-DPADD+= ${LIBLZMA}
-LDADD+= -llzma
-CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
-
-DPADD+= ${LIBBSDXML}
-LDADD+= -lbsdxml
+LIBADD= z bz2 lzma bsdxml
+CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
# FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system.
# It has no real relation to the libarchive version number.
@@ -27,11 +17,9 @@ CFLAGS+= -I${.OBJDIR}
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DWITH_OPENSSL
-DPADD+= ${LIBCRYPTO}
-LDADD+= -lcrypto
+LIBADD+= crypto
.else
-DPADD+= ${LIBMD}
-LDADD+= -lmd
+LIBADD+= md
.endif
.if ${MK_ICONV} != "no"
diff --git a/lib/libarchive/test/Makefile b/lib/libarchive/test/Makefile
index 16a485ae2c44..80d6dd4a03ff 100644
--- a/lib/libarchive/test/Makefile
+++ b/lib/libarchive/test/Makefile
@@ -6,9 +6,8 @@ MAN=
PROG=libarchive_test
INTERNALPROG=yes # Don't install this; it's just for testing
-DPADD=${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBCRYPTO} ${LIBBSDXML}
LDADD= -L ${.OBJDIR}/.. -larchive
-LDADD+= -lz -lbz2 -llzma -lmd -lcrypto -lbsdxml
+LIBADD= z bz2 lzma md crypto bsdxml
CFLAGS+= -g
CFLAGS+= -I${.CURDIR}/.. -I${.OBJDIR}
CFLAGS+= -I${LIBARCHIVEDIR}/libarchive -I${LIBARCHIVEDIR}/test_utils
diff --git a/lib/libbsnmp/libbsnmp/Makefile b/lib/libbsnmp/libbsnmp/Makefile
index 0b9087d6540c..cc294cf57eee 100644
--- a/lib/libbsnmp/libbsnmp/Makefile
+++ b/lib/libbsnmp/libbsnmp/Makefile
@@ -15,8 +15,7 @@ CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DQUADFMT='"llu"' -DQUADXFMT='"llx"'
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DHAVE_LIBCRYPTO
-DPADD+= ${LIBCRYPTO}
-LDADD+= -lcrypto
+LIBADD= crypto
.endif
SRCS= asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c
diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile
index e55cf55a5d8f..4a849b042d07 100644
--- a/lib/libc++/Makefile
+++ b/lib/libc++/Makefile
@@ -62,8 +62,7 @@ CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT
CXXFLAGS+= -std=c++11
.endif
-DPADD= ${LIBCXXRT}
-LDADD= -lcxxrt
+LIBADD+= cxxrt
LDFLAGS+= --verbose
INCSGROUPS= STD EXP EXT
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index a535edfedf28..9853d4b707c3 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -44,13 +44,11 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
#
# Link with static libcompiler_rt.a.
#
-DPADD+= ${LIBCOMPILER_RT}
LDFLAGS+= -nodefaultlibs
-LDADD+= -lcompiler_rt
+LIBADD+= compiler_rt
.if ${MK_SSP} != "no"
-DPADD+= ${LIBSSP_NONSHARED}
-LDADD+= -lssp_nonshared
+LIBADD+= ssp_nonshared
.endif
# Extras that live in either libc.a or libc_nonshared.a
diff --git a/lib/libcam/Makefile b/lib/libcam/Makefile
index 1621fe62cf16..c44836947d51 100644
--- a/lib/libcam/Makefile
+++ b/lib/libcam/Makefile
@@ -6,8 +6,7 @@ SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \
ata_all.c smp_all.c
INCS= camlib.h
-DPADD= ${LIBSBUF}
-LDADD= -lsbuf
+LIBADD= sbuf
MAN= cam.3 cam_cdbparse.3
diff --git a/lib/libcapsicum/Makefile b/lib/libcapsicum/Makefile
index 061edfcb9067..6ee5bb83eada 100644
--- a/lib/libcapsicum/Makefile
+++ b/lib/libcapsicum/Makefile
@@ -21,8 +21,7 @@ INCS+= libcapsicum_random.h
INCS+= libcapsicum_service.h
INCS+= libcapsicum_sysctl.h
-DPADD= ${LIBNV}
-LDADD= -lnv
+LIBADD= nv
CFLAGS+=-I${.CURDIR}
CFLAGS+=-I${.CURDIR}/../libnv
diff --git a/lib/libcasper/Makefile b/lib/libcasper/Makefile
index ddcfba5131b1..e57accdf94a3 100644
--- a/lib/libcasper/Makefile
+++ b/lib/libcasper/Makefile
@@ -8,8 +8,7 @@ SHLIBDIR?= /lib
SRCS= libcasper.c
INCS= libcasper.h
-DPADD= ${LIBCAPSICUM} ${LIBNV} ${LIBPJDLOG}
-LDADD= -lcapsicum -lnv -lpjdlog
+LIBADD= capsicum nv pjdlog
CFLAGS+=-I${.CURDIR}
CFLAGS+=-I${.CURDIR}/../libpjdlog
diff --git a/lib/libcrypt/tests/Makefile b/lib/libcrypt/tests/Makefile
index 20993e27f3d1..6f98b53a3437 100644
--- a/lib/libcrypt/tests/Makefile
+++ b/lib/libcrypt/tests/Makefile
@@ -7,7 +7,6 @@ TESTSDIR= ${TESTSBASE}/lib/libcrypt
ATF_TESTS_C= crypt_tests
CFLAGS+= -I${.CURDIR:H}
-DPADD+= ${LIBCRYPT}
-LDADD+= -lcrypt
+LIBADD= crypt
.include <bsd.test.mk>
diff --git a/lib/libcuse/Makefile b/lib/libcuse/Makefile
index 2d1ded51a07e..a232fa241c62 100644
--- a/lib/libcuse/Makefile
+++ b/lib/libcuse/Makefile
@@ -30,14 +30,12 @@ SHLIB_MINOR= 0
SRCS= cuse_lib.c
INCS= cuse.h
MAN= cuse.3
-PTHREAD_LIBS?= -lpthread
CFLAGS+= -D_GNU_SOURCE
.if defined(HAVE_DEBUG)
CFLAGS+= -g
CFLAGS+= -DHAVE_DEBUG
.endif
-DPADD+= ${LIBPTHREAD}
-LDADD+= ${PTHREAD_LIBS}
+LIBADD= pthread
MLINKS=
MLINKS+= cuse.3 cuse_alloc_unit_number.3
diff --git a/lib/libdevstat/Makefile b/lib/libdevstat/Makefile
index aeb07b9f0647..dcda3c2bdac8 100644
--- a/lib/libdevstat/Makefile
+++ b/lib/libdevstat/Makefile
@@ -7,8 +7,7 @@ SHLIB_MAJOR= 7
SRCS= devstat.c
INCS= devstat.h
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD= kvm
MAN= devstat.3
diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile
index 8096cc92c8ec..f2dc481057e5 100644
--- a/lib/libdpv/Makefile
+++ b/lib/libdpv/Makefile
@@ -6,8 +6,7 @@ INCS= dpv.h
MAN= dpv.3
MLINKS= dpv.3 dpv_free.3
-DPADD= ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL}
-LDADD= -ldialog -lfigpar -lncursesw -lutil
+LIBADD= dialog figpar util ncursesw
SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c
diff --git a/lib/libdwarf/Makefile b/lib/libdwarf/Makefile
index 9d4df830ff07..890e215a9a84 100644
--- a/lib/libdwarf/Makefile
+++ b/lib/libdwarf/Makefile
@@ -96,8 +96,7 @@ sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET}
mkdir -p ${.OBJDIR}/sys
ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET}
-LDADD+= -lelf
-DPADD+= ${LIBELF}
+LIBADD+= elf
SHLIB_MAJOR= 4
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile
index df86778c5778..6e60a724e198 100644
--- a/lib/libedit/Makefile
+++ b/lib/libedit/Makefile
@@ -10,8 +10,7 @@ OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
hist.c key.c map.c \
parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
-DPADD= ${LIBNCURSESW}
-LDADD= -lncursesw
+LIBADD= ncursesw
MAN= editline.3 editrc.5
diff --git a/lib/libexecinfo/Makefile b/lib/libexecinfo/Makefile
index 81fa82a44a59..5f9aac5e5c21 100644
--- a/lib/libexecinfo/Makefile
+++ b/lib/libexecinfo/Makefile
@@ -10,8 +10,7 @@ SHLIB_MAJOR= 1
INCS= execinfo.h
SRCS= backtrace.c symtab.c unwind.c
-DPADD= ${LIBELF}
-LDADD= -lelf
+LIBADD= elf
MAN= backtrace.3
diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile
index cef5f5a43c18..4f56552801cf 100644
--- a/lib/libfetch/Makefile
+++ b/lib/libfetch/Makefile
@@ -16,11 +16,9 @@ CFLAGS+= -DINET6
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DWITH_SSL
-DPADD= ${LIBSSL} ${LIBCRYPTO}
-LDADD= -lssl -lcrypto
+LIBADD+= ssl crypto
.else
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD+= md
.endif
CFLAGS+= -DFTP_COMBINE_CWDS
diff --git a/lib/libgeom/Makefile b/lib/libgeom/Makefile
index b19faf6198ec..20b7a4c7c3b8 100644
--- a/lib/libgeom/Makefile
+++ b/lib/libgeom/Makefile
@@ -13,8 +13,7 @@ CFLAGS += -I${.CURDIR}
WARNS?= 3
-DPADD= ${LIBBSDXML} ${LIBSBUF}
-LDADD= -lbsdxml -lsbuf
+LIBADD+= bsdxml sbuf
MAN= libgeom.3
diff --git a/lib/libldns/Makefile b/lib/libldns/Makefile
index db4b989506fb..9a436cdb4b9d 100644
--- a/lib/libldns/Makefile
+++ b/lib/libldns/Makefile
@@ -18,8 +18,7 @@ SRCS= buffer.c dane.c dname.c dnssec.c dnssec_sign.c dnssec_verify.c \
SRCS+= b64_ntop.c b64_pton.c
-DPADD+= ${LIBCRYPTO}
-LDADD+= -lcrypto
+LIBADD= crypto
WARNS ?= 3
diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile
index 14f17028e07d..2add1d3c27b5 100644
--- a/lib/libmagic/Makefile
+++ b/lib/libmagic/Makefile
@@ -7,8 +7,7 @@ CONTRDIR= ${.CURDIR}/../../contrib/file
LIB= magic
SHLIB_MAJOR= 4
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD= z
MAN= libmagic.3 magic.5
SRCS= apprentice.c apptype.c ascmagic.c cdf.c cdf_time.c compress.c \
diff --git a/lib/libmemstat/Makefile b/lib/libmemstat/Makefile
index d26108566a0d..597dc6db1606 100644
--- a/lib/libmemstat/Makefile
+++ b/lib/libmemstat/Makefile
@@ -3,8 +3,7 @@
WARNS?= 3
LIB= memstat
SHLIB_MAJOR= 3
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD+= kvm
SRCS+= memstat.c
SRCS+= memstat_all.c
SRCS+= memstat_malloc.c
diff --git a/lib/libmp/Makefile b/lib/libmp/Makefile
index 5d0e7a702c55..6a73658103e5 100644
--- a/lib/libmp/Makefile
+++ b/lib/libmp/Makefile
@@ -4,8 +4,7 @@
LIB= mp
SHLIB_MAJOR= 7
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+LIBADD= crypto
MAN= libmp.3
INCS= mp.h
SRCS= mpasbn.c
diff --git a/lib/libmp/tests/Makefile b/lib/libmp/tests/Makefile
index 0f591eb3ea42..e74e80640e20 100644
--- a/lib/libmp/tests/Makefile
+++ b/lib/libmp/tests/Makefile
@@ -4,7 +4,6 @@ TESTSDIR= ${TESTSBASE}/lib/libmp
TAP_TESTS_C+= legacy_test
-DPADD+= ${LIBCRYPTO} ${LIBMP}
-LDADD+= -lcrypto -lmp
+LIBADD+= mp
.include <bsd.test.mk>
diff --git a/lib/libnv/tests/Makefile b/lib/libnv/tests/Makefile
index df1054960cd2..6fe0c773c4e5 100644
--- a/lib/libnv/tests/Makefile
+++ b/lib/libnv/tests/Makefile
@@ -9,8 +9,7 @@ TAP_TESTS_C+= nvlist_get_test
TAP_TESTS_C+= nvlist_move_test
TAP_TESTS_C+= nvlist_send_recv_test
-DPADD+= ${LIBNV}
-LDADD+= -lnv
+LIBADD+= nv
WARNS?= 6
diff --git a/lib/libopie/Makefile b/lib/libopie/Makefile
index e47e16d189ab..e66e67a4f9e8 100644
--- a/lib/libopie/Makefile
+++ b/lib/libopie/Makefile
@@ -27,8 +27,7 @@ CFLAGS+= -DINSECURE_OVERRIDE -DPATH_ACCESS_FILE=${ACCESSFILE}
WARNS?= 0
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD= md
MAN= ${OPIE_DIST}/opie.4 ${OPIE_DIST}/opiekeys.5 ${OPIE_DIST}/opieaccess.5
diff --git a/lib/libpam/modules/Makefile.inc b/lib/libpam/modules/Makefile.inc
index 085ab58475d2..2da5a7b524ad 100644
--- a/lib/libpam/modules/Makefile.inc
+++ b/lib/libpam/modules/Makefile.inc
@@ -14,8 +14,7 @@ CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam
NO_PIC=
.else
SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR}
-DPADD+= ${LIBPAM}
-LDADD+= -lpam
+LIBADD+= pam
.endif
.include "../Makefile.inc"
diff --git a/lib/libpam/modules/pam_krb5/Makefile b/lib/libpam/modules/pam_krb5/Makefile
index 85f3421a1ee8..97fd49092298 100644
--- a/lib/libpam/modules/pam_krb5/Makefile
+++ b/lib/libpam/modules/pam_krb5/Makefile
@@ -32,7 +32,6 @@ CFLAGS+=-D_FREEFALL_CONFIG
WARNS?= 3
.endif
-DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO}
-LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
+LIBADD+= krb5
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_ksu/Makefile b/lib/libpam/modules/pam_ksu/Makefile
index 9aa6a7e57791..26f3f850daaa 100644
--- a/lib/libpam/modules/pam_ksu/Makefile
+++ b/lib/libpam/modules/pam_ksu/Makefile
@@ -28,7 +28,6 @@ LIB= pam_ksu
SRCS= pam_ksu.c
MAN= pam_ksu.8
-DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO}
-LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
+LIBADD+= krb5
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_nologin/Makefile b/lib/libpam/modules/pam_nologin/Makefile
index ba5a7d4aa770..746e9e8882ee 100644
--- a/lib/libpam/modules/pam_nologin/Makefile
+++ b/lib/libpam/modules/pam_nologin/Makefile
@@ -28,7 +28,6 @@ LIB= pam_nologin
SRCS= pam_nologin.c
MAN= pam_nologin.8
-DPADD= ${LIBUTIL}
-LDADD= -lutil
+LIBADD+= util
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_opie/Makefile b/lib/libpam/modules/pam_opie/Makefile
index fbc12788e9ca..c2074bf3cbf3 100644
--- a/lib/libpam/modules/pam_opie/Makefile
+++ b/lib/libpam/modules/pam_opie/Makefile
@@ -29,7 +29,6 @@ LIB= pam_opie
SRCS= pam_opie.c
MAN= pam_opie.8
-DPADD= ${LIBOPIE}
-LDADD= -lopie
+LIBADD+= opie
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_opieaccess/Makefile b/lib/libpam/modules/pam_opieaccess/Makefile
index 1554a882ba30..2e764cd43a5b 100644
--- a/lib/libpam/modules/pam_opieaccess/Makefile
+++ b/lib/libpam/modules/pam_opieaccess/Makefile
@@ -4,7 +4,6 @@ LIB= pam_opieaccess
SRCS= ${LIB}.c
MAN= pam_opieaccess.8
-DPADD= ${LIBOPIE}
-LDADD= -lopie
+LIBADD+= opie
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_passwdqc/Makefile b/lib/libpam/modules/pam_passwdqc/Makefile
index c9cc30e52342..cd2364289883 100644
--- a/lib/libpam/modules/pam_passwdqc/Makefile
+++ b/lib/libpam/modules/pam_passwdqc/Makefile
@@ -10,8 +10,7 @@ MAN= pam_passwdqc.8
WARNS?= 2
CFLAGS+= -I${SRCDIR}
-DPADD= ${LIBCRYPT}
-LDADD= -lcrypt
+LIBADD+= crypt
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_radius/Makefile b/lib/libpam/modules/pam_radius/Makefile
index 2fac8334e20e..a9a93e2ab2b5 100644
--- a/lib/libpam/modules/pam_radius/Makefile
+++ b/lib/libpam/modules/pam_radius/Makefile
@@ -29,7 +29,6 @@ SRCS= pam_radius.c
MAN= pam_radius.8
WARNS?= 3
-DPADD= ${LIBRADIUS}
-LDADD= -lradius
+LIBADD+= radius
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_ssh/Makefile b/lib/libpam/modules/pam_ssh/Makefile
index 5643f321345d..b5ca478561dc 100644
--- a/lib/libpam/modules/pam_ssh/Makefile
+++ b/lib/libpam/modules/pam_ssh/Makefile
@@ -13,9 +13,7 @@ SRCS+= roaming_dummy.c
WARNS?= 3
CFLAGS+= -I${SSHDIR} -include ssh_namespace.h
-DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT}
-LDADD= ${LDSSH} -lcrypto -lcrypt
-USEPRIVATELIB= ssh
+LIBADD= ssh
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_tacplus/Makefile b/lib/libpam/modules/pam_tacplus/Makefile
index 053812ac5178..5d2a3f34a4d0 100644
--- a/lib/libpam/modules/pam_tacplus/Makefile
+++ b/lib/libpam/modules/pam_tacplus/Makefile
@@ -28,7 +28,6 @@ LIB= pam_tacplus
SRCS= pam_tacplus.c
MAN= pam_tacplus.8
-DPADD= ${LIBTACPLUS}
-LDADD= -ltacplus
+LIBADD+= tacplus
.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_unix/Makefile b/lib/libpam/modules/pam_unix/Makefile
index ea9e639c3b5f..5330ae4a5f98 100644
--- a/lib/libpam/modules/pam_unix/Makefile
+++ b/lib/libpam/modules/pam_unix/Makefile
@@ -41,13 +41,11 @@ LIB= pam_unix
SRCS= pam_unix.c
MAN= pam_unix.8
-DPADD+= ${LIBUTIL} ${LIBCRYPT}
-LDADD+= -lutil -lcrypt
+LIBADD+= util crypt
.if ${MK_NIS} != "no"
CFLAGS+= -DYP
-DPADD+= ${LIBYPCLNT}
-LDADD+= -lypclnt
+LIBADD+= ypclnt
.endif
.include <bsd.lib.mk>
diff --git a/lib/libpjdlog/Makefile b/lib/libpjdlog/Makefile
index a80b6298eda5..e44f53b489fa 100644
--- a/lib/libpjdlog/Makefile
+++ b/lib/libpjdlog/Makefile
@@ -13,8 +13,7 @@ SHLIB_MAJOR= 0
CFLAGS+=-I${.CURDIR}
-DPADD= ${LIBUTIL}
-LDADD= -lutil
+LIBADD= util
WARNS?= 6
diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile
index 8a0f4b2a702c..96465702c991 100644
--- a/lib/libproc/Makefile
+++ b/lib/libproc/Makefile
@@ -18,16 +18,13 @@ CFLAGS+= -I${.CURDIR}
.if ${MK_CXX} == "no"
CFLAGS+= -DNO_CXA_DEMANGLE
.elif ${MK_LIBCPLUSPLUS} != "no"
-LDADD+= -lcxxrt
-DPADD+= ${LIBCXXRT}
+LIBADD+= cxxrt
.else
-LDADD+= -lsupc++
-DPADD+= ${LIBSTDCPLUSPLUS}
+LIBADD+= supcplusplus
.endif
.if ${MK_CDDL} != "no"
-LDADD+= -lctf
-DPADD+= ${LIBCTF}
+LIBADD+= ctf
IGNORE_PRAGMA= YES
CFLAGS+= -I${.CURDIR}/../../cddl/contrib/opensolaris/lib/libctf/common \
-I${.CURDIR}/../../sys/cddl/contrib/opensolaris/uts/common \
diff --git a/lib/libprocstat/Makefile b/lib/libprocstat/Makefile
index 32c7daa0b19c..ff9146b4ef38 100644
--- a/lib/libprocstat/Makefile
+++ b/lib/libprocstat/Makefile
@@ -19,8 +19,7 @@ INCS= libprocstat.h
CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE
SHLIB_MAJOR= 1
-DPADD= ${LIBELF} ${LIBKVM} ${LIBUTIL}
-LDADD= -lelf -lkvm -lutil
+LIBADD= elf kvm util
MAN= libprocstat.3
diff --git a/lib/libradius/Makefile b/lib/libradius/Makefile
index 2b769d9ee61d..42f5def20ef1 100644
--- a/lib/libradius/Makefile
+++ b/lib/libradius/Makefile
@@ -70,13 +70,11 @@ MLINKS+=libradius.3 rad_acct_open.3 \
WARNS?= 3
-.if ${MK_OPENSSL} == "no"
-DPADD= ${LIBMD}
-LDADD= -lmd
-.else
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+.if ${MK_OPENSSL} != "no"
+LIBADD+= crypto
CFLAGS+= -DWITH_SSL
+.else
+LIBADD+= md
.endif
.include <bsd.lib.mk>
diff --git a/lib/librpcsec_gss/Makefile b/lib/librpcsec_gss/Makefile
index 67a79635cc0d..c3e768445004 100644
--- a/lib/librpcsec_gss/Makefile
+++ b/lib/librpcsec_gss/Makefile
@@ -5,8 +5,7 @@ SHLIB_MAJOR= 1
SRCS+= rpcsec_gss.c rpcsec_gss_prot.c rpcsec_gss_conf.c rpcsec_gss_misc.c \
svc_rpcsec_gss.c
-DPADD+= ${LIBGSSAPI}
-LDADD+= -lgssapi
+LIBADD= gssapi
VERSION_DEF= ${.CURDIR}/../libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
diff --git a/lib/librt/Makefile b/lib/librt/Makefile
index bd6ec0717d91..36296101a6f7 100644
--- a/lib/librt/Makefile
+++ b/lib/librt/Makefile
@@ -9,8 +9,7 @@ CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}
CFLAGS+=-fexceptions
.endif
CFLAGS+=-Winline -Wall
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
WARNS?= 2
diff --git a/lib/librt/tests/Makefile b/lib/librt/tests/Makefile
index 224f52ea85aa..95c525997e3b 100644
--- a/lib/librt/tests/Makefile
+++ b/lib/librt/tests/Makefile
@@ -6,8 +6,7 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/librt
TESTSDIR= ${TESTSBASE}/lib/librt
-DPADD+= ${LIBRT}
-LDADD+= -lrt
+LIBADD= rt
NETBSD_ATF_TESTS_C= sched_test
NETBSD_ATF_TESTS_C+= sem_test
diff --git a/lib/libsmb/Makefile b/lib/libsmb/Makefile
index ea7327b3e94c..b63754bd982a 100644
--- a/lib/libsmb/Makefile
+++ b/lib/libsmb/Makefile
@@ -7,8 +7,7 @@ CONTRIBDIR= ${.CURDIR}/../../contrib/smbfs
LIB= smb
SHLIB_MAJOR= 4
-DPADD= ${LIBKICONV}
-LDADD= -lkiconv
+LIBADD= kiconv
SRCS= rcfile.c ctx.c cfopt.c subr.c nls.c rap.c mbuf.c rq.c file.c \
print.c \
diff --git a/lib/libsqlite3/Makefile b/lib/libsqlite3/Makefile
index 78ee86d1ab83..65b1a28b5be6 100644
--- a/lib/libsqlite3/Makefile
+++ b/lib/libsqlite3/Makefile
@@ -3,6 +3,7 @@
PRIVATELIB= yes
LIB= sqlite3
SHLIB_MAJOR?= 0
+LIBADD+= pthreads
SRCS= sqlite3.c
diff --git a/lib/libstdthreads/Makefile b/lib/libstdthreads/Makefile
index 544eeb0f12f1..8daee58b0e87 100644
--- a/lib/libstdthreads/Makefile
+++ b/lib/libstdthreads/Makefile
@@ -32,8 +32,7 @@ MLINKS= thrd_create.3 call_once.3 \
thrd_create.3 tss_get.3 \
thrd_create.3 tss_set.3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
VERSION_DEF= ${.CURDIR}/../libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
diff --git a/lib/libtacplus/Makefile b/lib/libtacplus/Makefile
index 798c94978a78..01345e175a6b 100644
--- a/lib/libtacplus/Makefile
+++ b/lib/libtacplus/Makefile
@@ -28,8 +28,7 @@ LIB= tacplus
SRCS= taclib.c
INCS= taclib.h
CFLAGS+= -Wall
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD= md
SHLIB_MAJOR= 5
MAN= libtacplus.3 tacplus.conf.5
diff --git a/lib/libulog/Makefile b/lib/libulog/Makefile
index efbaece8fefb..fedd114efb9e 100644
--- a/lib/libulog/Makefile
+++ b/lib/libulog/Makefile
@@ -19,8 +19,7 @@ MLINKS+=ulog_login.3 ulog_login_pseudo.3 \
utempter_remove_added_record.3 removeFromUtmp.3 \
utempter_remove_record.3 removeLineFromUtmp.3
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD= md
VERSION_DEF= ${.CURDIR}/../libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
diff --git a/lib/libunbound/Makefile b/lib/libunbound/Makefile
index aca30237ad1e..e05d214a22b7 100644
--- a/lib/libunbound/Makefile
+++ b/lib/libunbound/Makefile
@@ -28,8 +28,7 @@ SRCS= alloc.c autotrust.c config_file.c configlexer.l configparser.y \
WARNS?= 3
-DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBPTHREAD}
-LDADD+= -lssl -lcrypto -lpthread
+LIBADD= ssl crypto pthread
# Misnamed file in upstream source
configlexer.l: configlexer.lex
diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile
index 1ef85d4b6f50..24d97fd63aac 100644
--- a/lib/libusb/Makefile
+++ b/lib/libusb/Makefile
@@ -19,8 +19,7 @@ PTHREAD_LIBS?= -lpthread
WARNS?= 2
-DPADD= ${LIBPTHREAD}
-LDADD= ${PTHREAD_LIBS}
+LIBADD= pthread
MLINKS+= libusb.3 usb.3
diff --git a/lib/libutil/tests/Makefile b/lib/libutil/tests/Makefile
index 31b6c54063c6..36eb2ae55d37 100644
--- a/lib/libutil/tests/Makefile
+++ b/lib/libutil/tests/Makefile
@@ -9,7 +9,6 @@ TAP_TESTS_C+= pidfile_test
TAP_TESTS_C+= trimdomain_test
TAP_TESTS_C+= trimdomain-nodomain_test
-DPADD+= ${LIBUTIL}
-LDADD+= -lutil
+LIBADD+= util
.include <bsd.test.mk>
diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile
index 4261e4865b52..cb06868958ab 100644
--- a/lib/msun/tests/Makefile
+++ b/lib/msun/tests/Makefile
@@ -41,8 +41,7 @@ NETBSD_ATF_TESTS_C+= tanh_test
CSTD= c99
-LDADD+= -lm
-DPADD+= ${LIBM}
+LIBADD+= m
#COPTS+= -Wfloat-equal
# Copied from lib/msun/Makefile
diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile
index dd903b05c626..beefb2c4a7d2 100644
--- a/lib/ncurses/form/Makefile
+++ b/lib/ncurses/form/Makefile
@@ -54,8 +54,7 @@ CLEANFILES= ncurses_def.h
CFLAGS+= -I${SRCDIR}
CFLAGS+= -I${NCURSES_DIR}/menu
-DPADD= ${LIBNCURSES${LIB_SUFFIX:tu}}
-LDADD= -lncurses${LIB_SUFFIX}
+LIBADD+= ncurses${LIB_SUFFIX}
.if defined(ENABLE_WIDEC)
INCS= form.h
diff --git a/lib/ncurses/menu/Makefile b/lib/ncurses/menu/Makefile
index 3aac08170623..d3890de73e36 100644
--- a/lib/ncurses/menu/Makefile
+++ b/lib/ncurses/menu/Makefile
@@ -40,8 +40,7 @@ CLEANFILES= ncurses_def.h
CFLAGS+= -I${SRCDIR}
-DPADD= ${LIBNCURSES${LIB_SUFFIX:tu}}
-LDADD= -lncurses${LIB_SUFFIX}
+LIBADD+= ncurses${LIB_SUFFIX}
.if defined(ENABLE_WIDEC)
INCS= menu.h eti.h
diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile
index 7929aed4d025..b075bcf056af 100644
--- a/lib/ncurses/panel/Makefile
+++ b/lib/ncurses/panel/Makefile
@@ -29,8 +29,7 @@ CLEANFILES= ncurses_def.h
CFLAGS+= -I${SRCDIR}
-DPADD= ${LIBNCURSES${LIB_SUFFIX:tu}}
-LDADD= -lncurses${LIB_SUFFIX}
+LIBADD+= ncurses${LIB_SUFFIX}
.if defined(ENABLE_WIDEC)
INCS= panel.h