1 # $DragonFly: src/lib/libmagic/Makefile,v 1.18 2007/03/25 07:50:50 sephe Exp $
3 CONTRIBDIR
= ${.CURDIR
}/..
/..
/contrib
/file-4
/src
4 MAGICDIR
= ${CONTRIBDIR}/..
/magic
7 MAGIC
= /usr
/share
/misc
/magic
12 SRCS
= apprentice.c apptype.c ascmagic.c compress.c fsmagic.c funcs.c\
13 is_tar.c magic.c
print.c readelf.c softmagic.c file.h.no_obj.patch
16 LIBMAGIC_CDEFS
= -DHAVE_CONFIG_H
-DMAGIC
=\"${MAGIC}\"
17 CFLAGS
+= ${LIBMAGIC_CDEFS}
18 CFLAGS
+= -I
${.CURDIR
} -I
${CONTRIBDIR}
22 MLINKS
+= libmagic
.3 magic_open
.3
23 MLINKS
+= libmagic
.3 magic_close
.3
24 MLINKS
+= libmagic
.3 magic_error
.3
25 MLINKS
+= libmagic
.3 magic_errno
.3
26 MLINKS
+= libmagic
.3 magic_file
.3
27 MLINKS
+= libmagic
.3 magic_buffer
.3
28 MLINKS
+= libmagic
.3 magic_setflags
.3
29 MLINKS
+= libmagic
.3 magic_check
.3
30 MLINKS
+= libmagic
.3 magic_compile
.3
31 MLINKS
+= libmagic
.3 magic_load
.3
33 CLEANFILES
+= magic magic.mgc magic.mime.mgc magic.mime.lnk libmagic
.3
35 FILES
= magic magic.mgc
${MAGICDIR}/magic.mime magic.mime.mgc
36 FILESDIR
= /usr
/share
/misc
38 MAGFILES
= ${MAGICDIR}/Header
${MAGICDIR}/Localstuff\
39 ${MAGICDIR}/Magdir
/[a-z
]*
41 libmagic
.3: ${CONTRIBDIR}/..
/doc
/libmagic.man libmagic.man.patch
42 patch
-o
- ${.ALLSRC
} | \
43 sed
-e s@__CSECTION__@
1@g \
44 -e s@__FSECTION__@
5@g \
45 -e s@__MAGIC__@
${MAGIC}@g
> ${.TARGET
}
47 all: ${LIB} magic.mgc magic.mime.mgc
50 cat
${.ALLSRC
} > ${.TARGET
}
52 magic.mgc
: mkmagic.nx magic
55 magic.mime.mgc
: mkmagic.nx
${MAGICDIR}/magic.mime
56 .
/mkmagic.nx
${MAGICDIR}/magic.mime
58 CLEANFILES
+= mkmagic.nx
59 build-tools
: mkmagic.nx
61 NXCFLAGS
= ${LIBMAGIC_CDEFS} -DCOMPILE_ONLY
-I
${.OBJDIR
} -I-
-I
${.CURDIR
} -I
${CONTRIBDIR}
62 NXCFLAGS
+= -DBOOTSTRAPPING
63 mkmagic.nx
: file.h apprentice.c funcs.c magic.c
print.c
64 ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC
} ${NXLDLIBS} -o
${.TARGET
}