# SCCSID = "@(#)Makefile.hp	1.1	6/15/87"
#
#	XToolkit Makefile
#
#

DESTDIR=
DEPEND=../makedepend/makedepend
INCLUDES= -I../include
# LIBDIR is used to define the location of the system .XtActions file
LIBDIR=/usr/lib/
HDRDIR=/usr/include/X/Xt
OPTFLAG=
CFLAGS= ${OPTFLAG} ${INCLUDES} -DLIBDIR=\"${LIBDIR}\"
CCPROFILED= ${CC} -pg
XLIB= ../Xlib/libX.a
NOP= /bin/true
MOVE= /bin/mv
AWK=/bin/awk
EX=/usr/ucb/ex
CPP=../cpp/
GET= sccs get
EVERYTHING= SCCS

#.SUFFIXES:	.c .o
#
#.c.o:
#	${CCPROFILED} ${CFLAGS} -c $*.c
#	${MOVE} $*.o profiled/$*.o
#	${CC} ${CFLAGS} -c $*.c

SRCS = \
	Actions.c \
	Alloc.c \
	ArgList.c \
	AsciiSink.c \
	Boolean.c \
	ButtonBox.c \
	Command.c \
	Context.c \
	Conversion.c \
	Cursors.c \
	Dialog.c \
	DiskSrc.c \
	Error.c \
	Event.c \
	Form.c \
	Geometry.c \
	Init.c \
	Label.c \
	Menu.c \
	ParseCmd.c \
	Quarks.c \
	Resources.c \
	SendEvent.c \
	Scroll.c \
	ScrollMgr.c \
	ScrollWin.c \
	StringSrc.c \
	Text.c \
	TextActs.c \
	TextKinds.c \
	VPane.c \
	Xrm.c \
	XrmConvert.c


OBJ = \
	Actions.o \
	Alloc.o \
	ArgList.o \
	AsciiSink.o \
	Boolean.o \
	ButtonBox.o \
	Command.o \
	Context.o \
	Conversion.o \
	Cursors.o \
	Dialog.o \
	DiskSrc.o \
	Error.o \
	Event.o \
	Form.o \
	Geometry.o \
	Init.o \
	Label.o \
	Menu.o \
	ParseCmd.o \
	Quarks.o \
	Resources.o \
	SendEvent.o \
	Scroll.o \
	ScrollMgr.o \
	ScrollWin.o \
	StringSrc.o \
	Text.o \
	TextActs.o \
	TextKinds.o \
	VPane.o \
	Xrm.o \
	XrmConvert.o

HP_OBJ= HP/CascadeItem.o HP/TitleBar.o

all:	libXt.a

debug:
	make ${MFLAGS} libXt.a OPTFLAG=-g CCPROFILED=${NOP} MOVE=${NOP}

#all:	libXt.a libXt_p.a libXt.cursors

libXt.a:	${OBJ} hp
	rm -f libXt.a
	ar cr libXt.a ${OBJ} ${HP_OBJ}

libXt_p.a:	${OBJ} hp
	rm -f libXt_p.a
	cd profiled; ar cr ../libXt_p.a ${OBJ} ${HP_OBJ}

hp:
	(cd HP; make OPTFLAG=$(OPTFLAG) LIBDIR=$(LIBDIR); cd ..)

libXt.cursors: CursorCreate
	CursorCreate `cd ../cursors;/bin/ls *.cursor|grep -v _mask.cursor|sed -n 's/.cursor//p'`

CursorCreate: CursorCreate.c libXt.a
	${CC} ${CFLAGS} -o CursorCreate CursorCreate.c libXt.a ${XLIB}

lint:
	lint -u ${INCLUDES} ${SRCS}

install: all
	@rm -rf ${DESTDIR}${HDRDIR}
	@mkdir ${DESTDIR}${HDRDIR}
	@chmod 755 ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Atoms.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Intrinsic.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Xtlib.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 ButtonBox.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Boolean.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Command.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Dialog.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Form.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Label.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Menu.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Scroll.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 Text.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 TextDisp.h ${DESTDIR}${HDRDIR}
	../install -c -m 0644 VPane.h ${DESTDIR}${HDRDIR}
	(cd HP; ../../install -c -m 0644 Toolkit_hp.h ${DESTDIR}${HDRDIR}; cd ..)
	../install -c -m 0644 libXt.a ${DESTDIR}/usr/lib
	../install -c -m 0644 .XtActions ${DESTDIR}${LIBDIR}
#	install -c -m 0644 libXt.cursors ${DESTDIR}/usr/lib
#	install -c -m 0644 libXt_p.a ${DESTDIR}/usr/lib
#	@ranlib ${DESTDIR}/usr/lib/libXt_p.a

headers:

clobber:
	rm -f *.*.* \#* *~ *.bak *.BAK *.CKP *.s *.o libXt.a errs \
	profiled/*

#cleansources:
#	rm -f *.h *.c Makefile .XtActions

#sources: 
#	${GET} ${EVERYTHING}

#get:
#	co -q RCS/*

buildtree:
	@echo ${WHEREAMI} `pwd`
	mkdir profiled

depend:
	@chmod ugo+w Makefile
	${DEPEND} -v -I. ${CFLAGS} ${SRCS}
	@chmod ugo-w Makefile

# DO NOT DELETE THIS LINE -- make depend depends on it.

