# Makefile for elvis
#
# Several groups of Makefile settings are included below.  Choose *ONE* group
# of settings for your particular system, and leave the others commented out.
# The meanings of these settings are:
#	EXTRA	version-specific object files used in elvis
#	CC	the C compiler command, possibly with "memory model" flags
#	CFLAGS	compiler flags used to select compile-time options
#	PROGS	the list of all programs
#	SORT	if the "tags" file must be sorted, then SORT=-DSORT

PROGS=	elvis ctags ref elvrec fmt elvprsv

#---- These settings are recommended for Minix-PC ----
#EXTRA=	tinytcap.o tinyprnt.o
CFLAGS=	-O -w -D_POSIX_SOURCE -D_MINIX -DCRUNCH \
	-DNO_MKEXRC -DNO_CURSORSHAPE -DNO_CHARATTR -DNO_SHOWMODE \
	-DNO_MODELINE -DNO_OPTCOLS -DNO_DIGRAPH -DNO_EXTENSIONS \
	-DNO_ERRLIST -DNO_FKEY -DNO_VISIBLE -DNO_COLOR -DNO_POPUP -DTERMIOS
CC= mcc

#---- These settings are recommended for Minix-ST ----
#EXTRA=
#CFLAGS=

###########################################################################
###     The rest of this Makefile contains no user-serviceable parts    ###
###########################################################################

OBJ=blk.o cmd1.o cmd2.o ctype.o curses.o cut.o ex.o input.o main.o misc.o \
   modify.o move1.o move2.o move3.o move4.o move5.o opts.o recycle.o \
   redraw.o regexp.o regsub.o system.o tio.o tmp.o unix.o vars.o vcmd.o vi.o

all:	$(PROGS)

elvis:	$(OBJ)
	$(CC) $(LDFLAGS) -o elvis -S 18kw $(OBJ)


ctags:	ctags.o
	$(CC) $(LDFLAGS) -o ctags -S 4kw ctags.o

ctags.o: ctags.c
	$(CC) $(CFLAGS) $(SORT) -c ctags.c

ref:	ref.o
	$(CC) $(LDFLAGS) -o ref -S 4kw ref.o

elvrec:	elvrec.o
	$(CC) $(LDFLAGS) -o elvrec -S 4kw elvrec.o

fmt:	fmt.o
	$(CC) $(LDFLAGS) -o fmt -S 4kw fmt.o

elvprsv:	elvprsv.o ctype.o
	$(CC) $(LDFLAGS) -o elvprsv -S 4kw elvprsv.o ctype.o

# Dependencies
$(OBJ):	vi.h curses.h config.h regexp.h ctype.h

clean:	
	rm -f *.o ctags ref elvrec fmt elvprsv elvis
