E2BIG -> EFBIG
[dragonfly/port-amd64.git] / lib / libmagic / Makefile
blob98c54968a20a4500618c6aeab75dc337ef241065
1 # $DragonFly: src/lib/libmagic/Makefile,v 1.18 2007/03/25 07:50:50 sephe Exp $
3 CONTRIBDIR= ${.CURDIR}/../../contrib/file-4/src
4 MAGICDIR= ${CONTRIBDIR}/../magic
5 .PATH: ${CONTRIBDIR}
7 MAGIC= /usr/share/misc/magic
9 LIB= magic
10 SHLIB_MAJOR= 2
12 SRCS= apprentice.c apptype.c ascmagic.c compress.c fsmagic.c funcs.c\
13 is_tar.c magic.c print.c readelf.c softmagic.c file.h.no_obj.patch
14 INCS= magic.h
16 LIBMAGIC_CDEFS = -DHAVE_CONFIG_H -DMAGIC=\"${MAGIC}\"
17 CFLAGS+= ${LIBMAGIC_CDEFS}
18 CFLAGS+= -I${.CURDIR} -I${CONTRIBDIR}
20 MAN= libmagic.3
22 MLINKS+= libmagic.3 magic_open.3
23 MLINKS+= libmagic.3 magic_close.3
24 MLINKS+= libmagic.3 magic_error.3
25 MLINKS+= libmagic.3 magic_errno.3
26 MLINKS+= libmagic.3 magic_file.3
27 MLINKS+= libmagic.3 magic_buffer.3
28 MLINKS+= libmagic.3 magic_setflags.3
29 MLINKS+= libmagic.3 magic_check.3
30 MLINKS+= libmagic.3 magic_compile.3
31 MLINKS+= libmagic.3 magic_load.3
33 CLEANFILES+= magic magic.mgc magic.mime.mgc magic.mime.lnk libmagic.3
35 FILES= magic magic.mgc ${MAGICDIR}/magic.mime magic.mime.mgc
36 FILESDIR= /usr/share/misc
38 MAGFILES= ${MAGICDIR}/Header ${MAGICDIR}/Localstuff\
39 ${MAGICDIR}/Magdir/[a-z]*
41 libmagic.3: ${CONTRIBDIR}/../doc/libmagic.man libmagic.man.patch
42 patch -o - ${.ALLSRC} | \
43 sed -e s@__CSECTION__@1@g \
44 -e s@__FSECTION__@5@g \
45 -e s@__MAGIC__@${MAGIC}@g > ${.TARGET}
47 all: ${LIB} magic.mgc magic.mime.mgc
49 magic: ${MAGFILES}
50 cat ${.ALLSRC} > ${.TARGET}
52 magic.mgc: mkmagic.nx magic
53 ./mkmagic.nx magic
55 magic.mime.mgc: mkmagic.nx ${MAGICDIR}/magic.mime
56 ./mkmagic.nx ${MAGICDIR}/magic.mime
58 CLEANFILES+= mkmagic.nx
59 build-tools: mkmagic.nx
61 NXCFLAGS= ${LIBMAGIC_CDEFS} -DCOMPILE_ONLY -I${.OBJDIR} -I- -I${.CURDIR} -I${CONTRIBDIR}
62 NXCFLAGS+= -DBOOTSTRAPPING
63 mkmagic.nx: file.h apprentice.c funcs.c magic.c print.c
64 ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC} ${NXLDLIBS} -o ${.TARGET}
66 .include <bsd.lib.mk>