# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
#
# The cpp used on this machine replaces all newlines and multiple tabs and
# spaces in a macro expansion with a single space.  Imake tries to compensate
# for this, but is not always successful.
#

SHELL=/bin/sh
MAKESHELL=/bin/sh

TOP = .
CWD = .
CONFIGSRC = /source/config
DESTDIR=

IRULESRC = $(CONFIGSRC)

IMAKE= imake
IFLAGS= -I$(IRULESRC) -DTOPDIR=/source
XIFLAGS= -I$(ATHXLIBDIR)/X11/config -DUseInstalled

ICONFIGFILE = ${IRULESRC}/Imake.tmpl ${IRULESRC}/Imake.rules \
	${IRULESRC}/site.def Imakefile
MKDIRHIER= sh $(IRULESRC)/mkdirhier.sh

ATHVERS = ${IRULESRC}/update.conf

ATHBASEDIR=/usr/athena

ATHLIBDIR=$(ATHBASEDIR)/lib
ATHBINDIR=$(ATHBASEDIR)/bin
ATHINCDIR=$(ATHBASEDIR)/include
ATHETCDIR=$(ATHBASEDIR)/etc
ATHCONFDIR=/etc/athena
ATHMANDIR=$(ATHBASEDIR)/man
ATHRBINDIR=/bin/athena
ATHRETCDIR=/etc/athena

ATHNEWDIR=$(ATHBINDIR)

ATHXAPPDIR=/usr/athena/lib/X11/app-defaults
ATHXBITDIR=/usr/athena/lib/X11/bitmaps
ATHXINCDIR=/usr/athena/include
ATHXLIBDIR=/usr/athena/lib

AFSDIR=/mit/afsuser/@sys

LINTCFLAG=-C
LINTFLAGS=$(DEFINES) -I/usr/athena/include

INSTALL=install -c
RANLIB=ranlib
CC=cc
LD=cc
AS=as
RM=rm -f
CDEBUG=-O2

CFLAGS=$(CDEBUG)  $(DEFINES) -I/usr/athena/include
LDFLAGS= $(LDDEFS)
LDPATH=-L$(ATHLIBDIR)
LDLIBS=

all::
install:: install_dirs
install_dirs::
install:: install.man
install.man::

clean::
depend::

FRC::

###########################################################################
# Project inclusion
###########################################################################

###########################################################################
# start of Imakefile
###########################################################################

# Makefile for Joe's Own Editor

###############
# Configuration
###############

# Uncomment one of the lines below to select
# which TTY structure your system uses:

TTY = -DBSDTTY

# Uncomment the second line below if your
# system has the 'setitimer' system call:

#TIM =
TIM = -DBSDTIMER

# Uncomment which ever addition include
# files you need in 'tty.c' to get the
# timer or the tty structure to work .
#
# SCO is for sys/stream.h and sys/ptem.h
# SYSPARAM is for sys/param.h
# SYSTIM is for sys/time.h
# TIM is for time.h

#IA = -DSCO
IA =
#IB = -DSYSPARAM
IB =
IC = -DSYSTIM
#IC =
#ID = -DTIM
ID =

# Uncomment the second line below if your
# system has the Xenix-style 'nap' system
# call:

CHK =
#CHK = -DXENIX

# Uncomment the second line below if your
# system is real BSD, and hence uses
# 'getwd' instead of 'getcwd':

#REAL =

# Uncomment the second line below if your
# POSIX system has 'sigaction', but not
# 'signal':

HARDER =
#HARDER = -DREALPOSIX

# Uncomment the method to make new session
# leaders (or none if you don't have joe control
# or ptys).  GRPCALL is for 'setpgrp(getpid(),0)'
# and SIDCALL is for 'setsid()'.  GRPCALL
# is supposed to be more portable, but
# 'SIDCALL' always works, if it's provided.

#PGRP = -DSIDCALL

PGRP = -DSIDCALL

# Set directory where ptys and corresponding ttys can be found

WHEREPTY = /dev/
WHERETTY = /dev/

# Set where you want joe to go and where you
# want joe's initialization file (joerc) to go:

WHERERC = /usr/sipb/lib
WHEREJOE = /usr/sipb/bin

# You may also have to add some additional
# defines to get the include files to work
# right on some systems.
#
# for newer HPUX systems, you need to add:  -D_HPUX_SOURCE

CFLAGS = -O9 \
 $(TTY) $(TIM) $(CHK) $(REAL) $(HARDER) $(PGRP) \
 $(IA) $(IB) $(IC) $(ID) \
 -DJOERC=\"$(WHERERC)/joerc\" \
 -DPTYPREFIX=\"$(WHEREPTY)\" \
 -DTTYPREFIX=\"$(WHERETTY)\"

# You may have to include some extra libraries
# for some systems
#
# for Xenix, add: -lx
#
# for some systems you might have to add: -lbsd
# to get enough BSD extensions to use -DBSDTIMER
# above (I think ESIX needs this)
#
# If you wish to use terminfo, you have to
# add '-ltinfo', '-lcurses' or '-ltermlib',
# depending on the system.

EXTRALIBS =

# Object files
#
# for systems with no 'opendir' (older SYS V)
# or confused 'opendir' (Xenix), add: olddir.o
#
# If you wish to use terminfo instead of
# termcap, replace 'termcap.o' below with 'terminfo.o'

OBJS = main.o termcap.o vfile.o pathfunc.o queue.o blocks.o vs.o va.o scrn.o \
       b.o bw.o tw.o pw.o help.o heap.o toomany.o queue.o zstr.o edfuncs.o \
       kbd.o w.o reg.o tab.o pattern.o random.o regex.o undo.o menu.o macro.o \
       poshist.o tty.o msgs.o qw.o

CC = gcc

# That's it!

all:: joe

joe: $(OBJS)
	$(CC) $(CFLAGS) -o joe $(OBJS) $(EXTRALIBS)

termidx: termidx.o
	$(CC) $(CFLAGS) -o termidx termidx.o

install:: joe termidx
	if [ ! -d $(WHEREJOE) ]; then mkdir $(WHEREJOE); chmod a+rx $(WHEREJOE); fi
	$(INSTALL) -s -m 755 joe $(WHEREJOE)
	if [ ! -d $(WHERERC) ]; then mkdir $(WHERERC); chmod a+rx $(WHERERC); fi
	$(INSTALL) -m 444 joerc $(WHERERC)
	$(INSTALL) -m 444 joe.1 /usr/sipb/man/man1
clean::
	rm -f $(OBJS) termidx.o *~ *.bak

Makefile:: $(ICONFIGFILE)
	-@if [ -f Makefile ]; then \
	echo "  $(RM) Makefile.bak; mv Makefile Makefile.bak"; \
	$(RM) Makefile.bak; mv Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE) $(IFLAGS) $(IPROJ) -DNEWTOP=$(TOP) -DNEWCWD=$(CWD)

XMakefile::
	-@if [ -f Makefile ]; then \
	echo "  $(RM) Makefile.bak; mv Makefile Makefile.bak"; \
	$(RM) Makefile.bak; mv Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE) $(XIFLAGS)

clean::
	rm -f *~ *.o *.a core a.out

Makefiles::

###########################################################################
# dependencies generated by makedepend

