1133362Sobrien# $FreeBSD: releng/10.2/lib/libmagic/Makefile 268515 2014-07-11 00:00:00Z delphij $ 2234449Sobrien# Copyright (c) David E. O'Brien, 2000-2004, 2006, 2009 3133362Sobrien 4133365SobrienCONTRDIR= ${.CURDIR}/../../contrib/file 5268515Sdelphij.PATH: ${CONTRDIR}/src 6268515Sdelphij.PATH: ${CONTRDIR}/doc 7133362Sobrien 8133362SobrienLIB= magic 9195767SkensmithSHLIB_MAJOR= 4 10152285SruDPADD= ${LIBZ} 11152285SruLDADD= -lz 12133362SobrienMAN= libmagic.3 magic.5 13133362Sobrien 14191771SobrienSRCS= apprentice.c apptype.c ascmagic.c cdf.c cdf_time.c compress.c \ 15191771Sobrien encoding.c fsmagic.c funcs.c \ 16191771Sobrien is_tar.c magic.c print.c readcdf.c readelf.c softmagic.c 17137887SobrienINCS= magic.h 18133362Sobrien 19133370SobrienMAGICPATH?= /usr/share/misc 20133362Sobrien 21159769SobrienCFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H 22268515SdelphijCFLAGS+= -I${.CURDIR} -I${CONTRDIR}/src 23133362Sobrien 24208342SmariusWARNS?= 3 25201381Sed 26186693SobrienCLEANFILES+= magic magic.mgc 27133362Sobrien 28186693SobrienFILES= magic magic.mgc 29133362SobrienFILESDIR= ${MAGICPATH} 30133362Sobrien 31268515SdelphijMAGFILES= ${CONTRDIR}/magic/Header \ 32268515Sdelphij ${CONTRDIR}/magic/Localstuff \ 33268515Sdelphij ${CONTRDIR}/magic/Magdir/[a-z]* 34133362Sobrien 35133362Sobrienmagic: ${MAGFILES} 36265747Sdelphij cat ${.ALLSRC:O} > ${.TARGET} 37133362Sobrien 38133362Sobrienmagic.mgc: mkmagic magic 39133362Sobrien ./mkmagic magic 40133362Sobrien 41133362SobrienCLEANFILES+= mkmagic 42133362Sobrienbuild-tools: mkmagic 43268515Sdelphijmkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c 44240377Sobrien ${CC} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} \ 45240377Sobrien ${LDADD} 46133362Sobrien 47136681SruFILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ 48136681Sru ${.CURDIR}/config.h 49133362SobrienCLEANFILES+= ${MAN} 50133362Sobrien.for mp in ${MAN} 51133362Sobrien${mp}: ${mp:C/[0-9]/man/} 52133362Sobrien sed -e 's/__FSECTION__/5/g' -e 's/__CSECTION__/1/g' \ 53133362Sobrien -e 's/__VERSION__/${FILEVER}/g' \ 54133362Sobrien -e 's,__MAGIC__,${MAGICPATH}/magic,g' ${.ALLSRC} > ${.TARGET} 55133362Sobrien.endfor 56133362Sobrien 57133362Sobrien.include <bsd.lib.mk> 58