]> granicus.if.org Git - file/commitdiff
*** empty log message ***
authorIan Darwin <ian@darwinsys.com>
Tue, 6 Oct 1987 20:15:39 +0000 (20:15 +0000)
committerIan Darwin <ian@darwinsys.com>
Tue, 6 Oct 1987 20:15:39 +0000 (20:15 +0000)
README
doc/file.man
src/Makefile
src/PORTING

diff --git a/README b/README
index 178a8a623fad1dfe63db9b2cb925279c1380a47a..a4beb2efa477e56e7844069329b63668d96b9cba 100644 (file)
--- a/README
+++ b/README
@@ -20,8 +20,13 @@ in magic(4) format please(!), to the  author, Ian Darwin,
 LEGAL.NOTICE - read this first.
 README - read this second (you are currently reading this file).
 PORTING - read this next.
-Makefile - read this next, fix it if needed, type "make"
-       to compile, "make test" to try it (expect some diffs!).
+Makefile - read this next, adapt it as needed (particularly
+       the man page layouts), type "make" to compile, 
+       "make test" to try it out against your old version.
+       Expect some diffs, particularly since your original
+       file(1) may not grok the imbedded-space ("\ ") in
+       the current magic file, or may even not use the
+       magic file.
 apprentice.c - parses /etc/magic to learn magic
 ascmagic.c - third & last set of tests, based on hardwired assumptions.
 core - not included in distribution due to mailer limitations.
@@ -36,5 +41,6 @@ is_tar.c - knows about tarchives (courtesy of John Gilmore).
 magdir - directory of /etc/magic pieces
 names.h - header file for ascmagic.c
 softmagic.c - 2nd set of tests, based on /etc/magic
-strtok.c - in case you need it (from Henry Spencer).
-strtol.c - in case you need it
+strtok.c, getopt.c - in case you them (courtesy of Henry Spencer).
+strtol.c, strchr.c - in case you need them - public domain.
+tst - simple test suite, built from tst/Makefile
index f41b1d5a852f353417fc8f0cbe369d774de1c75b..abd8c26de31c0b23338d330ce885141643b38376 100644 (file)
@@ -120,7 +120,7 @@ to test the standard input, use ``-'' as a filename argument.
 .I /etc/magic
 \- default list of magic numbers
 .SH SEE ALSO
-.IR File (5)
+.IR Magic (FILES)
 \- description of magic file format.
 .br
 .IR Strings (1), " od" (1)
index 9f8f6c9e572c3455290f333cddc8b0451c01879c..ae2c487446e24648644a813e9ee07f3d5e070ff1 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for file(1) cmd. 
 # Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
-# @(#)$Header: /home/glen/git/file/cvs/file/src/Attic/Makefile,v 1.10 1987/09/18 21:45:51 ian Exp $
+# @(#)$Header: /home/glen/git/file/cvs/file/src/Attic/Makefile,v 1.11 1987/10/06 20:15:52 ian Exp $
 #
 # This software is not subject to any license of the American Telephone
 # and Telegraph Company or of the Regents of the University of California.
@@ -27,22 +27,35 @@ DEFS        = -DMAGIC='"$(MAGIC)"' # -Dvoid=int
 COPTS  = -O # -g
 CFLAGS = $(COPTS) $(DEFS)
 SHAR   = bundle
-OFILE  = /usr/bin/file.orig    # old or distributed version, for comparison
+OFILE  = /usr/bin/file.sun     # old or distributed version, for comparison
 # Where new binary lives; typically /usr/local (BSD), /usr/lbin (USG).
-BINDIR = /usr/local
-# For installing our man pages; typically MANDIR is /usr/man/man1 (BSD)
-# or /usr/man/local (USG). MAN?EXT is [15] on BSD, l for BSD if
-# installing in /usr/man/manl (for local), [14] on USG.
-MANDIR = /usr/man/local
-MAN1EXT        = 1
-MAN4EXT        = 4
+BINDIR = /usr/local/bin
+# For installing our man pages; 
+# MANCxxx is manual section for Commands, MANFxxx is section for file formats.
+# MANxDIR is directory names; MANxEXT is the filename extention. Usual values:
+# Variable     V7              4BSD            Sys V
+# MANCDIR      /usr/man/man1   /usr/man/man1   /usr/man/u_man/man1
+# MANFDIR      /usr/man/man5   /usr/man/man5   /usr/man/u_man/man4
+# MANCEXT      1               1               1
+# MANFEXT      5               5               4
+# --- possible alternative for 4BSD ---
+# MANCDIR                      /usr/man/manl
+# MANCEXT                      l
+# --- possible alternative for USG ---
+# MANCDIR                      /usr/man/local/man1
+# MANCEXT                      1
+
+MANCDIR        = /usr/man/manl
+MANFDIR        = /usr/man/man5
+MANCEXT        = l
+MANFEXT        = 5
 
 # There are no system-dependant configuration options (except maybe CFLAGS).
