summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-12-04 03:17:47 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-12-04 03:17:47 +0000
commitbb97a3d43c2b7f2a5b4f05069e3bb12383a9e20d (patch)
treec7b391aae2de6c3508dafaaad65c558a94b98ab7
parentb4e7db0cc3b11e52de66259e19d2bf84d0bfb9c2 (diff)
downloadFreeBSD-src-bb97a3d43c2b7f2a5b4f05069e3bb12383a9e20d.zip
FreeBSD-src-bb97a3d43c2b7f2a5b4f05069e3bb12383a9e20d.tar.gz
Fix LDADD/DPADD that should be LIBADD.
Sponsored by: EMC / Isilon Storage Division
-rw-r--r--cddl/lib/libctf/Makefile4
-rw-r--r--cddl/lib/libzfs/Makefile8
-rw-r--r--cddl/lib/libzfs_core/Makefile3
-rw-r--r--cddl/lib/libzpool/Makefile4
-rw-r--r--cddl/sbin/zfs/Makefile4
-rw-r--r--cddl/sbin/zpool/Makefile4
-rw-r--r--cddl/usr.bin/zinject/Makefile4
-rw-r--r--cddl/usr.bin/zstreamdump/Makefile4
-rw-r--r--cddl/usr.bin/ztest/Makefile5
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/proc/Makefile3
-rwxr-xr-xcddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh3
-rw-r--r--cddl/usr.sbin/zdb/Makefile4
-rw-r--r--cddl/usr.sbin/zhack/Makefile4
-rw-r--r--contrib/ofed/usr.bin/osmtest/Makefile3
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile6
-rw-r--r--gnu/usr.bin/groff/src/devices/grodvi/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grohtml/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grolbp/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grolj4/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grops/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grotty/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/grn/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/pic/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/refer/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/tbl/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/roff/groff/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/roff/troff/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/hpftodit/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/indxbib/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/lkbib/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/lookbib/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/tfmtodit/Makefile5
-rw-r--r--lib/libc/tests/gen/Makefile18
-rw-r--r--lib/libc/tests/hash/Makefile6
-rw-r--r--lib/libc/tests/net/Makefile3
-rw-r--r--lib/libc/tests/regex/Makefile3
-rw-r--r--lib/libc/tests/rpc/Makefile3
-rw-r--r--lib/libc/tests/setjmp/Makefile3
-rw-r--r--lib/libc/tests/ssp/Makefile3
-rw-r--r--lib/libc/tests/stdio/Makefile7
-rw-r--r--lib/libc/tests/stdlib/Makefile6
-rw-r--r--lib/libc/tests/string/Makefile7
-rw-r--r--lib/libc/tests/sys/Makefile6
-rw-r--r--lib/libc/tests/tls/Makefile11
-rw-r--r--lib/libc/tests/ttyio/Makefile3
-rw-r--r--lib/libproc/tests/Makefile3
-rw-r--r--lib/libthr/tests/Makefile9
-rw-r--r--lib/libthr/tests/dlopen/Makefile3
-rw-r--r--lib/libthr/tests/dlopen/dso/Makefile3
-rw-r--r--libexec/rtld-elf/tests/libpythagoras/Makefile3
-rw-r--r--sbin/dhclient/tests/Makefile3
-rw-r--r--share/mk/netbsd-tests.test.mk3
-rw-r--r--sys/dev/aic7xxx/aicasm/Makefile3
-rw-r--r--sys/dev/patm/genrtab/Makefile3
-rw-r--r--tests/sys/aio/Makefile3
-rw-r--r--tests/sys/file/Makefile9
-rw-r--r--tests/sys/kern/Makefile7
-rw-r--r--tests/sys/mqueue/Makefile3
-rw-r--r--tools/diag/dumpvfscache/Makefile3
-rw-r--r--tools/regression/gaithrstress/Makefile3
-rw-r--r--tools/regression/geom/ConfCmp/Makefile3
-rw-r--r--tools/regression/geom/MdLoad/Makefile3
-rw-r--r--tools/regression/kgssapi/Makefile3
-rw-r--r--tools/regression/lib/libc/resolv/Makefile3
-rw-r--r--tools/regression/mac/mac_bsdextended/Makefile3
-rw-r--r--tools/regression/posixsem/Makefile3
-rw-r--r--tools/regression/priv/Makefile3
-rw-r--r--tools/regression/pthread/cv_cancel1/Makefile3
-rw-r--r--tools/regression/pthread/mutex_isowned_np/Makefile3
-rw-r--r--tools/regression/rpcsec_gss/Makefile3
-rw-r--r--tools/regression/sockets/sendfile/Makefile3
-rw-r--r--tools/regression/tls/ttls2/Makefile3
-rw-r--r--tools/regression/tls/ttls4/Makefile3
-rw-r--r--tools/tools/ath/athratestats/Makefile2
-rw-r--r--tools/tools/atsectl/Makefile3
-rw-r--r--tools/tools/ether_reflect/Makefile3
-rw-r--r--tools/tools/ifpifa/Makefile3
-rw-r--r--tools/tools/mctest/Makefile3
-rw-r--r--tools/tools/ncpus/Makefile3
-rw-r--r--tools/tools/net80211/stumbler/Makefile3
-rw-r--r--tools/tools/net80211/wesside/dics/Makefile3
-rw-r--r--tools/tools/net80211/wesside/udps/Makefile3
-rw-r--r--tools/tools/net80211/wesside/wesside/Makefile3
-rw-r--r--tools/tools/netrate/http/Makefile3
-rw-r--r--tools/tools/netrate/httpd/Makefile3
-rw-r--r--tools/tools/netrate/juggle/Makefile3
-rw-r--r--tools/tools/tscdrift/Makefile3
-rw-r--r--tools/tools/umastat/Makefile3
-rw-r--r--tools/tools/usbtest/Makefile3
-rw-r--r--tools/tools/vimage/Makefile3
-rw-r--r--tools/tools/zfsboottest/Makefile2
-rw-r--r--usr.bin/caesar/Makefile3
-rw-r--r--usr.bin/clang/clang.prog.mk6
-rw-r--r--usr.bin/clang/clang/Makefile5
-rw-r--r--usr.bin/clang/llc/Makefile5
-rw-r--r--usr.bin/clang/lli/Makefile5
-rw-r--r--usr.bin/clang/llvm-ar/Makefile5
-rw-r--r--usr.bin/clang/llvm-cxxdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-dwarfdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-lto/Makefile5
-rw-r--r--usr.bin/clang/llvm-mc/Makefile5
-rw-r--r--usr.bin/clang/llvm-nm/Makefile5
-rw-r--r--usr.bin/clang/llvm-objdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-pdbdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-rtdyld/Makefile5
-rw-r--r--usr.bin/clang/llvm-symbolizer/Makefile5
-rw-r--r--usr.bin/clang/opt/Makefile5
-rw-r--r--usr.bin/factor/Makefile3
-rw-r--r--usr.bin/grdc/Makefile2
-rw-r--r--usr.bin/pom/Makefile3
-rw-r--r--usr.bin/primes/Makefile3
-rw-r--r--usr.sbin/fstyp/Makefile3
112 files changed, 183 insertions, 289 deletions
diff --git a/cddl/lib/libctf/Makefile b/cddl/lib/libctf/Makefile
index d8a645e..a79aef5 100644
--- a/cddl/lib/libctf/Makefile
+++ b/cddl/lib/libctf/Makefile
@@ -28,8 +28,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
-I${OPENSOLARIS_SYS_DISTDIR}/uts/common
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD+= z
.include <bsd.lib.mk>
-
diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile
index b960c9e..9af9674 100644
--- a/cddl/lib/libzfs/Makefile
+++ b/cddl/lib/libzfs/Makefile
@@ -6,13 +6,7 @@
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
LIB= zfs
-DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \
- ${LIBAVL} ${LIBZFS_CORE} ${LIBUUTIL} ${LIBBSDXML} ${LIBGEOM} \
- ${LIBNVPAIR} ${LIBZ}
-
-LDADD= -lmd -lpthread -lumem -lutil -luutil -lm -lnvpair -lavl \
- -lbsdxml -lgeom -lnvpair -lz -lzfs_core
-
+LIBADD= md pthread umem util uutil m avl bsdxml geom nvpair z zfs_core
SRCS= deviceid.c \
fsshare.c \
mkdirp.c \
diff --git a/cddl/lib/libzfs_core/Makefile b/cddl/lib/libzfs_core/Makefile
index 99ab34d..12d06d9 100644
--- a/cddl/lib/libzfs_core/Makefile
+++ b/cddl/lib/libzfs_core/Makefile
@@ -7,8 +7,7 @@
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
LIB= zfs_core
-DPADD= ${LIBNVPAIR}
-LDADD= -lnvpair
+LIBADD= nvpair
SRCS= libzfs_core.c \
libzfs_core_compat.c \
diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
index b80af04..b305315 100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@ -56,9 +56,7 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread
CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys
CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include
-DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ} ${LIBNVPAIR} \
- ${LIBAVL} ${LIBUMEM}
-LDADD= -lmd -lpthread -lz -lnvpair -lavl -lumem
+LIBADD= md pthread z nvpair avl umem
# atomic.S doesn't like profiling.
MK_PROFILE= no
diff --git a/cddl/sbin/zfs/Makefile b/cddl/sbin/zfs/Makefile
index a49d278..b1a104c 100644
--- a/cddl/sbin/zfs/Makefile
+++ b/cddl/sbin/zfs/Makefile
@@ -22,8 +22,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
-DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \
- ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
-LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
+LIBADD= geom jail nvpair umem util uutil zfs_core zfs
.include <bsd.prog.mk>
diff --git a/cddl/sbin/zpool/Makefile b/cddl/sbin/zpool/Makefile
index bfcb017..11adad2 100644
--- a/cddl/sbin/zpool/Makefile
+++ b/cddl/sbin/zpool/Makefile
@@ -27,8 +27,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common
-DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \
- ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
-LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
+LIBADD= avl geom nvpair umem util uutil zfs_core zfs
.include <bsd.prog.mk>
diff --git a/cddl/usr.bin/zinject/Makefile b/cddl/usr.bin/zinject/Makefile
index 008788b..68ca78d 100644
--- a/cddl/usr.bin/zinject/Makefile
+++ b/cddl/usr.bin/zinject/Makefile
@@ -21,8 +21,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \
- ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
-LDADD= -lgeom -lm -lnvpair -lumem -luutil -lzfs_core -lzfs -lzpool
+LIBADD= geom m nvpair umem uutil zfs_core zfs zpool
.include <bsd.prog.mk>
diff --git a/cddl/usr.bin/zstreamdump/Makefile b/cddl/usr.bin/zstreamdump/Makefile
index 304ff7c..e6b7b90 100644
--- a/cddl/usr.bin/zstreamdump/Makefile
+++ b/cddl/usr.bin/zstreamdump/Makefile
@@ -18,9 +18,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
- ${LIBPTHREAD} ${LIBZ} ${LIBAVL}
-LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl
+LIBADD= m nvpair umem zpool pthread z avl
CSTD= c99
diff --git a/cddl/usr.bin/ztest/Makefile b/cddl/usr.bin/ztest/Makefile
index 0865226..1b3430b 100644
--- a/cddl/usr.bin/ztest/Makefile
+++ b/cddl/usr.bin/ztest/Makefile
@@ -18,10 +18,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
- ${LIBPTHREAD} ${LIBAVL} ${LIBZFS_CORE} ${LIBZFS} ${LIBUUTIL}
-LDADD= -lgeom -lm -lnvpair -lumem -lzpool -lpthread -lavl -lzfs_core -lzfs \
- -luutil
+LIBADD= geom m nvpair umem zpool pthread avl zfs_core zfs uutil
CSTD= c99
diff --git a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
index 596474c..6ca6b58 100644
--- a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
@@ -24,7 +24,6 @@ CFILES= \
tst.sigwait.c \
-LDADD.tst.sigwait.exe+= -lrt
-DPADD.tst.sigwait.exe+= ${LIBRT}
+LIBADD.tst.sigwait.exe=rt
.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
index ec3ad24..fda81fb 100755
--- a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
+++ b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
@@ -36,8 +36,7 @@ genmakefile()
local special
if [ "$basedir" = proc ]; then
special="
-LDADD.tst.sigwait.exe+= -lrt
-DPADD.tst.sigwait.exe+= \${LIBRT}
+LIBADD.tst.sigwait.exe+= rt
"
elif [ "$basedir" = uctf ]; then
special="
diff --git a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile
index 0e2ec8f..4fbcaea 100644
--- a/cddl/usr.sbin/zdb/Makefile
+++ b/cddl/usr.sbin/zdb/Makefile
@@ -24,9 +24,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
- ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
-LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
+LIBADD= geom m nvpair pthread umem uutil zfs_core zfs zpool
# Since there are many asserts in this program, it makes no sense to compile
# it without debugging.
diff --git a/cddl/usr.sbin/zhack/Makefile b/cddl/usr.sbin/zhack/Makefile
index 8064cf1..c42a49e 100644
--- a/cddl/usr.sbin/zhack/Makefile
+++ b/cddl/usr.sbin/zhack/Makefile
@@ -23,9 +23,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
- ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
-LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
+LIBADD= geom m nvpair pthread umem uutil zfs_core zfs zpool
CFLAGS+= -DDEBUG=1
#DEBUG_FLAGS+= -g
diff --git a/contrib/ofed/usr.bin/osmtest/Makefile b/contrib/ofed/usr.bin/osmtest/Makefile
index fef67a0..038d1db1 100644
--- a/contrib/ofed/usr.bin/osmtest/Makefile
+++ b/contrib/ofed/usr.bin/osmtest/Makefile
@@ -22,7 +22,8 @@ LDADD= -libcommon \
-losmvendor \
-losmcomp \
-lopensm \
- -lpthread
+
+LIBADD+= pthread
CFLAGS= -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP \
-I${OPENSM}/osmtest/include
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile
index 39f4cd5..5867f7a 100644
--- a/gnu/usr.bin/gdb/kgdb/Makefile
+++ b/gnu/usr.bin/gdb/kgdb/Makefile
@@ -8,8 +8,8 @@ BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
${OBJ_BU}/libiberty/libiberty.a
GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
-DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM}
-LDADD= ${GDBLIBS} ${BULIBS} -lkvm
-LIBADD+= m readline ncursesw gnuregex
+DPADD= ${GDBLIBS} ${BULIBS}
+LDADD= ${GDBLIBS} ${BULIBS}
+LIBADD+= m readline ncursesw gnuregex kvm
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grodvi/Makefile b/gnu/usr.bin/groff/src/devices/grodvi/Makefile
index 3745440..948e9fa 100644
--- a/gnu/usr.bin/groff/src/devices/grodvi/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grodvi/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grodvi
SRCS= dvi.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grohtml/Makefile b/gnu/usr.bin/groff/src/devices/grohtml/Makefile
index 321f1c8..5b55436 100644
--- a/gnu/usr.bin/groff/src/devices/grohtml/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grohtml/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= post-grohtml
SRCS= post-html.cpp html-table.cpp html-text.cpp output.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
MAN=
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grolbp/Makefile b/gnu/usr.bin/groff/src/devices/grolbp/Makefile
index 85a41c1..23a3161 100644
--- a/gnu/usr.bin/groff/src/devices/grolbp/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grolbp/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grolbp
SRCS= lbp.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grolj4/Makefile b/gnu/usr.bin/groff/src/devices/grolj4/Makefile
index bb3f9e4..eeaeca9 100644
--- a/gnu/usr.bin/groff/src/devices/grolj4/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grolj4/Makefile
@@ -3,8 +3,9 @@
PROG_CXX= grolj4
MAN= grolj4.1 lj4_font.5
SRCS= lj4.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grops/Makefile b/gnu/usr.bin/groff/src/devices/grops/Makefile
index 4511f69..8c83acd 100644
--- a/gnu/usr.bin/groff/src/devices/grops/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grops/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grops
SRCS= ps.cpp psrm.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grotty/Makefile b/gnu/usr.bin/groff/src/devices/grotty/Makefile
index d15ee8b..c4de8f4 100644
--- a/gnu/usr.bin/groff/src/devices/grotty/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grotty/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grotty
SRCS= tty.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/preproc/grn/Makefile b/gnu/usr.bin/groff/src/preproc/grn/Makefile
index 58309d2..7f2e301 100644
--- a/gnu/usr.bin/groff/src/preproc/grn/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/grn/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grn
SRCS= hdb.cpp hpoint.cpp hgraph.cpp main.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/preproc/pic/Makefile b/gnu/usr.bin/groff/src/preproc/pic/Makefile
index 3b5939c..18a2cd91 100644
--- a/gnu/usr.bin/groff/src/preproc/pic/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/pic/Makefile
@@ -4,8 +4,9 @@ PROG_CXX= pic
SRCS= lex.cpp main.cpp object.cpp pic.cpp pic_tab.h \
common.cpp troff.cpp tex.cpp
CFLAGS+= -I${DIST_DIR} -I.
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN} pic.cpp pic_tab.h y.tab.c y.tab.h
pic_tab.h: pic.cpp
diff --git a/gnu/usr.bin/groff/src/preproc/refer/Makefile b/gnu/usr.bin/groff/src/preproc/refer/Makefile
index 8a18f6f..78fc96b 100644
--- a/gnu/usr.bin/groff/src/preproc/refer/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/refer/Makefile
@@ -3,8 +3,9 @@
PROG_CXX= refer
SRCS= command.cpp label.cpp ref.cpp refer.cpp token.cpp
CFLAGS+= -I${DIST_DIR}
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= label.cpp label_tab.h ${MAN} y.tab.c y.tab.h
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/preproc/tbl/Makefile b/gnu/usr.bin/groff/src/preproc/tbl/Makefile
index 29e7ac2..5bf1980 100644
--- a/gnu/usr.bin/groff/src/preproc/tbl/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/tbl/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= tbl
SRCS= main.cpp table.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/roff/groff/Makefile b/gnu/usr.bin/groff/src/roff/groff/Makefile
index 2ae541b..54d8010 100644
--- a/gnu/usr.bin/groff/src/roff/groff/Makefile
+++ b/gnu/usr.bin/groff/src/roff/groff/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= groff
SRCS= groff.cpp pipeline.c
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/roff/troff/Makefile b/gnu/usr.bin/groff/src/roff/troff/Makefile
index 802af2b..9108ab4 100644
--- a/gnu/usr.bin/groff/src/roff/troff/Makefile
+++ b/gnu/usr.bin/groff/src/roff/troff/Makefile
@@ -3,8 +3,9 @@
PROG_CXX= troff
SRCS= dictionary.cpp div.cpp env.cpp input.cpp \
majorminor.cpp mtsm.cpp node.cpp number.cpp reg.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= majorminor.cpp ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile
index 1376702..d3ca4f5 100644
--- a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile
+++ b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= hpftodit
SRCS= hpftodit.cpp hpuni.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/indxbib/Makefile b/gnu/usr.bin/groff/src/utils/indxbib/Makefile
index 048fed0..b9667fd 100644
--- a/gnu/usr.bin/groff/src/utils/indxbib/Makefile
+++ b/gnu/usr.bin/groff/src/utils/indxbib/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= indxbib
SRCS= indxbib.cpp signal.c
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
FILES= ${DIST_DIR}/eign
FILESDIR= ${SHAREDIR}/dict/
diff --git a/gnu/usr.bin/groff/src/utils/lkbib/Makefile b/gnu/usr.bin/groff/src/utils/lkbib/Makefile
index f30dc56..3a95268 100644
--- a/gnu/usr.bin/groff/src/utils/lkbib/Makefile
+++ b/gnu/usr.bin/groff/src/utils/lkbib/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= lkbib
SRCS= lkbib.cpp
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/lookbib/Makefile b/gnu/usr.bin/groff/src/utils/lookbib/Makefile
index 18834a7..b12f7b7 100644
--- a/gnu/usr.bin/groff/src/utils/lookbib/Makefile
+++ b/gnu/usr.bin/groff/src/utils/lookbib/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= lookbib
SRCS= lookbib.cpp
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile
index ba3bbc5..03f51bd 100644
--- a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile
+++ b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= tfmtodit
SRCS= tfmtodit.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile
index 476b5b7..b700312 100644
--- a/lib/libc/tests/gen/Makefile
+++ b/lib/libc/tests/gen/Makefile
@@ -45,20 +45,14 @@ NETBSD_ATF_TESTS_C+= vis_test
.include "../Makefile.netbsd-tests"
-LDADD.humanize_number_test+= -lutil
-DPADD.humanize_number_test+= ${LIBUTIL}
+LIBADD.humanize_number_test+= util
-LDADD.fpclassify_test+= -lm
-DPADD.fpclassify_test+= ${LIBM}
-LDADD.fpsetround_test+= -lm
-DPADD.fpsetround_test+= ${LIBM}
-LDADD.siginfo_test+= -lm
-DPADD.siginfo_test+= ${LIBM}
+LIBADD.fpclassify_test+=m
+LIBADD.fpsetround_test+=m
+LIBADD.siginfo_test+= m
-LDADD.nice_test+= -lpthread
-DPADD.nice_test+= ${LIBPTHREAD}
-LDADD.syslog_test+= -lpthread
-DPADD.syslog_test+= ${LIBPTHREAD}
+LIBADD.nice_test+= pthread
+LIBADD.syslog_test+= pthread
CFLAGS+= -I${.CURDIR}
diff --git a/lib/libc/tests/hash/Makefile b/lib/libc/tests/hash/Makefile
index 6887253..6facb5a 100644
--- a/lib/libc/tests/hash/Makefile
+++ b/lib/libc/tests/hash/Makefile
@@ -22,10 +22,8 @@ FILES+= data/sha1test-in
FILES+= data/sha1test-out
FILES+= data/sha1test2-out
-DPADD+= ${LIBMD}
-LDADD+= -lmd
-DPADD.sha2_test+= ${LIBCRYPTO}
-LDADD.sha2_test+= -lcrypto
+LIBADD+= md
+LIBADD.sha2_test+= crypto
CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh/openbsd-compat
CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh
diff --git a/lib/libc/tests/net/Makefile b/lib/libc/tests/net/Makefile
index 3e437a0..e126848 100644
--- a/lib/libc/tests/net/Makefile
+++ b/lib/libc/tests/net/Makefile
@@ -23,8 +23,7 @@ PROGS+= h_protoent
PROGS+= h_servent
PROGS+= h_dns_server
-DPADD.h_nsd_recurse+= ${LIBPTHREAD}
-LDADD.h_nsd_recurse+= -lpthread
+LIBADD.h_nsd_recurse+= pthread
CLEANFILES+= aton_ether_subr.c
aton_ether_subr.c: gen_ether_subr ${SRCTOP}/sys/net/if_ethersubr.c
diff --git a/lib/libc/tests/regex/Makefile b/lib/libc/tests/regex/Makefile
index fa60f6e..946bc44 100644
--- a/lib/libc/tests/regex/Makefile
+++ b/lib/libc/tests/regex/Makefile
@@ -51,7 +51,6 @@ CFLAGS.$t+= -I${TESTSRC} ${IMPLEMENTATION}
.include "../Makefile.netbsd-tests"
-DPADD.regex_att_test+= ${LIBUTIL}
-LDADD.regex_att_test+= -lutil
+LIBADD.regex_att_test+= util
.include <bsd.test.mk>
diff --git a/lib/libc/tests/rpc/Makefile b/lib/libc/tests/rpc/Makefile
index f9819d3..d7780ef 100644
--- a/lib/libc/tests/rpc/Makefile
+++ b/lib/libc/tests/rpc/Makefile
@@ -18,8 +18,7 @@ h_testbits_xdr.c: ${RPCSRC} h_testbits.h
CLEANFILES+= ${RPCSRC:.x=.h} ${RPCSRC:.x=.c} h_testbits_xdr.c
CFLAGS+= -I${.OBJDIR}
-LDADD+= -lrpcsvc -lutil
-DPADD+= ${LIBRPCSVC} ${LIBUTIL}
+LIBADD+= rpcsvc util
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/setjmp/Makefile b/lib/libc/tests/setjmp/Makefile
index ac962c2..39b0a96 100644
--- a/lib/libc/tests/setjmp/Makefile
+++ b/lib/libc/tests/setjmp/Makefile
@@ -3,8 +3,7 @@
NETBSD_ATF_TESTS_C= setjmp_test
NETBSD_ATF_TESTS_C+= threadjmp_test
-DPADD.threadjmp_test+= ${LIBPTHREAD}
-LDADD.threadjmp_test+= -lpthread
+LIBADD.t_threadjmp+= pthread
WARNS?= 4
diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile
index dff1578..6055251 100644
--- a/lib/libc/tests/ssp/Makefile
+++ b/lib/libc/tests/ssp/Makefile
@@ -10,8 +10,7 @@ CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector
CFLAGS.h_raw+= -fsanitize=bounds
.elif ${COMPILER_TYPE} == "gcc"
CFLAGS.h_raw+= --param ssp-buffer-size=1
-DPADD+= ${LIBSSP}
-LDADD+= -lssp
+LIBADD+= ssp
.endif
NETBSD_ATF_TESTS_SH= ssp_test
diff --git a/lib/libc/tests/stdio/Makefile b/lib/libc/tests/stdio/Makefile
index 7896422..72685e0 100644
--- a/lib/libc/tests/stdio/Makefile
+++ b/lib/libc/tests/stdio/Makefile
@@ -28,11 +28,8 @@ NETBSD_ATF_TESTS_C+= popen_test
NETBSD_ATF_TESTS_C+= printf_test
NETBSD_ATF_TESTS_C+= scanf_test
-DPADD.printfloat_test+= ${LIBM}
-LDADD.printfloat_test+= -lm
-
-DPADD.scanfloat_test+= ${LIBM}
-LDADD.scanfloat_test+= -lm
+LIBADD.printfloat_test+= m
+LIBADD.scanfloat_test+= m
.if ${COMPILER_TYPE} == "gcc"
# 90: use of assignment suppression and length modifier together in scanf format
diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile
index cd2c06e..4bc1354 100644
--- a/lib/libc/tests/stdlib/Makefile
+++ b/lib/libc/tests/stdlib/Makefile
@@ -36,11 +36,9 @@ CFLAGS+= -I${.CURDIR}
CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests
LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR}
-DPADD.$t+= ${LIBNETBSD} ${LIBUTIL}
-LDADD.$t+= -lnetbsd -lutil
+LIBADD.${t}+= netbsd util
.endfor
-DPADD.strtod_test+= ${LIBM}
-LDADD.strtod_test+= -lm
+LIBADD.strtod_test+= m
.include <bsd.test.mk>
diff --git a/lib/libc/tests/string/Makefile b/lib/libc/tests/string/Makefile
index 14044f4..9c677b7 100644
--- a/lib/libc/tests/string/Makefile
+++ b/lib/libc/tests/string/Makefile
@@ -27,10 +27,7 @@ SRCS.strerror2_test= strerror_test.c
.include "../Makefile.netbsd-tests"
-LDADD.memchr_test+= -lmd
-DPADD.memchr_test+= ${LIBMD}
-
-LDADD.memcpy_test+= -lmd
-DPADD.memcpy_test+= ${LIBMD}
+LIBADD.memchr_test+= md
+LIBADD.memcpy_test+= md
.include <bsd.test.mk>
diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile
index 816b962..efc892c 100644
--- a/lib/libc/tests/sys/Makefile
+++ b/lib/libc/tests/sys/Makefile
@@ -57,10 +57,8 @@ NETBSD_ATF_TESTS_C+= umask_test
NETBSD_ATF_TESTS_C+= unlink_test
NETBSD_ATF_TESTS_C+= write_test
-DPADD.getpid_test+= ${LIBPTHREAD}
-LDADD.getpid_test+= -lpthread
-DPADD.timer_create_test+= ${LIBRT}
-LDADD.timer_create_test+= -lrt
+LIBADD.getpid_test+= pthread
+LIBADD.timer_create_test+= rt
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/tls/Makefile b/lib/libc/tests/tls/Makefile
index b6b6719..cbf441d 100644
--- a/lib/libc/tests/tls/Makefile
+++ b/lib/libc/tests/tls/Makefile
@@ -18,17 +18,16 @@ NETBSD_ATF_TESTS_C+= tls_dynamic_test
DSODIR= ${.OBJDIR}/../tls_dso
-DPADD.tls_static_test+= ${LIBPTHREAD}
-LDADD.tls_static_test+= -lpthread
+LIBADD.tls_static_test+= pthread
LDFLAGS.tls_static_test+= -static
SRCS.tls_static_test= t_tls_static.c t_tls_static_helper.c
-DPADD.tls_dynamic_test+= ${LIBPTHREAD} ${DSODIR}/libh_tls_dynamic.so
-LDADD.tls_dynamic_test+= -lpthread -lh_tls_dynamic
+DPADD.tls_dynamic_test+= ${DSODIR}/libh_tls_dynamic.so
+LDADD.tls_dynamic_test+= -lh_tls_dynamic
LDFLAGS.tls_dynamic_test+= -Wl,-rpath,${TESTSDIR} -L${DSODIR}
+LIBADD.tls_dynamic_test+= pthread
-DPADD.tls_dlopen_test+= ${LIBPTHREAD}
-LDADD.tls_dlopen_test+= -lpthread
+LIBADD.tls_dlopen_test+= pthread
LDFLAGS.tls_dlopen_test+= -Wl,-rpath,${TESTSDIR} -Wl,-export-dynamic
.include <bsd.test.mk>
diff --git a/lib/libc/tests/ttyio/Makefile b/lib/libc/tests/ttyio/Makefile
index 242f332..d5b8f01 100644
--- a/lib/libc/tests/ttyio/Makefile
+++ b/lib/libc/tests/ttyio/Makefile
@@ -5,8 +5,7 @@
# TODO: ptm_test
NETBSD_ATF_TESTS_C= ttyio_test
-DPADD.ttyio_test+= ${LIBUTIL}
-LDADD.ttyio_test+= -lutil
+LIBADD.ttyio_test+= util
.include "../Makefile.netbsd-tests"
diff --git a/lib/libproc/tests/Makefile b/lib/libproc/tests/Makefile
index 326481d..c4a8471 100644
--- a/lib/libproc/tests/Makefile
+++ b/lib/libproc/tests/Makefile
@@ -6,8 +6,7 @@ PROGS= target_prog
SRCS_target_prog= target_prog.c
BINDIR_target_prog= ${TESTSDIR}
-LDADD+= -lelf -lproc -lrtld_db -lutil
-DPADD+= ${LIBELF} ${LIBPROC} ${LIBRTLD_DB} ${LIBUTIL}
+LIBADD= elf proc rtld_db util
# Ensure that symbols aren't stripped from the test program, as they're needed
# for testing symbol lookup.
diff --git a/lib/libthr/tests/Makefile b/lib/libthr/tests/Makefile
index a5fc85e..aeb1ef8 100644
--- a/lib/libthr/tests/Makefile
+++ b/lib/libthr/tests/Makefile
@@ -30,12 +30,9 @@ NETBSD_ATF_TESTS_SH+= cancel_test
NETBSD_ATF_TESTS_SH+= exit_test
NETBSD_ATF_TESTS_SH+= resolv_test
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
-DPADD.fpu_test+= ${LIBM}
-LDADD.fpu_test+= -lm
-DPADD.sem_test+= ${LIBRT}
-LDADD.sem_test+= -lrt
+LIBADD+= pthread
+LIBADD.fpu_test+= m
+LIBADD.sem_test+= rt
BINDIR= ${TESTSDIR}
diff --git a/lib/libthr/tests/dlopen/Makefile b/lib/libthr/tests/dlopen/Makefile
index 0893192..bea70ec 100644
--- a/lib/libthr/tests/dlopen/Makefile
+++ b/lib/libthr/tests/dlopen/Makefile
@@ -18,8 +18,7 @@ NETBSD_ATF_TESTS_C+= main_pthread_create_test
#NETBSD_ATF_TESTS_C+= dso_pthread_create_test
.for t in dlopen_test main_pthread_create_test
-DPADD.$t+= ${LIBPTHREAD}
-LDADD.$t+= -lpthread
+LIBADD.${t}+= pthread
.endfor
.endif
diff --git a/lib/libthr/tests/dlopen/dso/Makefile b/lib/libthr/tests/dlopen/dso/Makefile
index 53356876..23d4cd6 100644
--- a/lib/libthr/tests/dlopen/dso/Makefile
+++ b/lib/libthr/tests/dlopen/dso/Makefile
@@ -8,8 +8,7 @@ SHLIB_MAJOR= 1
SHLIB_NAME= h_pthread_dlopen.so.${SHLIB_MAJOR}
SRCS= h_pthread_dlopen.c
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
+LIBADD+= pthread
LIBDIR= ${TESTSBASE}/lib/libthr/dlopen
diff --git a/libexec/rtld-elf/tests/libpythagoras/Makefile b/libexec/rtld-elf/tests/libpythagoras/Makefile
index 618612f..9ad4b88 100644
--- a/libexec/rtld-elf/tests/libpythagoras/Makefile
+++ b/libexec/rtld-elf/tests/libpythagoras/Makefile
@@ -10,7 +10,6 @@ SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf
SRCS= pythagoras.c
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.lib.mk>
diff --git a/sbin/dhclient/tests/Makefile b/sbin/dhclient/tests/Makefile
index 45cc8c2..fd3df4e 100644
--- a/sbin/dhclient/tests/Makefile
+++ b/sbin/dhclient/tests/Makefile
@@ -6,8 +6,7 @@ PLAIN_TESTS_C= option-domain-search_test
SRCS.option-domain-search_test= alloc.c convert.c hash.c options.c \
tables.c fake.c option-domain-search.c
CFLAGS.option-domain-search_test+= -I${.CURDIR}/..
-DPADD.option-domain-search_test= ${LIBUTIL}
-LDADD.option-domain-search_test= -lutil
+LIBADD.option-domain-search_test= util
WARNS?= 2
diff --git a/share/mk/netbsd-tests.test.mk b/share/mk/netbsd-tests.test.mk
index 5357b08..c1c9f91 100644
--- a/share/mk/netbsd-tests.test.mk
+++ b/share/mk/netbsd-tests.test.mk
@@ -18,8 +18,7 @@ LIBNETBSD_OBJDIR= ${OBJTOP}/lib/libnetbsd
CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests
LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR}
-DPADD.$t+= ${LIBNETBSD}
-LDADD.$t+= -lnetbsd
+LIBADD.${t}+= netbsd
SRCS.$t?= ${t:C/^/t_/:C/_test$//g}.c
.endfor
diff --git a/sys/dev/aic7xxx/aicasm/Makefile b/sys/dev/aic7xxx/aicasm/Makefile
index a3adbe9..51a3a90 100644
--- a/sys/dev/aic7xxx/aicasm/Makefile
+++ b/sys/dev/aic7xxx/aicasm/Makefile
@@ -13,8 +13,7 @@ GENHDRS= aicasm_gram.h aicasm_macro_gram.h
SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS}
CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g}
-DPADD= ${LIBL}
-LDADD= -ll
+LIBADD= l
WARNS?= 0
# Correct path for kernel builds
diff --git a/sys/dev/patm/genrtab/Makefile b/sys/dev/patm/genrtab/Makefile
index 721fe0a..907b29d 100644
--- a/sys/dev/patm/genrtab/Makefile
+++ b/sys/dev/patm/genrtab/Makefile
@@ -7,7 +7,6 @@ PROG= genrtab
INTERNALPROG=
WARNS?= 5
MAN=
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.prog.mk>
diff --git a/tests/sys/aio/Makefile b/tests/sys/aio/Makefile
index 851252d..766d9b0 100644
--- a/tests/sys/aio/Makefile
+++ b/tests/sys/aio/Makefile
@@ -6,8 +6,7 @@ PLAIN_TESTS_C+= aio_kqueue_test
PLAIN_TESTS_C+= lio_kqueue_test
ATF_TESTS_C+= aio_test
-DPADD.aio_test+= ${LIBUTIL}
-LDADD.aio_test+= -lutil
+LIBADD.aio_test+= util
CFLAGS+= -I${.CURDIR:H:H}
diff --git a/tests/sys/file/Makefile b/tests/sys/file/Makefile
index 6151c9f..ed2d2c4 100644
--- a/tests/sys/file/Makefile
+++ b/tests/sys/file/Makefile
@@ -13,13 +13,10 @@ PLAIN_TESTS_C+= newfileops_on_fork_test
PROGS+= flock_helper
-DPADD.closefrom_test= ${LIBUTIL}
-LDADD.closefrom_test= -lutil
+LIBADD.closefrom_test= util
-DPADD.flock_helper= ${LIBPTHREAD}
-LDADD.flock_helper= -lpthread
+LIBADD.flock_helper= pthread
-DPADD.newfileops_on_fork_test= ${LIBPTHREAD}
-LDADD.newfileops_on_fork_test= -lpthread
+LIBADD.newfileops_on_fork_test= pthread
.include <bsd.test.mk>
diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
index b3d2453..a38b1f2 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -10,15 +10,14 @@ ATF_TESTS_C+= ptrace_test
ATF_TESTS_C+= unix_seqpacket_test
TEST_METADATA.unix_seqpacket_test+= timeout="15"
-LDADD.ptrace_test+= -lpthread
-LDADD.unix_seqpacket_test+= -lpthread
+LIBADD.ptrace_test+= pthread
+LIBADD.unix_seqpacket_test+= pthread
NETBSD_ATF_TESTS_C+= lockf_test
NETBSD_ATF_TESTS_C+= mqueue_test
CFLAGS.mqueue_test+= -I${SRCTOP}/tests
-DPADD.mqueue_test+= ${LIBRT}
-LDADD.mqueue_test+= -lrt
+LIBADD.mqueue_test+= rt
WARNS?= 5
diff --git a/tests/sys/mqueue/Makefile b/tests/sys/mqueue/Makefile
index 952cb67..ce5033c 100644
--- a/tests/sys/mqueue/Makefile
+++ b/tests/sys/mqueue/Makefile
@@ -14,8 +14,7 @@ PROGS+= mqtest2
#PROGS+= mqtest4
PROGS+= mqtest5
-LDADD+= -lrt
-DPADD+= ${LIBRT}
+LIBADD+= rt
WARNS?= 6
diff --git a/tools/diag/dumpvfscache/Makefile b/tools/diag/dumpvfscache/Makefile
index fe81d5c..3cd9c5d 100644
--- a/tools/diag/dumpvfscache/Makefile
+++ b/tools/diag/dumpvfscache/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= dumpvfscache
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD= kvm
MAN=
diff --git a/tools/regression/gaithrstress/Makefile b/tools/regression/gaithrstress/Makefile
index 187c973..9c5cdd5 100644
--- a/tools/regression/gaithrstress/Makefile
+++ b/tools/regression/gaithrstress/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= gaithrstress
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
MAN=
.include <bsd.prog.mk>
diff --git a/tools/regression/geom/ConfCmp/Makefile b/tools/regression/geom/ConfCmp/Makefile
index f550db3..c34cf65 100644
--- a/tools/regression/geom/ConfCmp/Makefile
+++ b/tools/regression/geom/ConfCmp/Makefile
@@ -12,8 +12,7 @@ CFLAGS+= -g -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -
# Uncomment for ElectricFence
#LDADD += -lefence -L/usr/local/lib
-DPADD += ${LIBBSDXML}
-LDADD += -lbsdxml
+LIBADD= bsdxml
MAN=
CLEANFILES += _*
diff --git a/tools/regression/geom/MdLoad/Makefile b/tools/regression/geom/MdLoad/Makefile
index eab3f89..4804f97 100644
--- a/tools/regression/geom/MdLoad/Makefile
+++ b/tools/regression/geom/MdLoad/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= MdLoad
-DPADD= ${LIBSBUF} ${LIBBSDXML}
-LDADD= -lsbuf -lbsdxml
+LIBADD= sbuf bsdxml
MAN=
diff --git a/tools/regression/kgssapi/Makefile b/tools/regression/kgssapi/Makefile
index 751604f..203b688 100644
--- a/tools/regression/kgssapi/Makefile
+++ b/tools/regression/kgssapi/Makefile
@@ -3,8 +3,7 @@
PROG= gsstest
MAN=
WARNS?= 2
-DPADD= ${LIBGSSAPI} ${LIBGSSAPI_KRB5}
-LDADD= -lgssapi -lgssapi_krb5
+LIBADD= gssapi gssapi_krb5
DEBUG_FLAGS= -g -O0
.include <bsd.prog.mk>
diff --git a/tools/regression/lib/libc/resolv/Makefile b/tools/regression/lib/libc/resolv/Makefile
index fa91ac3..18a71bc 100644
--- a/tools/regression/lib/libc/resolv/Makefile
+++ b/tools/regression/lib/libc/resolv/Makefile
@@ -6,8 +6,7 @@ MAN=
# Note: this test relies on being dynamically linked. You will get a
# spurious PASS for a statically linked test.
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
+LIBADD+= pthread
regress: ${PROG}
./${PROG} -r ${.CURDIR}/mach
diff --git a/tools/regression/mac/mac_bsdextended/Makefile b/tools/regression/mac/mac_bsdextended/Makefile
index 36464ba..aaa060a 100644
--- a/tools/regression/mac/mac_bsdextended/Makefile
+++ b/tools/regression/mac/mac_bsdextended/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= test_ugidfw
-DPADD= ${LIBUGIDFW}
-LDADD= -lugidfw
+LIBADD= ugidfw
MAN=
.include <bsd.prog.mk>
diff --git a/tools/regression/posixsem/Makefile b/tools/regression/posixsem/Makefile
index 3120313..5f73a72 100644
--- a/tools/regression/posixsem/Makefile
+++ b/tools/regression/posixsem/Makefile
@@ -2,8 +2,7 @@
PROG= posixsem
SRCS= posixsem.c test.c
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD= kvm
MAN=
WARNS?= 3
diff --git a/tools/regression/priv/Makefile b/tools/regression/priv/Makefile
index a1fbcc6..32a4a74 100644
--- a/tools/regression/priv/Makefile
+++ b/tools/regression/priv/Makefile
@@ -48,8 +48,7 @@ SRCS= main.c \
MAN=
WARNS?= 3
-DPADD+= ${LIBIPSEC}
-LDADD+= -lipsec
+LIBADD+= ipsec
.if ${MK_INET6_SUPPORT} != "no"
CFLAGS+= -DINET6
diff --git a/tools/regression/pthread/cv_cancel1/Makefile b/tools/regression/pthread/cv_cancel1/Makefile
index bedca56..be2ffaa 100644
--- a/tools/regression/pthread/cv_cancel1/Makefile
+++ b/tools/regression/pthread/cv_cancel1/Makefile
@@ -2,7 +2,6 @@
PROG= cv_cancel1
MAN=
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/regression/pthread/mutex_isowned_np/Makefile b/tools/regression/pthread/mutex_isowned_np/Makefile
index f7a8984..8827053 100644
--- a/tools/regression/pthread/mutex_isowned_np/Makefile
+++ b/tools/regression/pthread/mutex_isowned_np/Makefile
@@ -2,7 +2,6 @@
PROG= mutex_isowned_np
MAN=
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/regression/rpcsec_gss/Makefile b/tools/regression/rpcsec_gss/Makefile
index 5db4b79..bea9d9c 100644
--- a/tools/regression/rpcsec_gss/Makefile
+++ b/tools/regression/rpcsec_gss/Makefile
@@ -3,8 +3,7 @@
PROG= rpctest
MAN=
WARNS?= 6
-DPADD= ${LIBRPCSEC_GSS}
-LDADD= -lrpcsec_gss
+LIBADD= rpcsec_gss
DEBUG_FLAGS= -g -O0
.include <bsd.prog.mk>
diff --git a/tools/regression/sockets/sendfile/Makefile b/tools/regression/sockets/sendfile/Makefile
index 9d6f185..6e9c1ab 100644
--- a/tools/regression/sockets/sendfile/Makefile
+++ b/tools/regression/sockets/sendfile/Makefile
@@ -5,7 +5,6 @@
PROG= sendfile
MAN=
WARNS?= 6
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD= md
.include <bsd.prog.mk>
diff --git a/tools/regression/tls/ttls2/Makefile b/tools/regression/tls/ttls2/Makefile
index 643040f..cbebbe7 100644
--- a/tools/regression/tls/ttls2/Makefile
+++ b/tools/regression/tls/ttls2/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= ttls2
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
MAN=
DEBUG_FLAGS= -g
diff --git a/tools/regression/tls/ttls4/Makefile b/tools/regression/tls/ttls4/Makefile
index 2d1e501..ab6ca6f 100644
--- a/tools/regression/tls/ttls4/Makefile
+++ b/tools/regression/tls/ttls4/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= ttls4
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
MAN=
DEBUG_FLAGS= -g
diff --git a/tools/tools/ath/athratestats/Makefile b/tools/tools/ath/athratestats/Makefile
index 87cd0f8..938f0cb 100644
--- a/tools/tools/ath/athratestats/Makefile
+++ b/tools/tools/ath/athratestats/Makefile
@@ -7,7 +7,7 @@ PROG= athratestats
SRCS= main.c opt_ah.h ah_osdep.h
-LDADD+= -lcurses
+LIBADD+= curses
CLEANFILES+= opt_ah.h ah_osdep.h
diff --git a/tools/tools/atsectl/Makefile b/tools/tools/atsectl/Makefile
index 3f3a8c4..afe79a9 100644
--- a/tools/tools/atsectl/Makefile
+++ b/tools/tools/atsectl/Makefile
@@ -2,8 +2,7 @@
PROG= atsectl
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD= md
BINDIR?= /usr/sbin
diff --git a/tools/tools/ether_reflect/Makefile b/tools/tools/ether_reflect/Makefile
index 0d20f39..040a5bd 100644
--- a/tools/tools/ether_reflect/Makefile
+++ b/tools/tools/ether_reflect/Makefile
@@ -4,8 +4,7 @@
# A Makefile that builds both the ether_reflect program and its manual page.
PROG= ether_reflect
-DPADD= ${LIBPCAP}
-LDADD= -lpcap
+LIBADD= pcap
CFLAGS+=-DHAVE_SNPRINTF
.include <bsd.prog.mk>
diff --git a/tools/tools/ifpifa/Makefile b/tools/tools/ifpifa/Makefile
index 0c09ecc..d381792 100644
--- a/tools/tools/ifpifa/Makefile
+++ b/tools/tools/ifpifa/Makefile
@@ -4,7 +4,6 @@ PROG= ifpifa
MAN=
WARNS?=6
BINDIR?=/usr/local/bin
-DPADD=${LIBKVM}
-LDADD=-lkvm
+LIBADD=kvm
.include <bsd.prog.mk>
diff --git a/tools/tools/mctest/Makefile b/tools/tools/mctest/Makefile
index 6edaf89..dc583e5 100644
--- a/tools/tools/mctest/Makefile
+++ b/tools/tools/mctest/Makefile
@@ -1,7 +1,6 @@
# $FreeBSD$
PROG_CXX= mctest
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/ncpus/Makefile b/tools/tools/ncpus/Makefile
index 011f49e..b2683e1 100644
--- a/tools/tools/ncpus/Makefile
+++ b/tools/tools/ncpus/Makefile
@@ -9,7 +9,6 @@ SRCS+= biosmptable.c
BINDIR= /usr/local/bin
WARNS?= 6
-DPADD= ${LIBDEVINFO}
-LDADD= -ldevinfo
+LIBADD= devinfo
.include <bsd.prog.mk>
diff --git a/tools/tools/net80211/stumbler/Makefile b/tools/tools/net80211/stumbler/Makefile
index e7ea87c..e840be7 100644
--- a/tools/tools/net80211/stumbler/Makefile
+++ b/tools/tools/net80211/stumbler/Makefile
@@ -2,8 +2,7 @@
PROG= stumbler
BINDIR= /usr/local/bin
-DPADD= ${LIBPCAP} ${LIBNCURSESW}
-LDADD= -lpcap -lncursesw
+LIBADD= pcap ncursesw
CFLAGS=-g
MAN=
diff --git a/tools/tools/net80211/wesside/dics/Makefile b/tools/tools/net80211/wesside/dics/Makefile
index 4f368e3..96583cf 100644
--- a/tools/tools/net80211/wesside/dics/Makefile
+++ b/tools/tools/net80211/wesside/dics/Makefile
@@ -2,8 +2,7 @@
PROG= dics
BINDIR= /usr/local/bin
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD= z
CFLAGS=-g
MAN=
diff --git a/tools/tools/net80211/wesside/udps/Makefile b/tools/tools/net80211/wesside/udps/Makefile
index caa2fc0..b4dd203 100644
--- a/tools/tools/net80211/wesside/udps/Makefile
+++ b/tools/tools/net80211/wesside/udps/Makefile
@@ -2,8 +2,7 @@
PROG= udps
BINDIR= /usr/local/bin
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD= z
CFLAGS=-g
MAN=
diff --git a/tools/tools/net80211/wesside/wesside/Makefile b/tools/tools/net80211/wesside/wesside/Makefile
index 5c39407..65942e5 100644
--- a/tools/tools/net80211/wesside/wesside/Makefile
+++ b/tools/tools/net80211/wesside/wesside/Makefile
@@ -2,8 +2,7 @@
PROG= wesside
BINDIR= /usr/local/bin
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD= z
CFLAGS=-g
MAN=
SRCS=wesside.c aircrack-ptw-lib.c
diff --git a/tools/tools/netrate/http/Makefile b/tools/tools/netrate/http/Makefile
index d501e61..bd144b5 100644
--- a/tools/tools/netrate/http/Makefile
+++ b/tools/tools/netrate/http/Makefile
@@ -3,7 +3,6 @@
PROG= http
MAN=
WARNS?= 3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/netrate/httpd/Makefile b/tools/tools/netrate/httpd/Makefile
index 2318dae..6acbe64 100644
--- a/tools/tools/netrate/httpd/Makefile
+++ b/tools/tools/netrate/httpd/Makefile
@@ -3,7 +3,6 @@
PROG= httpd
MAN=
WARNS?= 3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/netrate/juggle/Makefile b/tools/tools/netrate/juggle/Makefile
index 751bbb5..f7b7afd 100644
--- a/tools/tools/netrate/juggle/Makefile
+++ b/tools/tools/netrate/juggle/Makefile
@@ -3,7 +3,6 @@
PROG= juggle
MAN=
WARNS?= 3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/tscdrift/Makefile b/tools/tools/tscdrift/Makefile
index 0b5c8ac..fad714d 100644
--- a/tools/tools/tscdrift/Makefile
+++ b/tools/tools/tscdrift/Makefile
@@ -4,7 +4,6 @@ PROG= tscdrift
MAN=
WARNS?= 6
-LDADD= -lpthread -lm
-DPADD= ${LIBPTHREAD} ${LIBM}
+LIBADD= pthread m
.include <bsd.prog.mk>
diff --git a/tools/tools/umastat/Makefile b/tools/tools/umastat/Makefile
index 8160936..92cd50e 100644
--- a/tools/tools/umastat/Makefile
+++ b/tools/tools/umastat/Makefile
@@ -4,7 +4,6 @@ PROG= umastat
MAN=
WARNS?= 3
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD= kvm
.include <bsd.prog.mk>
diff --git a/tools/tools/usbtest/Makefile b/tools/tools/usbtest/Makefile
index f9b16bc..b535f52 100644
--- a/tools/tools/usbtest/Makefile
+++ b/tools/tools/usbtest/Makefile
@@ -33,8 +33,7 @@ SRCS+= usb_modem_test.c
SRCS+= usb_control_ep_test.c
SYSDIR?= ${.CURDIR}/../../../sys
-DPADD+= ${LIBUSB}
-LDADD+= -lusb
+LIBADD+= usb
WARNS= 3
diff --git a/tools/tools/vimage/Makefile b/tools/tools/vimage/Makefile
index 76c7617..262e3c6 100644
--- a/tools/tools/vimage/Makefile
+++ b/tools/tools/vimage/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= vimage
-LDADD= -ljail
-DPADD= ${LIBJAIL}
+LIBADD= jail
WARNS?= 2
CFLAGS+= -I../../../sys
diff --git a/tools/tools/zfsboottest/Makefile b/tools/tools/zfsboottest/Makefile
index 7362073..4b08a2d 100644
--- a/tools/tools/zfsboottest/Makefile
+++ b/tools/tools/zfsboottest/Makefile
@@ -17,7 +17,7 @@ CFLAGS= -O1 \
-fdiagnostics-show-option \
-W -Wextra -Wno-sign-compare -Wno-unused-parameter
CFLAGS+=-m32
-LDADD+= -lmd
+LIBADD+= md
.if ${MACHINE_CPUARCH} == "amd64"
beforedepend zfsboottest.o: machine
diff --git a/usr.bin/caesar/Makefile b/usr.bin/caesar/Makefile
index 88b79ee..2ad96b7 100644
--- a/usr.bin/caesar/Makefile
+++ b/usr.bin/caesar/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PROG= caesar
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
SCRIPTS=rot13.sh
MAN= caesar.6
MLINKS= caesar.6 rot13.6
diff --git a/usr.bin/clang/clang.prog.mk b/usr.bin/clang/clang.prog.mk
index 9e929c4..912f678 100644
--- a/usr.bin/clang/clang.prog.mk
+++ b/usr.bin/clang/clang.prog.mk
@@ -9,11 +9,7 @@ DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a
LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a
.endfor
-DPADD+= ${LIBNCURSESW}
-LDADD+= -lncursesw
-
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
+LIBADD+= ncursesw pthread
BINDIR?= /usr/bin
diff --git a/usr.bin/clang/clang/Makefile b/usr.bin/clang/clang/Makefile
index 7ee3ad8..18ee730 100644
--- a/usr.bin/clang/clang/Makefile
+++ b/usr.bin/clang/clang/Makefile
@@ -121,7 +121,6 @@ LIBDEPS=clangfrontendtool \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD+= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llc/Makefile b/usr.bin/clang/llc/Makefile
index 75d8337..d54a3ce 100644
--- a/usr.bin/clang/llc/Makefile
+++ b/usr.bin/clang/llc/Makefile
@@ -68,7 +68,6 @@ LIBDEPS=llvmmirparser \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD+= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/lli/Makefile b/usr.bin/clang/lli/Makefile
index 33aa71f..7852095 100644
--- a/usr.bin/clang/lli/Makefile
+++ b/usr.bin/clang/lli/Makefile
@@ -44,7 +44,6 @@ LIBDEPS=llvmx86disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-ar/Makefile b/usr.bin/clang/llvm-ar/Makefile
index 9165773..5126257 100644
--- a/usr.bin/clang/llvm-ar/Makefile
+++ b/usr.bin/clang/llvm-ar/Makefile
@@ -66,7 +66,6 @@ LIBDEPS=llvmlibdriver \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-cxxdump/Makefile b/usr.bin/clang/llvm-cxxdump/Makefile
index 34af239..b483930 100644
--- a/usr.bin/clang/llvm-cxxdump/Makefile
+++ b/usr.bin/clang/llvm-cxxdump/Makefile
@@ -66,7 +66,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-dwarfdump/Makefile b/usr.bin/clang/llvm-dwarfdump/Makefile
index d27a91e..dab8e37 100644
--- a/usr.bin/clang/llvm-dwarfdump/Makefile
+++ b/usr.bin/clang/llvm-dwarfdump/Makefile
@@ -15,7 +15,6 @@ LIBDEPS=llvmdebuginfodwarf \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-lto/Makefile b/usr.bin/clang/llvm-lto/Makefile
index 98d673b..abda951 100644
--- a/usr.bin/clang/llvm-lto/Makefile
+++ b/usr.bin/clang/llvm-lto/Makefile
@@ -72,7 +72,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-mc/Makefile b/usr.bin/clang/llvm-mc/Makefile
index f0c2367..0fe37c1 100644
--- a/usr.bin/clang/llvm-mc/Makefile
+++ b/usr.bin/clang/llvm-mc/Makefile
@@ -66,7 +66,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile
index 76dfa62..38dd871 100644
--- a/usr.bin/clang/llvm-nm/Makefile
+++ b/usr.bin/clang/llvm-nm/Makefile
@@ -64,7 +64,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-objdump/Makefile b/usr.bin/clang/llvm-objdump/Makefile
index 4e87913..49123a5 100644
--- a/usr.bin/clang/llvm-objdump/Makefile
+++ b/usr.bin/clang/llvm-objdump/Makefile
@@ -69,7 +69,6 @@ LIBDEPS=llvmdebuginfodwarf \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-pdbdump/Makefile b/usr.bin/clang/llvm-pdbdump/Makefile
index f557ccf..5487490 100644
--- a/usr.bin/clang/llvm-pdbdump/Makefile
+++ b/usr.bin/clang/llvm-pdbdump/Makefile
@@ -26,7 +26,6 @@ LIBDEPS=llvmdebuginfopdb \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-rtdyld/Makefile b/usr.bin/clang/llvm-rtdyld/Makefile
index 7656543..ee386b4 100644
--- a/usr.bin/clang/llvm-rtdyld/Makefile
+++ b/usr.bin/clang/llvm-rtdyld/Makefile
@@ -69,7 +69,6 @@ LIBDEPS=llvmdebuginfodwarf \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-symbolizer/Makefile b/usr.bin/clang/llvm-symbolizer/Makefile
index 0c3c974d..c6281fd 100644
--- a/usr.bin/clang/llvm-symbolizer/Makefile
+++ b/usr.bin/clang/llvm-symbolizer/Makefile
@@ -17,7 +17,6 @@ LIBDEPS=llvmdebuginfopdb \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/opt/Makefile b/usr.bin/clang/opt/Makefile
index 1931393..e855759 100644
--- a/usr.bin/clang/opt/Makefile
+++ b/usr.bin/clang/opt/Makefile
@@ -78,7 +78,6 @@ LIBDEPS=llvmpasses \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/factor/Makefile b/usr.bin/factor/Makefile
index afc9510..58da816 100644
--- a/usr.bin/factor/Makefile
+++ b/usr.bin/factor/Makefile
@@ -9,8 +9,7 @@ CFLAGS+=-I${.CURDIR}/../primes
.if ${MK_OPENSSL} != "no"
CFLAGS+=-DHAVE_OPENSSL
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+LIBADD+=crypto
.endif
MAN= factor.6
diff --git a/usr.bin/grdc/Makefile b/usr.bin/grdc/Makefile
index 73d395a..be8c4b2 100644
--- a/usr.bin/grdc/Makefile
+++ b/usr.bin/grdc/Makefile
@@ -3,6 +3,6 @@
PROG= grdc
MAN= grdc.6
DPADD= ${LIBNCURSESW}
-LDADD= -lncursesw
+LIBADD= ncursesw
.include <bsd.prog.mk>
diff --git a/usr.bin/pom/Makefile b/usr.bin/pom/Makefile
index 9a74204..b7d4b00 100644
--- a/usr.bin/pom/Makefile
+++ b/usr.bin/pom/Makefile
@@ -3,7 +3,6 @@
PROG= pom
MAN= pom.6
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.prog.mk>
diff --git a/usr.bin/primes/Makefile b/usr.bin/primes/Makefile
index bfc4147..1f762a3 100644
--- a/usr.bin/primes/Makefile
+++ b/usr.bin/primes/Makefile
@@ -4,7 +4,6 @@
PROG= primes
SRCS= pattern.c pr_tbl.c primes.c spsp.c
MAN=
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.prog.mk>
diff --git a/usr.sbin/fstyp/Makefile b/usr.sbin/fstyp/Makefile
index 5b1d339..e82dd04 100644
--- a/usr.sbin/fstyp/Makefile
+++ b/usr.sbin/fstyp/Makefile
@@ -39,8 +39,7 @@ CFLAGS+=-I${.CURDIR}/../../sys
LIBADD= geom md
.if ${MK_ZFS} != "no"
-DPADD += ${LIBNVPAIR} ${LIBZFS}
-LDADD += -lnvpair -lzfs
+LIBADD+=nvpair zfs
.endif
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud