summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/atf/common.mk19
-rw-r--r--lib/atf/libatf-c++/Makefile13
-rw-r--r--lib/atf/libatf-c/Makefile13
-rw-r--r--usr.bin/atf/atf-sh/Makefile11
4 files changed, 56 insertions, 0 deletions
diff --git a/lib/atf/common.mk b/lib/atf/common.mk
new file mode 100644
index 0000000..6338207
--- /dev/null
+++ b/lib/atf/common.mk
@@ -0,0 +1,19 @@
+# $FreeBSD$
+#
+# Common Makefile code for all components of ATF.
+#
+
+.if !defined(ATF)
+.error "ATF must be defined and point to the contrib/atf directory"
+.endif
+
+# Depend on the atf-version target to generate a file that contains the
+# version number of the currently imported ATF release and that only
+# changes on new imports.
+atf-version: atf-version-real
+ @cmp -s atf-version atf-version-real \
+ || cp atf-version-real atf-version
+atf-version-real: .PHONY
+ @grep 'define VERSION' ${ATF}/bconfig.h \
+ | cut -d '"' -f 2 >atf-version-real
+CLEANFILES+= atf-version atf-version-real
diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile
index f1d9dcf..ff05da7 100644
--- a/lib/atf/libatf-c++/Makefile
+++ b/lib/atf/libatf-c++/Makefile
@@ -76,8 +76,21 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR}
MAN= atf-c++-api.3
+all: atf-c++.pc
+atf-c++.pc: atf-c++.pc.in atf-version
+ sed -e 's,__CXX__,${CXX},g' \
+ -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \
+ -e 's,__LIBDIR__,${LIBDIR},g' \
+ -e "s,__ATF_VERSION__,$$(cat atf-version),g" \
+ <${ATF}/atf-c++/atf-c++.pc.in >atf-c++.pc
+
+beforeinstall:
+ ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ atf-c++.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+
.if ${MK_TESTS} != "no"
SUBDIR= tests
.endif
+.include "../common.mk"
.include <bsd.lib.mk>
diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile
index b197958..829f8ff 100644
--- a/lib/atf/libatf-c/Makefile
+++ b/lib/atf/libatf-c/Makefile
@@ -74,8 +74,21 @@ INCSDIR_atf-c.h= ${INCLUDEDIR}
MAN= atf-c-api.3
+all: atf-c.pc
+atf-c.pc: atf-c.pc.in atf-version
+ sed -e 's,__CC__,${CC},g' \
+ -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \
+ -e 's,__LIBDIR__,${LIBDIR},g' \
+ -e "s,__ATF_VERSION__,$$(cat atf-version),g" \
+ <${ATF}/atf-c/atf-c.pc.in >atf-c.pc
+
+beforeinstall:
+ ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ atf-c.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+
.if ${MK_TESTS} != "no"
SUBDIR= tests
.endif
+.include "../common.mk"
.include <bsd.lib.mk>
diff --git a/usr.bin/atf/atf-sh/Makefile b/usr.bin/atf/atf-sh/Makefile
index 1688b19..1d72b56 100644
--- a/usr.bin/atf/atf-sh/Makefile
+++ b/usr.bin/atf/atf-sh/Makefile
@@ -45,8 +45,19 @@ FILESGROUPS= SUBR
SUBRDIR= ${SHAREDIR}/atf
SUBR= libatf-sh.subr
+all: atf-sh.pc
+atf-sh.pc: atf-sh.pc.in atf-version
+ sed -e 's,__EXEC_PREFIX__,/usr,g' \
+ -e "s,__ATF_VERSION__,$$(cat atf-version),g" \
+ <${ATF}/atf-sh/atf-sh.pc.in >atf-sh.pc
+
+beforeinstall:
+ ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ atf-sh.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
+.include "../../../lib/atf/common.mk"
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud