Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.bin / file / Makefile
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.
5 #
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.
8 #
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:
12 #
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.
22
23 SRCDIR= ${.CURDIR}/../../contrib/file
24 .PATH: ${SRCDIR}
25
26 PROG=   file
27 MAN=    file.1 magic.5
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
31
32 MAGICPATH=      /usr/share/misc
33
34 CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H
35 CFLAGS+= -I${.CURDIR} -I${SRCDIR}
36
37 LDADD+= -lz
38 DPADD+= ${LIBZ}
39
40 CLEANFILES+=    magic magic.mgc magic.mime.mgc magic.mime.PITA
41
42 FILES=          magic magic.mgc ${SRCDIR}/magic.mime magic.mime.mgc
43 FILESDIR=       ${MAGICPATH}
44
45 MAGFILES=       ${SRCDIR}/Header\
46                 ${SRCDIR}/Localstuff\
47                 ${SRCDIR}/Magdir/[a-z]*
48
49 all: ${PROG} magic.mgc magic.mime.mgc
50
51 magic: ${MAGFILES}
52         cat ${.ALLSRC} > ${.TARGET}
53
54 magic.mgc: mkmagic magic
55         ./mkmagic magic
56
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
61
62 CLEANFILES+=    mkmagic
63 build-tools: mkmagic
64 mkmagic: apprentice.c print.c
65         ${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \
66             -I${.CURDIR} -I${SRCDIR} -o ${.TARGET} ${.ALLSRC}
67
68 .include <bsd.prog.mk>