xref: /freebsd/lib/atf/common.mk (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
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