1 # Makefile for file(1) cmd.
2 # Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
3 # @(#)$Header: /pub/NetBSD/misc/repositories/cvsroot/src/usr.bin/file/Attic/Makefile.ian,v 1.1 1993/03/21 09:54:53 cgd Exp $
8 DEFS = -DMAGIC='"$(MAGIC)"' # -Dvoid=int
10 CFLAGS = $(COPTS) $(DEFS)
12 OFILE = /bin/file.orig # old or distributed version, for comparison
13 # Where new binary lives; typically /usr/local (BSD), /usr/lbin (USG).
15 # For installing our man pages;
16 # MANCxxx is manual section for Commands, MANFxxx is section for file formats.
17 # MANxDIR is directory names; MANxEXT is the filename extention. Usual values:
18 # Variable V7 4BSD Sys V
19 # MANCDIR /usr/man/man1 /usr/man/man1 /usr/man/u_man/man1
20 # MANFDIR /usr/man/man5 /usr/man/man5 /usr/man/u_man/man4
23 # --- possible alternative for 4BSD ---
24 # MANCDIR /usr/man/manl
26 # --- possible alternative for USG ---
27 # MANCDIR /usr/man/local/man1
30 MANCDIR = /usr/man/manl
31 MANFDIR = /usr/man/man5
35 # There are no system-dependant configuration options (except maybe CFLAGS).
36 # Delete any of LOCALSRCS and LOCALOBJS that are in your C library.
37 LOCALSRCS = getopt.c strtol.c strtok.c strchr.c
38 SRCS = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c is_tar.c \
40 #LOCALOBJS = getopt.o strtol.o strtok.o strchr.o
41 LOCALOBJS = # getopt.o strtol.o strtok.o strchr.o
42 OBJS = file.o apprentice.o fsmagic.o softmagic.o ascmagic.o is_tar.o \
45 ALLSRC = LEGAL.NOTICE README PORTING $(SRCS) *.h \
46 Makefile file.1 magic.4 magdir/[a-z]* tst/Makefile
52 time $(OFILE) -m ./magic * tst/* >/tmp/t1
53 time ./file -m ./magic * tst/* >/tmp/t2
55 what ./file >lastnocore
58 $(CC) $(CFLAGS) $(OBJS) -o $@
60 lint -ha $(DEFS) $(SRCS) | tee $@
62 # exclude RCS or SCCS dirs:
67 apprentice.o ascmagic.o file.o fsmagic.o print.o softmagic.o: file.h
69 install: file magic file.1 magic.4 $(BINDIR) $(MANCDIR) $(MANCDIR)
70 cp file $(BINDIR)/file
72 cp file.1 $(MANCDIR)/file.$(MANCEXT)
73 cp magic.4 $(MANFDIR)/magic.$(MANFEXT)
76 rm -f *.o file magic lint.out
80 # Some versions of shar can't handle a single file from
81 # a subdirectory, so we manually insert mkdir as needed.
82 # Put the extra "mkdir" AFTER the ": to unbundle..." line.
83 $(SHAR) $(ALLSRC) | sed -e '1a\