Makefile revision 191771
1169689Skan# $FreeBSD: head/usr.bin/file/Makefile 191771 2009-05-04 00:37:44Z obrien $
2169689Skan# Makefile for file(1) cmd.
3169689Skan# Copyright (c) David E. O'Brien, 2000-2004
4169689Skan# Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
5169689Skan#
6169689Skan# This software is not subject to any license of the American Telephone
7169689Skan# and Telegraph Company or of the Regents of the University of California.
8169689Skan#
9169689Skan# Permission is granted to anyone to use this software for any purpose on
10169689Skan# any computer system, and to alter it and redistribute it freely, subject
11169689Skan# to the following restrictions:
12169689Skan#
13169689Skan# 1. The author is not responsible for the consequences of use of this
14169689Skan#    software, no matter how awful, even if they arise from flaws in it.
15169689Skan# 2. The origin of this software must not be misrepresented, either by
16169689Skan#    explicit claim or by omission.  Since few users ever read sources,
17169689Skan#    credits must appear in the documentation.
18169689Skan# 3. Altered versions must be plainly marked as such, and must not be
19169689Skan#    misrepresented as being the original software.  Since few users
20169689Skan#    ever read sources, credits must appear in the documentation.
21169689Skan# 4. This notice may not be removed or altered.
22169689Skan
23169689SkanSRCDIR=	${.CURDIR}/../../contrib/file
24169689Skan.PATH: ${SRCDIR}
25169689Skan
26169689SkanPROG=	file
27169689Skan
28169689SkanMAGICPATH?=	/usr/share/misc
29169689Skan
30169689SkanCFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H
31169689SkanCFLAGS+= -I${.CURDIR}/../../lib/libmagic
32169689Skan
33169689SkanDPADD=	${LIBMAGIC} ${LIBZ}
34169689SkanLDADD=	-lmagic -lz
35169689Skan
36169689SkanFILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \
37169689Skan			${.CURDIR}/../../lib/libmagic/config.h
38169689Skan
39169689SkanCLEANFILES+=	${MAN}
40169689Skan
41169689Skan.include <bsd.prog.mk>
42169689Skan
43169689Skan.for mp in ${MAN}
44169689Skan${mp}: ${mp:C/[0-9]/man/}
45169689Skan	sed -e 's/__FSECTION__/5/g' -e 's/__CSECTION__/1/g' \
46169689Skan		-e 's/__VERSION__/${FILEVER}/g' \
47169689Skan		-e 's,__MAGIC__,${MAGICPATH}/magic,g' ${.ALLSRC} > ${.TARGET}
48169689Skan.endfor
49169689Skan