kernel - Improve uidinfo
[dragonfly.git] / lib / libmagic / Makefile
blobd25884f08828eff672708c9f9d8464f7d2f354d5
1 CONTRIBDIR= ${.CURDIR}/../../contrib/file/src
2 MAGICDIR= ${CONTRIBDIR}/../magic
3 .PATH: ${CONTRIBDIR}
5 VER!= grep -w VERSION ${.CURDIR}/config.h | awk -F\" '{print $$2}'
6 MAGIC= ${FILESDIR}/magic
8 LIB= magic
9 SHLIB_MAJOR= 2
11 DPADD= ${LIBZ}
12 LDADD= -lz
14 SRCS= apprentice.c ascmagic.c cdf.c cdf_time.c \
15 compress.c der.c encoding.c fsmagic.c funcs.c \
16 is_tar.c magic.c print.c readcdf.c readelf.c softmagic.c
17 INCS= magic.h
19 # only when __EMX__ (prog env for DOS and OS/2)
20 #SRCS+= apptype.c
22 CFLAGS+= -DHAVE_CONFIG_H -DMAGIC=\"${MAGIC}\"
23 CFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${CONTRIBDIR}
25 MAN= libmagic.3
27 MLINKS+= libmagic.3 magic_open.3
28 MLINKS+= libmagic.3 magic_close.3
29 MLINKS+= libmagic.3 magic_error.3
30 MLINKS+= libmagic.3 magic_errno.3
31 MLINKS+= libmagic.3 magic_descriptor.3
32 MLINKS+= libmagic.3 magic_file.3
33 MLINKS+= libmagic.3 magic_buffer.3
34 MLINKS+= libmagic.3 magic_getflags.3
35 MLINKS+= libmagic.3 magic_setflags.3
36 MLINKS+= libmagic.3 magic_check.3
37 MLINKS+= libmagic.3 magic_compile.3
38 MLINKS+= libmagic.3 magic_list.3
39 MLINKS+= libmagic.3 magic_load.3
40 MLINKS+= libmagic.3 magic_load_buffers.3
41 MLINKS+= libmagic.3 magic_setparam.3
42 MLINKS+= libmagic.3 magic_getparam.3
43 MLINKS+= libmagic.3 magic_version.3
45 CLEANFILES+= magic magic.mgc libmagic.3
47 FILES= magic magic.mgc
48 FILESDIR= ${SHAREDIR}/misc
50 MAGFILES= ${MAGICDIR}/Header ${MAGICDIR}/Localstuff \
51 ${MAGICDIR}/Magdir/[a-z]*
53 libmagic.3: ${CONTRIBDIR}/../doc/libmagic.man
54 sed -e s@__CSECTION__@1@g \
55 -e s@__FSECTION__@5@g \
56 -e s@__MAGIC__@${MAGIC}@g ${.ALLSRC} > ${.TARGET}
58 magic: ${MAGFILES}
59 cat ${.ALLSRC} > ${.TARGET}
61 magic.mgc: mkmagic.nx magic
62 ./mkmagic.nx magic
64 CLEANFILES+= mkmagic.nx
65 build-tools: mkmagic.nx
67 NXCFLAGS+= -w -DCOMPILE_ONLY
68 mkmagic.nx: apprentice.c encoding.c cdf_time.c funcs.c magic.c print.c ${INCS}
69 ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC:N*.h} ${NXLDLIBS} -o ${.TARGET}
71 CLEANFILES+= ${INCS}
72 .for inc in ${INCS}
73 ${inc}: ${inc}.in
74 sed -e 's,X.YY,${VER:S,",,g:S,.,,g},g' ${.ALLSRC} > ${.TARGET}
75 .endfor
77 .include <bsd.lib.mk>