-# Delete some of LOCALSRCS and LOCALOBJS if they're in your C library.
-LOCALSRCS = getopt.c strtol.c strtok.c
+# Delete any of LOCALSRCS and LOCALOBJS that are in your C library.
+LOCALSRCS = getopt.c strtol.c strtok.c strchr.c
 SRCS = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c is_tar.c \
        print.c $(LOCALSRCS)
-LOCALOBJS = getopt.o strtol.o strtok.o
+LOCALOBJS = getopt.o strtol.o strtok.o strchr.o
 OBJS = file.o apprentice.o fsmagic.o softmagic.o ascmagic.o is_tar.o \
        print.o $(LOCALOBJS)
 
@@ -51,7 +64,7 @@ ALLSRC = LEGAL.NOTICE README PORTING $(SRCS) *.h \
 
 all:           file magic
 
-test:          all
+test:          all $(OFILE)
                cd tst; make
                time $(OFILE) -m ./magic * tst/* >/tmp/t1
                time ./file -m ./magic * tst/* >/tmp/t2
@@ -70,15 +83,20 @@ ascmagic.o: names.h
 
 apprentice.o ascmagic.o file.o fsmagic.o print.o softmagic.o: file.h
 
-install:       all
-               cp file $(BINDIR)/file
-               cp magic $(MAGIC)
-               cp file.1 $(MANDIR)/$(MAN1EXT)
-               cp magic.4 $(MANDIR)/$(MAN4EXT)
+install:       file magic file.1 magic.4 $(BINDIR) $(MANCDIR) $(MANCDIR)
+               cp file         $(BINDIR)/file
+               cp magic        $(MAGIC)
+               cp file.1       $(MANCDIR)/file.$(MANCEXT)
+               cp magic.4      $(MANFDIR)/magic.$(MANFEXT)
 
 clean:
                rm -f *.o file magic lint.out
                (cd tst; make clean)
 
 dist:          $(ALLSRC)
-               (echo mkdir magdir tst; $(SHAR) $(ALLSRC) ) >$@
+#              Some versions of shar can't handle a single file from
+#              a subdirectory, so we manually insert mkdir as needed.
+#              Put the extra "mkdir" AFTER the ": to unbundle..." line.
+               $(SHAR) $(ALLSRC) | sed -e '1a\
+               mkdir magdir tst' >$@
+
index e33c3814a3c03f0153e902c932b5fe067e3a94e4..b885340529e28c9146e9a822fbd0ac4f77b72fd4 100644 (file)
@@ -6,12 +6,13 @@ to un-comment-out the definition of `void=int' in the Makefile.
 
 I had hoped to be able to make a file command that
 didn't have any system-dependant #ifdefs, no special libraries,
-etc., etc. Well, System V shot me down. They moved the definition
-of major() and minor() out of <sys/types.h> into <sys/sysmacros.h>.
-So, if major isn't defined after including types.h, I AUTOMATICALLY
-include sys/sysmacros.h. ONLY if you have a system in which neither
-types.h nor sysmacros.h defines `major' will this automatic include
-fail. On such systems, you will get a compilation
+etc., etc. I went to some lengths to include all the non-portable
+library routines I used (getopt, str*).  Well, System V shot me down.
+They moved the definition of major() and minor() out of <sys/types.h>
+into <sys/sysmacros.h>.  So, if major isn't defined after including types.h,
+I AUTOMATICALLY include sys/sysmacros.h. ONLY if you have a system in which 
+neither types.h nor sysmacros.h defines `major' will this automatic include
+fail (I hope). On such systems, you will get a compilation
 error in trying to compile a warning message. Please do the following:
        1) change the appropriate (2nd) #include at the start of 
                fsmagic.c