Commit c05917519693be1493bfc72e2b26582be8d33812

Stefan Sperling 2022-03-24T12:17:45

link libexec helpers against _p libraries when building with 'make PROFILE=1'

diff --git a/libexec/got-fetch-pack/Makefile b/libexec/got-fetch-pack/Makefile
index fb60037..1cbeffd 100644
--- a/libexec/got-fetch-pack/Makefile
+++ b/libexec/got-fetch-pack/Makefile
@@ -7,7 +7,12 @@ SRCS=		got-fetch-pack.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c pkt.c gitproto.c ratelimit.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-index-pack/Makefile b/libexec/got-index-pack/Makefile
index 08a453b..3af9d7f 100644
--- a/libexec/got-index-pack/Makefile
+++ b/libexec/got-index-pack/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-index-pack.c error.c inflate.c object_parse.c object_idset.c \
 		delta_cache.c delta.c pack.c path.c privsep.c sha1.c ratelimit.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-blob/Makefile b/libexec/got-read-blob/Makefile
index 17ab97b..427fba8 100644
--- a/libexec/got-read-blob/Makefile
+++ b/libexec/got-read-blob/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-blob.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-commit/Makefile b/libexec/got-read-commit/Makefile
index 3f6f7ca..a5aaaae 100644
--- a/libexec/got-read-commit/Makefile
+++ b/libexec/got-read-commit/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-commit.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-gitconfig/Makefile b/libexec/got-read-gitconfig/Makefile
index f49bf06..326e9b9 100644
--- a/libexec/got-read-gitconfig/Makefile
+++ b/libexec/got-read-gitconfig/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-gitconfig.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c gitconfig.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-gotconfig/Makefile b/libexec/got-read-gotconfig/Makefile
index a683cf2..952f34c 100644
--- a/libexec/got-read-gotconfig/Makefile
+++ b/libexec/got-read-gotconfig/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-gotconfig.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c parse.y
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib -I${.CURDIR}
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-object/Makefile b/libexec/got-read-object/Makefile
index 2634211..35015b3 100644
--- a/libexec/got-read-object/Makefile
+++ b/libexec/got-read-object/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-object.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-pack/Makefile b/libexec/got-read-pack/Makefile
index 5fe2b7e..ceb42b9 100644
--- a/libexec/got-read-pack/Makefile
+++ b/libexec/got-read-pack/Makefile
@@ -8,7 +8,13 @@ SRCS=		got-read-pack.c delta.c error.c inflate.c object_cache.c \
 		privsep.c sha1.c delta_cache.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-patch/Makefile b/libexec/got-read-patch/Makefile
index 9eddbae..8c35830 100644
--- a/libexec/got-read-patch/Makefile
+++ b/libexec/got-read-patch/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-patch.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
-LDADD = -lz -lutil
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
+LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-tag/Makefile b/libexec/got-read-tag/Makefile
index a8026e4..7598ada 100644
--- a/libexec/got-read-tag/Makefile
+++ b/libexec/got-read-tag/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-tag.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-read-tree/Makefile b/libexec/got-read-tree/Makefile
index 397775d..368c851 100644
--- a/libexec/got-read-tree/Makefile
+++ b/libexec/got-read-tree/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-read-tree.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>
diff --git a/libexec/got-send-pack/Makefile b/libexec/got-send-pack/Makefile
index 8e79a14..fb9f610 100644
--- a/libexec/got-send-pack/Makefile
+++ b/libexec/got-send-pack/Makefile
@@ -7,7 +7,13 @@ SRCS=		got-send-pack.c error.c inflate.c object_parse.c \
 		path.c privsep.c sha1.c pkt.c gitproto.c ratelimit.c
 
 CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p
+.else
 LDADD = -lutil -lz
+.endif
+
 DPADD = ${LIBZ} ${LIBUTIL}
 
 .include <bsd.prog.mk>