Makefile revision 267897
11558Srgrimes# $FreeBSD: head/usr.bin/file/Makefile 267897 2014-06-26 06:03:39Z delphij $
2187814Srwatson# Makefile for file(1) cmd.
3187814Srwatson# Copyright (c) David E. O'Brien, 2000-2004, 2009
4187814Srwatson# Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
5187814Srwatson#
6187814Srwatson# This software is not subject to any license of the American Telephone
7187814Srwatson# and Telegraph Company or of the Regents of the University of California.
898542Smckusick#
998542Smckusick# Permission is granted to anyone to use this software for any purpose on
1098542Smckusick# any computer system, and to alter it and redistribute it freely, subject
1198542Smckusick# to the following restrictions:
1298542Smckusick#
1398542Smckusick# 1. The author is not responsible for the consequences of use of this
1498542Smckusick#    software, no matter how awful, even if they arise from flaws in it.
15110884Smckusick# 2. The origin of this software must not be misrepresented, either by
1698542Smckusick#    explicit claim or by omission.  Since few users ever read sources,
171558Srgrimes#    credits must appear in the documentation.
181558Srgrimes# 3. Altered versions must be plainly marked as such, and must not be
191558Srgrimes#    misrepresented as being the original software.  Since few users
201558Srgrimes#    ever read sources, credits must appear in the documentation.
211558Srgrimes# 4. This notice may not be removed or altered.
221558Srgrimes
231558SrgrimesSRCDIR=	${.CURDIR}/../../contrib/file
241558Srgrimes.PATH: ${SRCDIR}/src
251558Srgrimes.PATH: ${SRCDIR}/doc
261558Srgrimes
271558SrgrimesPROG=	file
281558Srgrimes
291558SrgrimesMAGICPATH?=	/usr/share/misc
301558Srgrimes
311558SrgrimesCFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H
321558SrgrimesCFLAGS+= -I${.CURDIR}/../../lib/libmagic
331558Srgrimes
341558SrgrimesDPADD=	${LIBMAGIC} ${LIBZ}
351558SrgrimesLDADD=	-lmagic -lz
361558Srgrimes
371558SrgrimesFILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \
381558Srgrimes			${.CURDIR}/../../lib/libmagic/config.h
391558Srgrimes
401558SrgrimesCLEANFILES+=	${MAN}
411558Srgrimes
421558Srgrimes.include <bsd.prog.mk>
431558Srgrimes
441558Srgrimes.for mp in ${MAN}
451558Srgrimes${mp}: ${mp:C/[0-9]/man/}
4636998Scharnier	sed -e 's/__FSECTION__/5/g' -e 's/__CSECTION__/1/g' \
471558Srgrimes		-e 's/__VERSION__/${FILEVER}/g' \
481558Srgrimes		-e 's,__MAGIC__,${MAGICPATH}/magic,g' ${.ALLSRC} > ${.TARGET}
491558Srgrimes.endfor
501558Srgrimes