# @(#) $Revision: 72.1 $
#
# common build makefile for ied
#

OBJS		= ied.o emacs.o history.o vi.o edit.o
SRCS		= ied.c edit.c emacs.c history.c vi.c hpux_rel.c
HDRS		= edit.h def.h history.h terminal.h
MISC		= makefile
DELIVERABLES	= ied ied.1 README README.keymap dvorak.layout \
		  table.dvorak table.identity

default: ied

metrics: ied.M

ied: version.o $(OBJS)
	$(CC) $(LFLAGS) version.o $(OBJS) -o $@

ied.M: version.c $(SRCS)
	$(METRICS) $(LFLAGS) version.c $(SRCS) -o $@

version.c: hpux_rel.c
	sed -e '/e_version/s/$$Revision: //' \
	    -e '/e_version/s/ $$ \$$Date:/ /' \
	    -e '/e_version/s/ ..:..:.. $$"/"/' <hpux_rel.c >version.c

deliver: ied
	shar $(DELIVERABLES) > ied.shar

source:
	shar $(DELIVERABLES) $(SRCS) $(HDRS) $(MISC) > ied.source.shar

emacs.o: defs.h edit.h history.h

history.o: defs.h history.h

vi.o: defs.h edit.h history.h terminal.h

edit.o: defs.h edit.h history.h terminal.h

ied.o: defs.h edit.h

clean:
	rm -f *.o

clobber: clean
	rm -f ied ied.shar ied.source.shar ied.M
