2004-08-09 08:48:28 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
# Copyright (c) David E. O'Brien, 2000-2004
|
|
|
|
|
2004-08-09 10:32:16 +00:00
|
|
|
CONTRDIR= ${.CURDIR}/../../contrib/file
|
2004-08-09 08:48:28 +00:00
|
|
|
.PATH: ${CONTRDIR}
|
|
|
|
|
|
|
|
LIB= magic
|
2007-05-21 02:49:08 +00:00
|
|
|
SHLIB_MAJOR= 3
|
2005-11-10 18:07:07 +00:00
|
|
|
DPADD= ${LIBZ}
|
|
|
|
LDADD= -lz
|
2004-08-09 08:48:28 +00:00
|
|
|
MAN= libmagic.3 magic.5
|
|
|
|
|
|
|
|
SRCS= apprentice.c apptype.c ascmagic.c compress.c fsmagic.c funcs.c \
|
|
|
|
is_tar.c magic.c print.c readelf.c softmagic.c
|
2004-11-19 04:04:14 +00:00
|
|
|
INCS= magic.h
|
2004-08-09 08:48:28 +00:00
|
|
|
|
2004-08-09 11:05:09 +00:00
|
|
|
MAGICPATH?= /usr/share/misc
|
2004-08-09 08:48:28 +00:00
|
|
|
|
2006-06-19 08:10:23 +00:00
|
|
|
CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H
|
2004-08-09 08:48:28 +00:00
|
|
|
CFLAGS+= -I${.CURDIR} -I${CONTRDIR}
|
|
|
|
|
2005-01-28 17:01:54 +00:00
|
|
|
CLEANFILES+= magic magic.mgc magic.mime.mgc
|
2004-08-09 08:48:28 +00:00
|
|
|
|
|
|
|
FILES= magic magic.mgc ${CONTRDIR}/magic.mime magic.mime.mgc
|
|
|
|
FILESDIR= ${MAGICPATH}
|
|
|
|
|
|
|
|
MAGFILES= ${CONTRDIR}/Header\
|
|
|
|
${CONTRDIR}/Localstuff\
|
|
|
|
${CONTRDIR}/Magdir/[a-z]*
|
|
|
|
|
|
|
|
magic: ${MAGFILES}
|
|
|
|
cat ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
magic.mgc: mkmagic magic
|
|
|
|
./mkmagic magic
|
|
|
|
|
|
|
|
magic.mime.mgc: mkmagic magic.mime
|
2005-01-28 17:01:54 +00:00
|
|
|
./mkmagic ${CONTRDIR}/magic.mime
|
2004-08-09 08:48:28 +00:00
|
|
|
|
|
|
|
CLEANFILES+= mkmagic
|
|
|
|
build-tools: mkmagic
|
|
|
|
mkmagic: apprentice.c funcs.c magic.c print.c
|
|
|
|
${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \
|
|
|
|
-I${.CURDIR} -I${CONTRDIR} -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
2004-10-18 22:18:23 +00:00
|
|
|
FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \
|
|
|
|
${.CURDIR}/config.h
|
2004-08-09 08:48:28 +00:00
|
|
|
CLEANFILES+= ${MAN}
|
|
|
|
.for mp in ${MAN}
|
|
|
|
${mp}: ${mp:C/[0-9]/man/}
|
|
|
|
sed -e 's/__FSECTION__/5/g' -e 's/__CSECTION__/1/g' \
|
|
|
|
-e 's/__VERSION__/${FILEVER}/g' \
|
|
|
|
-e 's,__MAGIC__,${MAGICPATH}/magic,g' ${.ALLSRC} > ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|