#
# Copyright 1994, Cray Research, Inc.
#                 
# Permission to use, copy, modify and distribute this software and
# its accompanying documentation (the "Software") is granted without
# fee, provided that the above copyright notice and this permission
# notice appear in all copies of the Software and all supporting
# documentation, and the name of Cray Research, Inc. not be used in
# advertising or publicity pertaining to distribution of the 
# Software without the prior specific, written permission of Cray
# Research, Inc.  The Software is a proprietary product of Cray
# Research, Inc., and all rights not specifically granted by this
# license shall remain in Cray Research, Inc.  No charge may be made
# for the use or distribution of the Software.  The Software may be
# distributed as a part of a different product for which a fee is
# charged, if (i) that product contains or provides substantial
# functionality that is additional to, or different from, the
# functionality of the Software, and (ii) no separate, special or
# direct charge is made for the Software.
#         
# THE SOFTWARE IS MADE AVAILABLE "AS IS", AND ALL EXPRESS AND
# IMPLIED WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF FITNESS
# FOR A PARTICULAR PURPOSE, MERCHANTABILITY, AND FREEDOM FROM
# VIOLATION OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, ARE HEREBY
# DISCLAIMED AND EXCLUDED BY CRAY RESEARCH, INC.  CRAY RESEARCH,
# INC. WILL NOT BE LIABLE IN ANY EVENT FOR ANY CONSEQUENTIAL,
# SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES ARISING OUT OF OR IN
# CONNECTION WITH THE PERFORMANCE OF THE SOFTWARE OR ITS USE BY ANY
# PERSON, OR ANY FAILURE OR NEGLIGENCE ON THE PART OF CRAY RESEARCH,
# INC., EXCEPT FOR THE GROSS NEGLIGENCE OR WILLFUL MISCONDUCT OF
# CRAY RESEARCH.
# 
# This License Agreement shall be governed by, and interpreted and
# construed in accordance with, the laws of the State of Minnesota,
# without reference to its provisions on the conflicts of laws, and
# excluding the United Nations Convention of the International Sale
# of Goods.
#
#	$Id: Makefile,v 1.3 1995/06/04 18:11:03 prb Exp prb $
#
LIB=	Cvo
X11DIR=	/usr/X11
LIBDIR=	${X11DIR}/lib
INCDIR=	${X11DIR}/include/Cvo
LEVEL=	1.0.1a
NOPROFILE=

SRCS+= Accelerator.cc Action.cc Application.cc Arrows.cc AssociatedData.cc
SRCS+= Base.cc BasicButton.cc BasicObject.cc Blank.cc Buffer.cc Button.cc
SRCS+= ButtonMenu.cc CRT.cc Chamfer.cc Chart.cc ChartGraphs.cc
SRCS+= ChartHorizontal.cc ChartVertical.cc Color.cc Configure.cc Confirm.cc
SRCS+= Create.cc Cursor.cc DiscoverWindow.cc Ev.cc EvSignal.cc Event.cc
SRCS+= Exit.cc ExpandPage.cc Failure.cc FdSet.cc FileMatch.cc FilePage.cc
SRCS+= FileProto.cc FileView.cc Font.cc Frame.cc GC.cc GenericList.cc Help.cc
SRCS+= HelpDisplay.cc HelpParse.cc HoldWindow.cc I18N.cc IconGroup.cc
SRCS+= Image.cc ImageButton.cc Inform.cc Input.cc InputContext.cc InputOnly.cc
SRCS+= InputRing.cc InputViewPort.cc Iwin.cc Label.cc LabelMatrix.cc Layout.cc
SRCS+= LayoutWindow.cc List.cc MainLoop.cc Mark.cc Matrix.cc MatrixViewPort.cc
SRCS+= Menu.cc MenuBar.cc MenuEntry.cc MenuLabel.cc MenuSession.cc Modal.cc
SRCS+= MonoColors.cc Move.cc NullLayout.cc Object.cc OpenFile.cc OptionMenu.cc
SRCS+= Output.cc Page.cc Paint.cc PaintViewPort.cc PeelOff.cc Picture.cc
SRCS+= Pin.cc PinUp.cc Pixmap.cc PixmapChamfer.cc PopupLayout.cc PrintEvent.cc
SRCS+= Protocols.cc Quarks.cc Radio.cc RadioBox.cc Raise.cc Register.cc
SRCS+= Resource.cc RootedList.cc ScrollBar.cc SelfLayout.cc Separator.cc
SRCS+= Selection.cc Shell.cc StandardLayout.cc Text.cc TextAttribute.cc
SRCS+= TextBoard.cc TextLine.cc TextPage.cc TextViewPort.cc Toggle.cc
SRCS+= TopLevelLayout.cc Translation.cc Tree.cc TreeViewPort.cc Vi.cc
SRCS+= ViewPort.cc Window.cc WindowViewPort.cc XImage.cc
SRCS+= RdBitF.c debug.cc util.cc pty.cc version.c

