# Makefile for simple curses-based menu interface.
#
# $Id: Makefile,v 1.3 90/10/06 01:28:02 lee Rel1-10 $

PWD=menu

# PERFORMANCE makes curses go faster
EXTRA=-I../h -DPERFORMANCE
OPT=-O -g
DEFS= -DASCIITRACE -UBSD -DSYSV
WHICHDBM=sdbm
# change the next three lines to be the same as the lq-text definitions.
DBMLIBS=$(LIBDIR)/libsdbm.a
BCOPY=bcopy.o
# DBMLIBS=-lndbm -linet # 386/ix with hbtcpip provides a good bcopy()

CFLAGS= $(OPT) $(DEFS) -UBSD -DSYSV $(GCCF) -D$(WHICHDBM) $(EXTRA)
CC=/usr/5bin/cc
# TERMCAP=-L/usr/5lib -lcurses -ltermlib
TERMCAP=-lcurses -ltermcap
RANLIB=ranlib

TEXT=lqtext
PROG=m # a simple example of using the library...
PROGOBJS=example.o
PROGSRC=example.c
LIBDIR=../lib
BINDIR=../bin
LIAMLIB=$(LIBDIR)/liblq.a $(LIBDIR)/liblqerror.a
LQTEXTLIB=$(LIBDIR)/liblqtext.a
MENULIB=liblqmenu.a

PROGS=$(PROG) $(TEXT) # removed by make clean

OBJS=menu.o error.o stringbox.o OldCurses.o
SRCS=menu.c error.c stringbox.c OldCurses.c

all: $(TEXT) # m

install: $(MENULIB) $(TEXT)
	cp $(MENULIB) $(LIBDIR)/$(MENULIB)
	cp $(TEXT) $(BINDIR)/$(TEXT)
	strip $(BINDIR)/$(TEXT)

$(TEXT): text.o $(LQTEXTLIB) $(LIAMLIB) $(MENULIB) $(BCOPY)
	$(CC) $(CFLAGS) -o $(TEXT) text.o $(BCOPY) \
	$(MENULIB) $(LQTEXTLIB) $(DBMLIBS) $(LIAMLIB) $(TERMCAP)

$(MENULIB): $(OBJS)
	rm -f $(MENULIB)
	ar rv $(MENULIB) $(OBJS)
	$(RANLIB) $(MENULIB)

$(PROG): $(PROGOBJS)
	$(CC) $(CFLAGS) -o $(PROG) $(OBJS) $(PROGOBJS) $(BCOPY) $(TERMCAP)

lint$(PROG): $(OBJS) $(SRCS) $(PROGSRCS)
	lint $(CFLAGS) $(SRCS) $(TERMCAP) 2>&1 | tee lint$(PROG)

# Tidy should leave the final executables, but otherwise remove all
# generated files
tidy:
	/bin/rm -f *.o core make.log .mk m.log

# Clean should revert to a distribution state as far as possible
clean:
	/bin/rm -f *.o core *.a $(PROGS) $(CHARGEN) make.log .mk m.log

text.o: text.c
	$(CC) $(CFLAGS) $(TEXTINC) -c text.c


depend:
	chmod +w Makefile
	mkdep $(CFLAGS) *.c

#
# $Log:	Makefile,v $
# Revision 1.3  90/10/06  01:28:02  lee
# deleted mkdep output.
# 
# Revision 1.2  90/10/01  20:33:09  lee
# Added BSD compatibility hooks and improved "make clean".
# 
# Revision 1.1  90/08/29  21:48:48  lee
# Initial revision
# 
# Revision 2.1  89/08/07  13:52:22  lee
# First fully working release; this is the basis for all
# future development.
# 
# Revision 1.2  89/08/04  17:59:23  lee
# Fully working with Basic Functionality.
# Scrolling menubar, scrolling menus, moveable Info windows.
# 
# Revision 1.1  89/07/27  11:41:39  lee
# Initial revision
#
 
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
