summaryrefslogtreecommitdiffstats
path: root/usr.bin/file
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-08-17 17:21:38 +0000
committerobrien <obrien@FreeBSD.org>2001-08-17 17:21:38 +0000
commitdd7a669ee78635147ebcad73b4d7069a5d50ee55 (patch)
treee6b321024140e338f08e1281f8ce168d24ff095e /usr.bin/file
parent0e1462102add986464b4ca3458d6d4772e46cd37 (diff)
downloadFreeBSD-src-dd7a669ee78635147ebcad73b4d7069a5d50ee55.zip
FreeBSD-src-dd7a669ee78635147ebcad73b4d7069a5d50ee55.tar.gz
Use a build-tool to create the .mgc files.
Submitted by: ru (partial) Obtained from: NetBSD (basic idea) Reviewed by: bde, ru
Diffstat (limited to 'usr.bin/file')
-rw-r--r--usr.bin/file/Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/file/Makefile b/usr.bin/file/Makefile
index c823e18..b6a0131 100644
--- a/usr.bin/file/Makefile
+++ b/usr.bin/file/Makefile
@@ -40,23 +40,29 @@ MAGFILES= ${SRCDIR}/Header\
${SRCDIR}/Localstuff\
${SRCDIR}/Magdir/[a-z]*
-all: file magic magic.mgc magic.mime.mgc
+all: ${PROG} magic.mgc magic.mime.mgc
magic: ${MAGFILES}
cat ${.ALLSRC} > ${.TARGET}
-magic.mgc: file magic
- ./${PROG} -C -m magic
+magic.mgc: mkmagic magic
+ ./mkmagic magic
-magic.mime.mgc: file magic.mime
+magic.mime.mgc: mkmagic magic.mime
ln -sf ${SRCDIR}/magic.mime magic.mime.PITA
- ./${PROG} -C -m magic.mime.PITA
+ ./mkmagic magic.mime.PITA
mv magic.mime.PITA.mgc magic.mime.mgc
CLEANFILES+= print-hacked.c
print-hacked.c: print.c
sed -e 's|daylight|0/*daylight*/|g' ${.ALLSRC} > ${.TARGET}
+CLEANFILES+= mkmagic
+build-tools: mkmagic
+mkmagic: apprentice.c print-hacked.c
+ ${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \
+ -I${.CURDIR} -I${SRCDIR} -o ${.TARGET} ${.ALLSRC}
+
beforeinstall:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${MAGICMODE} \
magic magic.mgc ${SRCDIR}/magic.mime magic.mime.mgc \
OpenPOWER on IntegriCloud