#	Makefile for Project Athena On-Line Consulting System (OLC)
#
#	$Header: Makefile,v 1.12 88/02/03 19:40:05 kubitron Exp $
#	$Source: /source/4.3/usr.athena/olc/src/RCS/Makefile,v $
#	$Author: kubitron $
# 

#
# 		Copyright IBM Corporation 1987
# 
#                       All Rights Reserved
# 
# Permission to use, copy, modify, and distribute this software and its 
# documentation for any purpose and without fee is hereby granted, 
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in 
# supporting documentation, and that the name of IBM not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.  
# 
# IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
# IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.

#				/* ANDREW_ Definitions */

ANDREW_SRCDIR=/site/andrew/vax/
ANDREW_XDIR=/usr

ANDREW_WINDOWDEFINES=-DX
ANDREW_WINDOWINCLUDES=-I/usr/include/X11
ANDREW_WINDOWLIBS=${ANDREW_SRCDIR}lib/libcwm.a ${ANDREW_SRCDIR}lib/libcmenu.a ${ANDREW_XDIR}/lib/liboldX.a  ${ANDREW_XDIR}/lib/libX11.a 

ANDREW_LIBPATH = ${ANDREW_SRCDIR}lib/be2

ANDREW_LIBS = ${ANDREW_LIBPATH}/libframe.a ${ANDREW_LIBPATH}/libtext.a ${ANDREW_LIBPATH}/libsupportviews.a ${ANDREW_LIBPATH}/libsupport.a ${ANDREW_LIBPATH}/libbasics.a ${ANDREW_SRCDIR}lib/libclass.a ${ANDREW_WINDOWLIBS} ${ANDREW_SRCDIR}lib/liberrors.a  ${ANDREW_SRCDIR}lib/libplumber.a ${ANDREW_SRCDIR}lib/libutil.a

ANDREW_INCLUDES=-I. -I${ANDREW_SRCDIR}include/be2 -I${ANDREW_SRCDIR}include ${ANDREW_WINDOWINCLUDES}

ANDREW_CLASSFLAGS=${ANDREW_INCLUDES}
ANDREW_CFLAGS= ${ANDREW_WINDOWDEFINES} ${ANDREW_INCLUDES}

ANDREW_OLC_SOURCES = olcWindow.c editWindow.c panelWindow.c panel.c buttons.c titleBar.c
ANDREW_OLCR_SOURCES = olcrWindow.c editWindow.c panelWindow.c panel.c buttons.c titleBar.c

ANDREW_OLC_OBJECTS = olcWindow.o editWindow.o panelWindow.o panel.o buttons.o titleBar.o
ANDREW_OLCR_OBJECTS = olcrWindow.o editWindow.o panelWindow.o panel.o buttons.o titleBar.o

ANDREW_SOURCES = ANDREW_OLC_SOURCES ANDREW_OLCR_SOURCES
ANDREW_OBJECTS = ANDREW_OLC_OBJECTS ANDREW_OLC_OBJECTS

#				/* OLC Definitions */

OLCR_SOURCES = olcr.c io.c olc_utils.c olcr_commands.c
OLC_SOURCES = olc.c olc_commands.c io.c olc_utils.c

OLCR_OBJECTS = olcr.o io.o olc_utils.o olcr_commands.o
OLC_OBJECTS = olc.o olc_commands.o io.o olc_utils.o

SOURCES = ${OLCR_SOURCES} ${OLC_SOURCES}
OBJECTS = ${OLCR_OBJECTS} ${OLC_OBJECTS}
PROGS	= olc olcr
LIBS	= -lhesiod -ldbm -lcom_err
CFLAGS	= -g -DHESIOD -DX ${ANDREW_INCLUDES}
LINT_OPTS = -hbauv

.SUFFIXES: .ih .eh .H		

.H.ih:
	class ${ANDREW_CLASSFLAGS} $*.H
.H.eh:
	class ${ANDREW_CLASSFLAGS} $*.H

all:	${PROGS}

TAGS:	${SOURCES} ${ANDREW_SOURCES} 
	-etags ${SOURCES} ${ANDREW_SOURCES}

olcr:	olcrWindow.ih editWindow.ih panelWindow.ih panel.ih buttons.ih titleBar.ih ${OLCR_OBJECTS} ${ANDREW_OLCR_OBJECTS} ${ANDREW_LIBS} olc_contextdep.h olccommon.h olcr.h
	cc ${CFLAGS} -o $@ ${OLCR_OBJECTS} ${ANDREW_OLCR_OBJECTS} ${LIBS} ${ANDREW_LIBS} -lm


olc:	olcWindow.ih editWindow.ih panelWindow.ih panel.ih buttons.ih titleBar.ih ${OLC_OBJECTS} ${ANDREW_OLC_OBJECTS} ${ANDREW_LIBS} olc_contextdep.h olccommon.h olc.h
	cc ${CFLAGS} -o $@ ${OLC_OBJECTS} ${ANDREW_OLC_OBJECTS} ${LIBS} ${ANDREW_LIBS} -lm

olcWindow.o:    olcWindow.eh editWindow.ih panelWindow.ih panel.ih buttons.ih titleBar.ih olc_utils.o olc_contextdep.h olccommon.h olc.h

olcrWindow.o:    olcrWindow.eh editWindow.ih panelWindow.ih panel.ih buttons.ih titleBar.ih olc_utils.o olc_contextdep.h olccommon.h olcr.h

editWindow.o:	editWindow.eh buttons.ih titleBar.ih

panelWindow.o:	panelWindow.eh panel.ih buttons.ih titleBar.ih

buttons.o: 	buttons.eh

titleBar.o: 	titleBar.eh

olcWindow.ih:
olcWindow.eh:

olcrWindow.ih:
olcrWindow.eh:

editWindow.ih:
editWindow.eh:

panelWindow.ih:
panelWindow.eh:

panel.ih:
panel.eh:

buttons.ih:
buttons.eh:

titleBar.ih:
titleBar.eh:

clean:	
	rm -f ${PROGS} *.o *.bak *~ \#* core TAGS

# 'make depend' code
CFILES=	${SOURCES}
COPTS=	${CFLAGS}

depend: ${CFILES}
	${CC} -M ${COPTS} ${CFILES} | \
	sed -e ':loop' \
	    -e 's/\.\.\/[^ /]*\/\.\./../' \
	    -e 't loop' | \
	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
		       else rec = rec " " $$2 } } \
	      END { print rec } ' > makedep
	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	cp Makefile Makefile.bak
	ex - Makefile < eddep
	rm eddep makedep
#
# the last constant line in the makefile should be...
# DO NOT DELETE THIS LINE

