#
#	Prototype Makefile for 9term
#
#	define operating system.  ONE of:
#		-DIRIX -DSUNOS -DUMIPS -DSYSVR3 -DAIX -DOSF1
#		-DHPUX -DAPOLLO -DCONVEX -DDYNIX
#	
#	Additionally, -D_POSIX_SOURCE (or its equivalent) may be specified
#	if your compiler supports posix-compatible compilation
#
#	Define RISCOS for Mips RISC/os
#	Define BSDPTYS for BSD-style pty support
#	Define POSIXPTYS for POSIX ptys
OS=-DSOLARIS

# where we'll install it
BINDIR=/usr/pgrad/matty/bin/$(cputype)

HEADERFILE=9term.h
TARGET=9term
INCLUDES=-I. -I../include -I/usr/openwin/include
CFLAGS=-g $(OS) $(INCLUDES) -fno-builtin -D_LIBXG_EXTENSION
LDFLAGS=-g -R/usr/openwin/lib -L/usr/openwin/lib -R/usr/ucblib -L/usr/ucblib
CC=gcc

# change this if your X11 libraries are in different places
# or if you need extra libraries to load with X11 applications
LIBS=../libtext/libtext.a ../libframe/libframe.a ../libXg/libXg.a
XLIBS=-lXt -lX11

OBJECTS=9term.o command.o display.o pty.o

$(TARGET): $(OBJECTS)
	$(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(XLIBS) -lm -lucb

wloc: wloc.o
	$(CC) $(LDFLAGS) -o wloc wloc.o $(LIBS) $(XLIBS) -lm

label: wloc
	ln wloc label

unicode: unicode.o
	$(CC) $(LDFLAGS) -o unicode unicode.o $(LIBS) $(XLIBS) -lm

install: $(TARGET) wloc label
	cp $(TARGET) $(BINDIR)
	chown root $(BINDIR)/$(TARGET)
	chmod 04755 $(BINDIR)/$(TARGET)
	mv wloc $(BINDIR)
	mv label $(BINDIR)
	mv unicode $(BINDIR)

clean:
	rm -f *.o core

nuke: clean
	rm -f $(TARGET) wloc label unicode

$(OBJECTS): 9term.h
