#
# Makefile for xdiscuss
# $Source: /afs/sipb.mit.edu/project/discuss/.cvsroot/discuss/source/xdsc/Makefile,v $
# $Id: Makefile,v 1.2 1992/06/26 02:25:20 raeburn Exp $
#

VPATH=/mit/discuss/source/xdsc

SRCS=	main.c windows.c strdup.c buttons.c mtg.c Meeting.c version.c
OBJS=	main.o windows.o strdup.o buttons.o mtg.o Meeting.o version.o

# need newer version of com_err library than Athena has installed
DLIBS=	-L../lib -ldsk -lusp -lkrb -ldes -lcom_err
XLIBS= -lXaw -lXext -lXmu -lXt -lX11
# for profiling:
#DLIBS= -L../lib -ldsk_p -lusp_p -lkrb_p -ldes_p -lcom_err_p
#XLIBS=	-lXaw_p -lXmu_p -lXt_p -lX11_p
LIBDIRS=
LIBS=	${LIBDIRS} ${XLIBS} ${DLIBS}

# NOTE: For x11r5, you may need "-Dconst=" because some of the prototypes
# that should use this are lacking it.  Also, -DNOSTDHDRS might be
# helpful.
R5OPTS= -Dconst= -DNOSTDHDRS

# for vax (or any gcc-supporting platform):
#CC=	gcc -finline-functions
#COPTS=	-O -g
# for rt, until gcc 2 is available:
CC=	hc2 -Hon=READ_ONLY_STRINGS -Hnocpp $(R5OPTS)
COPTS=	-O
# for decstation (cc), again until gcc2:
#COPTS=	-O2 -g3

PROF= # -pg
DEFS=
INCS=	-I../include -I. -I../../source/xdsc
CFLAGS=	${COPTS} ${DEFS} ${INCS} ${PROF}

CFILES=	${SRCS}

all:	xdiscuss

clean:
	-rm -f *.o *~ *.bak a.out xdiscuss

# this rule modified to cut nfs lossage...
xdiscuss: ${OBJS}
	if [ -r xdiscuss ]; then mv -f xdiscuss xdiscuss.old; else true ; fi
	${CC} -o /tmp/xdiscuss ${CFLAGS} ${OBJS} ${LIBS} ${PROFOBJS}
	mv -f /tmp/xdiscuss xdiscuss

saber_load: ${SRCS}
	#suppress 318
	#suppress 226 in stuff.h
	#suppress 275
	#load -G ${DLIBS}
	#load ${XLIBS}
	#load ${CFLAGS} ${SRCS}

lint:
	lint ${CFLAGS} ${SRCS} ${LIBS}

foo:	foo.o
	${CC} -o foo ${CFLAGS} foo.o ${LIBDIRS} ${XLIBS}

Toggle.o : Toggle.c
Viewport.o : Viewport.c

tags: TAGS

TAGS: ${CFILES}
	etags ${CFILES}

SABER=saber
SABEROPTS=-G

# run from source directory
saber:
	${SABER} ${SABEROPTS} -L../../$(MACHINE)/lib ${LIBS} ${INCS} ${SRCS}

gsaber:
	saber ${SABEROPTS} ${INCS} ${SRCS} goo.o

# 'make depend' code
depend:
	makedepend -s'# DO NOT DELETE THIS LINE' ${CFLAGS} ${CFILES}

#	-rm -f eddep makedep
#	${CC} -M ${CFLAGS} ${CFILES} > makedep
#	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
#	echo '$$r makedep' >>eddep
#	echo 'w' >>eddep
#	-rm -f Makefile.bak
#	cp Makefile Makefile.bak
#	ed - Makefile < eddep
#	rm -f eddep makedep

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

