1 # $FreeBSD: src/usr.bin/file/Makefile,v 1.13.2.8 2003/03/16 04:47:04 obrien Exp $
2 # Makefile for file(1) cmd.
3 # Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
5 # This software is not subject to any license of the American Telephone
6 # and Telegraph Company or of the Regents of the University of California.
8 # Permission is granted to anyone to use this software for any purpose on
9 # any computer system, and to alter it and redistribute it freely, subject
10 # to the following restrictions:
12 # 1. The author is not responsible for the consequences of use of this
13 # software, no matter how awful, even if they arise from flaws in it.
14 # 2. The origin of this software must not be misrepresented, either by
15 # explicit claim or by omission. Since few users ever read sources,
16 # credits must appear in the documentation.
17 # 3. Altered versions must be plainly marked as such, and must not be
18 # misrepresented as being the original software. Since few users
19 # ever read sources, credits must appear in the documentation.
20 # 4. This notice may not be removed or altered.
22 SRCDIR= ${.CURDIR}/../../contrib/file
27 SRCS= file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
28 compress.c is_tar.c readelf.c print.c
29 # compress.c is_tar.c readelf.c internat.c print.c
31 MAGICPATH= /usr/share/misc
33 CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H
34 CFLAGS+= -I${.CURDIR} -I${SRCDIR}
39 CLEANFILES+= magic magic.mgc magic.mime.mgc magic.mime.PITA
41 FILES= magic magic.mgc ${SRCDIR}/magic.mime magic.mime.mgc
42 FILESDIR= ${MAGICPATH}
44 MAGFILES= ${SRCDIR}/Header\
46 ${SRCDIR}/Magdir/[a-z]*
48 all: ${PROG} magic.mgc magic.mime.mgc
51 cat ${.ALLSRC} > ${.TARGET}
53 magic.mgc: mkmagic magic
56 magic.mime.mgc: mkmagic magic.mime
57 ln -sf ${SRCDIR}/magic.mime magic.mime.PITA
58 ./mkmagic magic.mime.PITA
59 mv magic.mime.PITA.mgc magic.mime.mgc
63 mkmagic: apprentice.c print.c
64 ${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \
65 -I${.CURDIR} -I${SRCDIR} -o ${.TARGET} ${.ALLSRC}
67 .include <bsd.prog.mk>