CC	      = gcc

CFLAGS	      = -O2

DEST	      = .

EXTHDRS	      =

HDRS	      = cm.h \
		errors.h \
		help.h \
		keycodes.h \
		names.h \
		ne.h \
		protos.h \
		regex.h \
		termchar.h \
		version.h

INSTALL	      = /etc/install

LD	      = gcc

LDFLAGS	      = 

LIBS	      = /usr/lib/libcurses.a

MAKEFILE      = Makefile

OBJS	      = actions.o \
		alloca.o \
		buffer.o \
		clips.o \
		cm.o \
		command.o \
		display.o \
		edit.o \
		errors.o \
		exec.o \
		hash.o \
		help.o \
		inputclass.o \
		keys.o \
		menu.o \
		names.o \
		navigation.o \
		ne.o \
		prefs.o \
		regex.o \
		request.o \
		search.o \
		signals.o \
		streams.o \
		support.o \
		term.o \
		undo.o

PRINT	      = pr

PROGRAM       = ne

SHELL	      = /bin/sh

SRCS	      = actions.c \
		alloca.c \
		buffer.c \
		clips.c \
		cm.c \
		command.c \
		display.c \
		edit.c \
		errors.c \
		exec.c \
		hash.c \
		help.c \
		inputclass.c \
		keys.c \
		menu.c \
		names.c \
		navigation.c \
		ne.c \
		prefs.c \
		regex.c \
		request.c \
		search.c \
		signals.c \
		streams.c \
		support.c \
		term.c \
		undo.c

all:		$(PROGRAM)

$(PROGRAM):     $(OBJS) $(LIBS)
		@echo "Linking $(PROGRAM) ..."
		@$(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
		@echo "done"

clean:;		@rm -f $(OBJS) core

clobber:;	@rm -f $(OBJS) $(PROGRAM) core tags

depend:;	@mkmf -f $(MAKEFILE) ROOT=$(ROOT)

echo:;		@echo $(HDRS) $(SRCS)

index:;		@ctags -wx $(HDRS) $(SRCS)

install:	$(PROGRAM)
		@echo Installing $(PROGRAM) in $(DEST)
		@-strip $(PROGRAM)
		@if [ $(DEST) != . ]; then \
		(rm -f $(DEST)/$(PROGRAM); $(INSTALL) -f $(DEST) $(PROGRAM)); fi

print:;		@$(PRINT) $(HDRS) $(SRCS)

tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)

update:		$(DEST)/$(PROGRAM)

$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
		@$(MAKE) -f $(MAKEFILE) ROOT=$(ROOT) DEST=$(DEST) install
###
actions.o: ne.h	keycodes.h names.h errors.h protos.h version.h

buffer.o: ne.h keycodes.h names.h errors.h protos.h

clips.o: ne.h keycodes.h names.h errors.h protos.h

cm.o: cm.h

command.o: ne.h keycodes.h names.h errors.h protos.h help.h

display.o: ne.h keycodes.h names.h errors.h protos.h termchar.h

edit.o: ne.h keycodes.h names.h errors.h protos.h

errors.o: errors.h

exec.o: ne.h keycodes.h names.h errors.h protos.h

inputclass.o: ne.h keycodes.h names.h errors.h protos.h

keys.o: ne.h keycodes.h names.h errors.h protos.h

menu.o: ne.h keycodes.h names.h errors.h protos.h

navigation.o: ne.h keycodes.h names.h errors.h protos.h

ne.o: ne.h keycodes.h names.h errors.h protos.h version.h regex.h

prefs.o: ne.h keycodes.h names.h errors.h protos.h

regex.o: regex.h 

request.o: ne.h keycodes.h names.h errors.h protos.h

search.o: ne.h keycodes.h names.h errors.h protos.h regex.h

signals.o: ne.h keycodes.h names.h errors.h protos.h

streams.o: ne.h keycodes.h names.h errors.h protos.h

support.o: ne.h keycodes.h names.h errors.h protos.h

term.o: termchar.h cm.h

undo.o: ne.h keycodes.h names.h errors.h protos.h
