summaryrefslogtreecommitdiffstats
path: root/usr.bin/file/Makefile
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-11-26 22:19:56 +0000
committerobrien <obrien@FreeBSD.org>2000-11-26 22:19:56 +0000
commit734ffeb5ee37368fd8302a978e5b5bece2534cdb (patch)
tree2e026e339edb762c417e7b8451de762377f171ed /usr.bin/file/Makefile
parent92a7efc5b66e70b5180fb33be1040e6c6de7b660 (diff)
downloadFreeBSD-src-734ffeb5ee37368fd8302a978e5b5bece2534cdb.zip
FreeBSD-src-734ffeb5ee37368fd8302a978e5b5bece2534cdb.tar.gz
Use the vendor's manpages (which are in old -man format) rather than
our modified one based on a much older version of the vendor's manpage.
Diffstat (limited to 'usr.bin/file/Makefile')
-rw-r--r--usr.bin/file/Makefile20
1 files changed, 16 insertions, 4 deletions
diff --git a/usr.bin/file/Makefile b/usr.bin/file/Makefile
index 5fc7b1bd..9c00d58 100644
--- a/usr.bin/file/Makefile
+++ b/usr.bin/file/Makefile
@@ -24,13 +24,13 @@
#
# Hacked and dismembered for bmake (Geoff Rehmet).
-MAGICDIR= /usr/share/misc/magic
+MAGICFILE= /usr/share/misc/magic
MAGICMODE= 444
SRCDIR= ${.CURDIR}/../../contrib/file
.PATH: ${SRCDIR}
-CFLAGS+= -DMAGIC='"$(MAGICDIR)"' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H
+CFLAGS+= -DMAGIC='"$(MAGICFILE)"' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H
CFLAGS+= -I${.CURDIR}
PROG= file
@@ -41,7 +41,7 @@ SRCS= file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
MAN1= file.1
MAN5= magic.5
-CLEANFILES+= magic
+CLEANFILES+= magic file.1 magic.5 version
MAGFILES= ${SRCDIR}/Header\
${SRCDIR}/Localstuff\
@@ -52,8 +52,20 @@ all: file magic
magic: $(MAGFILES)
cat $(MAGFILES) > $(.TARGET)
+version: Makefile.std
+ @sed '/.*VERSION.*=[ ]*/s///w ${.TARGET}' ${.ALLSRC} > /dev/null
+
+.for MP in file.1 magic.5
+${MP}: ${SRCDIR}/${MP:C/[0-9]$/man/} version
+ sed -e 's|__CSECTION__|1|g'\
+ -e 's|__FSECTION__|5|g'\
+ -e 's|__MAGIC__|${MAGICFILE}|g'\
+ -e "s|__VERSION__|`cat version`|g"\
+ ${SRCDIR}/${MP:C/[0-9]$/man/} > ${.TARGET}
+.endfor
+
beforeinstall:
$(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \
- magic $(DESTDIR)$(MAGICDIR)
+ magic $(DESTDIR)$(MAGICFILE)
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud