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