# @(#)Makefile	1.8 9/12/93 (UKC)
#
#  To build xvt for one of the supported architectures:
#
#  1.  Uncomment the appropriate ARCH= line below
#
#  2.  Comment out the SITE=UKC line unless this is UKC
#
#  3.  write out the edited Makefile and type 'make config'
#
#  4.  look at the Makefile and check that the uncommented options
#      seem sensible.  If you want to use a different C compiler
#      or different libraries or include files then edit the Makefile
#      by hand.
#
#  5.  Type make depend (if your system has makedepend(1) installed).
#
#  6.  Type make
#
######################################################################
#
# Supported architectures.  Only one of these lines should be uncommented.
#
ARCH=SUNOS4
#ARCH=SUNOS5
#ARCH=OSF1
#ARCH=AIX3
#ARCH=ULTRIX
#ARCH=HPUX
#ARCH=LINUX
#
#
# If this line is uncommented then `Make config' will unclude several options
# that are probably only wanted at UKC.
#
#SITE=UKC
#
#
# Directories to install the binary and the manual page
#
BIN=/usr/local/X11
MANDIR=/usr/local/man/man1
#
######################################################################
#
# Lines in this section are automatically commented or uncommented
# by running `make config'.  Edit them by hand if the configured
# options are not appropriate.
#
#
# Enable the code that allows xvt to provide a Hex encoded Magic Cookie
# for inclusion in a .Xauthority file.  
#
#MAGIC_COOKIE=-DMAGIC_COOKIE				#SITE UKC
#
#
# Needed for the Magic Cookie code but not otherwise.
#
#AUTHLIB=-lXau						#SITE UKC
#
#
# Enable code that can make use of the UKC locations database.  This
# is almost obsolete, even at UKC, and totally useless anywhere else.
#
#UKC_LOCATIONS=-DUKC_LOCATIONS				#SITE UKC
#
#
# Enable some extra debugging code
#
#DEBUG=-DDEBUG						#SITE UKC
#
#OPTIONS=$(MAGIC_COOKIE) $(DEBUG)			#ARCH SUNOS5 OSF1 AIX3 ULTRIX LINUX
OPTIONS=$(MAGIC_COOKIE) $(UKC_LOCATIONS) $(DEBUG)	#ARCH SUNOS4
#
# Additional architecture dependent defines
#
# add lines and columns to environment - delays startup
#
#DEFS=-DLC_ENV						#ARCH HPUX
#
# Additional directories to search for include files.  These may need
# modifying if you have local include directories.
#
#ANSI_INCLUDE=-I/usr/local/lib/ansi-include		#SITE UKC
INCLUDE=$(ANSI_INCLUDE)					#ARCH SUNOS4
#INCLUDE=-I/usr/openwin/include				#ARCH SUNOS5
#INCLUDE=-I/usr/include/X11R5				#ARCH HPUX
#
#
# Any architecture dependent libraries or library search paths.
#
#LIB=-lnsl $(AUTHLIB)					#ARCH SUNOS5
LIB=$(AUTHLIB)						#ARCH SUNOS4 OSF1 AIX3 ULTRIX LINUX
#LDFLAGS=-i -R /usr/openwin/lib -L /usr/openwin/lib	#ARCH SUNOS5
#LDFLAGS=-L/usr/lib/X11R5				#ARCH HPUX
#
#
# The C compiler 
#
#CC=gcc -g -ansi -Wall -Wmissing-prototypes		#SITE UKC
#CC=cc							#ARCH OSF1 AIX3 HPUX ULTRIX
#
# End of automatically configured options.
#
######################################################################
#
OBJ=xvt.o xsetup.o command.o screen.o sbar.o ttyinit.o
SRC=xvt.c xsetup.c command.c screen.c sbar.c ttyinit.c
#
CFLAGS=-O $(INCLUDE) $(OPTIONS) $(DEFS) -D$(ARCH)
#
xvt: $(OBJ)
	$(CC) $(LDFLAGS) -o xvt $(OBJ) $(LIB) -lX11

install: $(BIN)/xvt $(MANDIR)/xvt.1

$(MANDIR)/xvt.1: xvt.1
	cp xvt.1 $@
	chmod 0644 $@

$(BIN)/xvt: xvt
	cp xvt $@.new
	strip $@.new
	chown root $@.new
	chmod 04755 $@.new
	mv $@.new $@

clean:
	rm -f $(OBJ) xvt

tags:	$(SRC)
	ctags $(SRC)

config:
	./cmake ARCH $(ARCH) < Makefile | ./cmake SITE $(SITE) >Makefile.new
	mv Makefile Makefile.old
	mv Makefile.new Makefile

depend:
	makedepend -- $(CFLAGS) -- $(SRC)

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