]> granicus.if.org Git - file/commitdiff
Some changes from John Gilmore.
authorIan Darwin <ian@darwinsys.com>
Sun, 23 Aug 1987 20:53:06 +0000 (20:53 +0000)
committerIan Darwin <ian@darwinsys.com>
Sun, 23 Aug 1987 20:53:06 +0000 (20:53 +0000)
My cleanups to his changes and to other rules.

src/Makefile

index 2d73011ef081c3ee848a545556ce0e8f0cf639e5..3ab87e1872d4fb880dff42795da3ce0da831175c 100644 (file)
@@ -1,12 +1,17 @@
 # Makefile for file(1) cmd. Copyright (c) Darwin 86/09/01 - see LEGAL.NOTICE.
 
-DEFS = # -Dvoid=int
-CFLAGS = -O $(DEFS)
-OTHERS = darwin!ian    # people to whom we mail updates
-FILE=/usr/bin/file.sun # old version or system-provided command, for comparison
-
-# There are no system-dependant configuration options (except maybe CFLAGS);
-# you may delete some of LOCALSRCS and LOCALOBJS if they're in your C library.
+MAGIC  = /etc/magic
+DEFS   = -DMAGIC='"$(MAGIC)"' # -Dvoid=int
+COPTS  = -O # -g
+CFLAGS = $(COPTS) $(DEFS)
+SHAR   = bundle
+OTHERS = darwin!ian            # people to whom we mail updates
+OFILE  = /usr/bin/file.orig    # old or distributed version, for comparison
+BINDIR = /usr/local            # where new binary lives
+MANDIR = /usr/man/local        # for our man pages
+
+# There are no system-dependant configuration options (except maybe CFLAGS).
+# Delete some of LOCALSRCS and LOCALOBJS if they're in your C library.
 LOCALSRCS = strtol.c strtok.c
 SRCS = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c is_tar.c \
        print.c $(LOCALSRCS)
@@ -17,8 +22,11 @@ OBJS = file.o apprentice.o fsmagic.o softmagic.o ascmagic.o is_tar.o \
 ALLSRC = LEGAL.NOTICE README PORTING TODO $(SRCS) *.h \
        Makefile file.[15] magdir tst/Makefile
 
-run:           file magic
-               time $(FILE) -m ./magic * tst/* >/tmp/t1
+all:           file magic
+
+run:           all
+               cd tst; make
+               time $(OFILE) -m ./magic * tst/* >/tmp/t1
                time ./file -m ./magic * tst/* >/tmp/t2
                diff -b /tmp/t[12]
 
@@ -33,9 +41,19 @@ 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)/man1
+               cp file.5 $(MANDIR)/man5
+
+clean:
+               rm -f *.o file magic errs lintout
+               (cd tst; make clean)
+
 dist:          $(ALLSRC)
-               (echo mkdir tst; bundle $(ALLSRC)) | \
-                       mailx -s 'semi-public-domain file(1)' $(OTHERS)
+               $(SHAR) $(ALLSRC) >dist
+               touch update    # kludge
 update:                $(ALLSRC)
-               (echo mkdir tst; bundle $?; echo touch $@) | mail $(OTHERS)
+               (echo mkdir tst; $(SHAR) $?; echo touch $@) | mail $(OTHERS)
                touch $@