Subversion Repositories planix.SVN

Rev

Rev 108 | Rev 115 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#
# Copyright (c) 1980 Regents of the University of California.
# All rights reserved.  The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
#       @(#)Makefile    7.13.1.3 (2.11BSD GTE) 1996/10/23
#
# Changes for newer systems by Gunnar Ritter, May 2000
#
VERSION=3.7
#
# NB: This makefile doesn't indicate any dependencies on header files.
#
# Ex is very large - this version will not fit on PDP-11's without overlay
# software.  Things that can be turned off to save
# space include LISPCODE (-l flag, showmatch and lisp options), CHDIR (the 
# undocumented chdir command.)  VMUNIX makes ex considerably larger, raising 
# many limits and improving speed and simplicity of maintenance.  It is 
# suitable only for a VAX or other large machine, and then probably only in 
# a paged system.
#
# Don't define VFORK unless your system has the VFORK system call,
# which is like fork but the two processes have only one data space until the
# child execs. This speeds up ex by saving the memory copy.
#
# If your system expands tabs to 4 spaces you should -DTABS=4 below
#
BINDIR = bin
DESTDIR = /usr/local
DEBUGFLAGS=     -DTRACE -g
NONDEBUGFLAGS=  -O0
DEB=    $(NONDEBUGFLAGS)        # or $(DEBUGFLAGS) to to debug
# this should be correct for any modern Unix
OPTIONS=-DLISPCODE -DCHDIR -DFASTTAG -DUSG3TTY -DVMUNIX -DBIGMEM -D_BSD_EXTENSION -DTRACE
# define to use ISO-8859-X character sets
#OPTIONS += -DISO
LDFLAGS=
TERMLIB = -ltermcap

# That's it.

CFLAGS= $(OPTIONS) $(DEB) -DUSG3TTY -DVMUNIX -g
INCLUDE=/usr/include
OBJS=   ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
        ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
        ex_set.o ex_subr.o ex_tagio.o ex_temp.o ex_tty.o ex_unix.o \
        ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o 

HDRS=   ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
SRC1=   ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
SRC2=   ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
SRC3=   ex_set.c ex_subr.c ex_tagio.c ex_temp.c ex_tty.c ex_unix.c
SRC4=   ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
SRC5=   ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
SRC6=   printf.c expreserve.c exrecover.c

all: ex

ex: $(OBJS)
        $(CC) -o ex $(LDFLAGS) $(OBJS) $(TERMLIB)

$(OBJS): $(HDRS)

ex_vars.h:
        csh makeoptions $(CFLAGS)

clean:
        cd termcap && make clean
#       If we dont have ex we cant make it so don't rm ex_vars.h
        -rm -f ex *.o x*.[cs] core errs trace

# install in standard place
install: ex
        rm -f $(DESTDIR)/$(BINDIR)/ex
        rm -f $(DESTDIR)/$(BINDIR)/edit
        rm -f $(DESTDIR)/$(BINDIR)/vi
        rm -f $(DESTDIR)/$(BINDIR)/view
        install -s -m 1755 ex $(DESTDIR)/$(BINDIR)/ex
        ln -s $(DESTDIR)/$(BINDIR)/ex $(DESTDIR)/$(BINDIR)/edit
        ln -s $(DESTDIR)/$(BINDIR)/ex $(DESTDIR)/$(BINDIR)/vi
        ln -s $(DESTDIR)/$(BINDIR)/ex $(DESTDIR)/$(BINDIR)/view
        rm -f $(DESTDIR)/man/man1/vi.1
        rm -f $(DESTDIR)/man/man1/ex.1
        rm -f $(DESTDIR)/man/man1/edit.1
        install -m 644 vi.1 $(DESTDIR)/man/man1/vi.1
        install -m 644 ex.1 $(DESTDIR)/man/man1/ex.1
        ln -s $(DESTDIR)/man/man1/ex.1 $(DESTDIR)/man/man1/edit.1