xref: /minix/external/bsd/atf/Makefile.inc (revision 00b67f09)
1# $NetBSD: Makefile.inc,v 1.5 2014/02/15 04:19:46 jmmv Exp $
2
3.include <bsd.own.mk>
4
5TOPDIR=		${NETBSDSRCDIR}/external/bsd/atf
6SRCDIR=		${TOPDIR}/dist
7
8# Depend on the atf-version.txt target to generate a file that contains
9# the version number of the currently imported ATF release and that only
10# changes on new imports.
11atf-version.txt: atf-version-real.txt
12	@cmp -s atf-version.txt atf-version-real.txt \
13	    || cp atf-version-real.txt atf-version.txt
14atf-version-real.txt: .PHONY
15	@grep 'define VERSION' ${TOPDIR}/bconfig.h \
16	    | cut -d '"' -f 2 >atf-version-real.txt
17CLEANFILES+= atf-version.txt atf-version-real.txt
18
19CPPFLAGS+=	-DHAVE_CONFIG_H
20
21# Not all source files need these settings, but it's just easier to
22# set them in all cases.
23CPPFLAGS+=	-DATF_ARCH=\"${MACHINE_ARCH}\"
24CPPFLAGS+=	-DATF_BUILD_CC=\"/usr/bin/cc\"
25CPPFLAGS+=	-DATF_BUILD_CFLAGS=\"\"
26CPPFLAGS+=	-DATF_BUILD_CPP=\"/usr/bin/cpp\"
27CPPFLAGS+=	-DATF_BUILD_CPPFLAGS=\"\"
28CPPFLAGS+=	-DATF_BUILD_CXX=\"/usr/bin/c++\"
29CPPFLAGS+=	-DATF_BUILD_CXXFLAGS=\"\"
30CPPFLAGS+=	-DATF_CONFDIR=\"/etc/atf\"
31CPPFLAGS+=	-DATF_INCLUDEDIR=\"/usr/include\"
32CPPFLAGS+=	-DATF_LIBDIR=\"/usr/lib\"
33CPPFLAGS+=	-DATF_LIBEXECDIR=\"/usr/libexec\"
34CPPFLAGS+=	-DATF_MACHINE=\"${MACHINE}\"
35CPPFLAGS+=	-DATF_M4=\"/usr/bin/m4\"
36CPPFLAGS+=	-DATF_PKGDATADIR=\"/usr/share/atf\"
37CPPFLAGS+=	-DATF_SHELL=\"/bin/sh\"
38CPPFLAGS+=	-DATF_WORKDIR=\"/tmp\"
39
40CPPFLAGS+=	-I${TOPDIR}			# For bconfig.h.
41CPPFLAGS+=	-I${TOPDIR}/lib/libatf-c	# For atf-c/defs.hpp.
42CPPFLAGS+=	-I${SRCDIR}
43
44.if defined(USE_ATF_LIBTOOLS)
45LIBTOOLSOBJDIR!=	cd ${TOPDIR}/lib/tools; ${PRINTOBJDIR}
46CPPFLAGS+=		-I${LIBTOOLSOBJDIR}
47LDADD+=			${LIBTOOLSOBJDIR}/libtools.a
48DPADD+=			${LIBTOOLSOBJDIR}/libtools.a
49.endif
50