HDRS+=	Accelerator.h++ Application.h++ Base.h++ BasicButton.h++ BasicObject.h++
HDRS+=	Blank.h++ Buffer.h++ Button.h++ ButtonMenu.h++ CONSTRUC.h++ CRT.h++
HDRS+=	Chart.h++ Color.h++ Confirm.h++ Cursor.h++ Debug.h++ Default.h++
HDRS+=	Errors.h++ Ev.h++ EventTypes.h++ ExpandPage.h++ FdSet.h++ FilePage.h++
HDRS+=	FileProto.h++ FileView.h++ Font.h++ Frame.h++ GenericList.h++ Help.h++
HDRS+=	HelpDisplay.h++ HelpParse.h++ HoldWindow.h++ IconGroup.h++ Image.h++
HDRS+=	ImageButton.h++ Inform.h++ Input.h++ InputContext.h++ InputOnly.h++
HDRS+=	InputRing.h++ InputViewPort.h++ Iwin.h++ Label.h++
HDRS+=	LabelMatrixViewPort.h++ Layout.h++ LayoutWindow.h++ List.h++ Lock.h++
HDRS+=	MWM.h++ Mark.h++ Matrix.h++ MatrixViewPort.h++ Menu.h++ MenuBar.h++
HDRS+=	MenuLabel.h++ MenuSession.h++ Modal.h++ Object.h++ OpenFile.h++
HDRS+=	OptionMenu.h++ Output.h++ Page.h++ Paint.h++ PaintViewPort.h++
HDRS+=	PeelOff.h++ Picture.h++ Pin.h++ PinUp.h++ Pixmap.h++ Protocols.h++
HDRS+=	Quarks.h++ Radio.h++ RadioBox.h++ Registration.h++ RootedList.h++
HDRS+=	ScrollBar.h++ Separator.h++ Shell.h++ Text.h++ TextAttribute.h++
HDRS+=	TextBoard.h++ TextLine.h++ TextPage.h++ TextViewPort.h++ TimeVal.h++
HDRS+=	Toggle.h++ ToolTalk.h++ Translation.h++ Tree.h++ TreeViewPort.h++
HDRS+=	Types.h++ Vi.h++ ViewPort.h++ Window.h++ WindowViewPort.h++ XImage.h++
HDRS+=	_Includes.h++ _Machine.h++ _ctype.h
HDRS+=	convert.h++ cray_logo.h cray_logo.xpm peel_off.h pin.h util.h++

CLEANFILES+=	version.c confidence confidence.o

.PATH:	${.CURDIR}/src

FLAGS+=	-I${.CURDIR}
FLAGS+=	-I/usr/X11/include

C++FLAGS+=	${FLAGS}
CFLAGS+=	${FLAGS}

# OBJS+=  ${SRCS:R:S/$/.o/g}

# lib${LIB}.a: $(OBJS) version.o
#	ar Trl lib${LIB}.a $(OBJS) version.o
#	ranlib lib${LIB}.a


version.c:
	date "+static char version[] = \"USMID @(#)Cvo_version ${LEVEL}	%m/%d/%y %H:%M:%S Cvo.${LEVEL}\";" > version.c

version.o:	version.c
	${CC} -c version.c
#	rm -f version.c

confidence:     confidence.o
	${C++C} -o confidence confidence.o -L/usr/X11/lib -L. -lCvo -lX11 -lm

.cc.o .c++.o .cxx.o .C.o:
	${C++C} ${C++FLAGS} -c ${.IMPSRC}

afterinstall:
	if [ ! -d ${DESTDIR}${INCDIR} ]; then mkdir -p ${DESTDIR}${INCDIR}; fi
	chown ${LIBOWN}.${LIBGRP} ${DESTDIR}${INCDIR}
	cd ${.CURDIR}/Cvo; install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 555 \
		${HDRS} ${DESTDIR}${INCDIR}

PAXFILES= README Cvo Makefile grot src util
DOCFILES= Documentation Examples

pax:
	cd ${.CURDIR}; pax -w -s ',.*/RCS.*,,' ${PAXFILES} | \
		gzip > Cvo.${LEVEL}.src.pax.gz
	cd ${.CURDIR}; pax -w -s ',.*/RCS.*,,' ${DOCFILES} | \
		gzip > Cvo.${LEVEL}.doc.pax.gz
	(cd ${DESTDIR}${X11DIR} ; pax -w lib/libCvo.a include/Cvo) | \
		gzip > ${.CURDIR}/Cvo.${LEVEL}.bsdos.pax.gz


.include <bsd.lib.mk>
