Unbreak buildkernel.
[dragonfly.git] / lib / libmagic / Makefile
blob66b69c19288019e6905678fe84151beb48ff276d
1 CONTRIBDIR= ${.CURDIR}/../../contrib/file/src
2 MAGICDIR= ${CONTRIBDIR}/../magic
3 .PATH: ${CONTRIBDIR}
5 MAGIC= ${FILESDIR}/magic
7 LIB= magic
8 SHLIB_MAJOR= 2
10 DPADD= ${LIBZ}
11 LDADD= -lz
13 SRCS= apprentice.c ascmagic.c cdf.c cdf_time.c \
14 compress.c encoding.c fsmagic.c funcs.c \
15 is_tar.c magic.c print.c readcdf.c readelf.c softmagic.c
16 INCS= magic.h
18 # only when __EMX__ (prog env for DOS and OS/2)
19 #SRCS+= apptype.c
21 CFLAGS+= -DHAVE_CONFIG_H -DMAGIC=\"${MAGIC}\"
22 CFLAGS+= -I${.CURDIR} -I${CONTRIBDIR}
24 MAN= libmagic.3
26 MLINKS+= libmagic.3 magic_open.3
27 MLINKS+= libmagic.3 magic_close.3
28 MLINKS+= libmagic.3 magic_error.3
29 MLINKS+= libmagic.3 magic_errno.3
30 MLINKS+= libmagic.3 magic_descriptor.3
31 MLINKS+= libmagic.3 magic_file.3
32 MLINKS+= libmagic.3 magic_buffer.3
33 MLINKS+= libmagic.3 magic_setflags.3
34 MLINKS+= libmagic.3 magic_check.3
35 MLINKS+= libmagic.3 magic_compile.3
36 MLINKS+= libmagic.3 magic_list.3
37 MLINKS+= libmagic.3 magic_load.3
38 MLINKS+= libmagic.3 magic_load_buffers.3
39 MLINKS+= libmagic.3 magic_setparam.3
40 MLINKS+= libmagic.3 magic_getparam.3
41 MLINKS+= libmagic.3 magic_version.3
43 CLEANFILES+= magic magic.mgc libmagic.3
45 FILES= magic magic.mgc
46 FILESDIR= ${SHAREDIR}/misc
48 MAGFILES= ${MAGICDIR}/Header ${MAGICDIR}/Localstuff\
49 ${MAGICDIR}/Magdir/[a-z]*
51 libmagic.3: ${CONTRIBDIR}/../doc/libmagic.man
52 sed -e s@__CSECTION__@1@g \
53 -e s@__FSECTION__@5@g \
54 -e s@__MAGIC__@${MAGIC}@g ${.ALLSRC} > ${.TARGET}
56 magic: ${MAGFILES}
57 cat ${.ALLSRC} > ${.TARGET}
59 magic.mgc: mkmagic.nx magic
60 ./mkmagic.nx magic
62 CLEANFILES+= mkmagic.nx
63 build-tools: mkmagic.nx
65 NXCFLAGS+= -w -DCOMPILE_ONLY
66 mkmagic.nx: apprentice.c encoding.c cdf_time.c funcs.c magic.c print.c
67 ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC} ${NXLDLIBS} -o ${.TARGET}
69 .include <bsd.lib.mk>