xref: /freebsd/lib/atf/common.mk (revision eb69d1f144a6fcc765d1b9d44a5ae8082353e70b)
1# $FreeBSD$
2#
3# Common Makefile code for all components of ATF.
4#
5
6.if !defined(ATF)
7.error "ATF must be defined and point to the contrib/atf directory"
8.endif
9
10# Depend on the atf-version target to generate a file that contains the
11# version number of the currently imported ATF release and that only
12# changes on new imports.
13atf-version: atf-version-real
14	@cmp -s atf-version atf-version-real \
15	    || cp atf-version-real atf-version
16atf-version-real: .PHONY
17	@grep 'define VERSION' ${ATF}/config.h \
18	    | cut -d '"' -f 2 >atf-version-real
19CLEANFILES+= atf-version atf-version-real
20