#	Makefile for "mged" Multi-device COMGEOM Interactive Graphics Editor
#
# At present, GED operates on these types of display hardware:
#	dm-plot		any UNIX-plot filter
#	dm-vg		Vector General 3300
#	dm-mg		Megatek 7250
#	dm-tek		Tektronix 4014 and family
#	dm-tek4109	Tektronix 4109
#	dm-rat		Raster Tech One/80
#	dm-ps		E&S Picture System 300
#	dm-mer		Megatek Merlin 9200		[ Marginal ]
#	dm-ir		Silicon Graphics IRIS 2400,3030	(uses lib -lgl2)
#
# Mike Muuss, BRL.  12/16/83.
#

#PROFILE =  -pg		# uncomment this line to profile
LIBES	= -lm -lgl
#DEFINES	= -DBSD42
DEFINES =
CFLAGS	= -O $(DEFINES) $(PROFILE) $(ATTACH)
LDFLAGS	= -n $(PROFILE)

PRODUCT = mged

all:		${PRODUCT}

CAD_HEADERS =	../h/db.h ../h/vmath.h ../h/mater.h
GED_HEADERS = 	machine.h \
		ged_types.h ged.h menu.h dm.h sedit.h \
		vgdev.h mgdev.h

GED_CFILES	= ged.c vers.c dodraw.c dozoom.c titles.c \
		usepen.c dir.c columns.c path.c mover.c tedit.c \
		cmd.c chgview.c chgmodel.c chgtree.c anal.c typein.c \
		buttons.c mat.c clip.c menu.c adc.c edsol.c edarb.c \
		ars.c proc_reg.c   drawsol.c ellipse.c memalloc.c \
		spline.c mater.c plot.c inside.c \
		utility1.c utility2.c track.c arbs.c \
		attach.c dm-vg.c dm-mg.c dm-tek.c dm-plot.c dm-rat.c \
		dm-tek4109.c \
		dm-ir.c
###		dm-ps.c dm-ir.c dm-mer.c

GED_OBJS =	ged.o dodraw.o dozoom.o titles.o \
		usepen.o dir.o columns.o path.o mover.o tedit.o \
		cmd.o chgview.o chgmodel.o chgtree.o anal.o typein.o \
		buttons.o mat.o clip.o menu.o adc.o edsol.o edarb.o \
		ars.o proc_reg.o  drawsol.o ellipse.o memalloc.o \
		spline.o mater.o plot.o inside.o \
		utility1.o utility2.o track.o arbs.o \
		attach.o dm-vg.o dm-mg.o dm-tek.o dm-plot.o dm-rat.o \
		dm-tek4109.o \
		dm-ir.o
###		dm-ps.o dm-ir.o dm-mer.o

# All optional display managers to attach.  Must also be listed, above.
# ATTACH = -DDM_MER -DDM_PS -DDM_IR
ATTACH = -DDM_IR

BINDIR	= /usr/brl/bin
MANDIR	= /usr/man/man1
LINT	= /usr/5bin/lint
TESTDIR	= .
INS	= cp

mged:	${GED_OBJS}
	@sh newvers.sh
	@$(CC) -c vers.c
	$(CC) -o ${TESTDIR}/$@ ${LDFLAGS} ${GED_OBJS} ${LIBES} vers.o
	size ${TESTDIR}/$@

print:		${MAKEFIL} ${CAD_HEADERS} ${GED_HEADERS} ${GED_CFILES}
	( nroff -Tlp -man ${TESTDIR}/${PRODUCT}.1 ; \
	  pr ${MAKEFIL} ${CAD_HEADERS} ${GED_HEADERS} ${GED_CFILES} \
				${TESTDIR}/${PRODUCT}.1 )

lint:		${CAD_HEADERS} ${GED_HEADERS} ${GED_CFILES}
	$(LINT) ${DEFINES} ${ATTACH} ${GED_CFILES} ${LIBES} > ${PRODUCT}.lint

flow:		${CAD_HEADERS} ${GED_HEADERS} ${GED_CFILES}
	cflow ${GED_CFILES} > ${PRODUCT}.flow

xref:		${CAD_HEADERS} ${GED_HEADERS} ${GED_CFILES}
	cxref -c -s -w132 ${GED_CFILES} > ${PRODUCT}.xref

tags:	${CAD_HEADERS} ${GED_HEADERS} ${GED_CFILES}
	ctags ${CAD_HEADERS} ${GED_HEADERS} ${GED_CFILES}

compare:	all
	cmp ${BINDIR}/${PRODUCT} ${TESTDIR}/${PRODUCT}
	cmp ${MANDIR}/${PRODUCT}.1 ${TESTDIR}/${PRODUCT}.1

install:	all
	mv -f ${BINDIR}/${PRODUCT} ${BINDIR}/${PRODUCT}.bak
	cp ${TESTDIR}/${PRODUCT} ${BINDIR}
	chmod 555 ${BINDIR}/${PRODUCT}
	chmod 644 ../dist/h/*.h
	cp ${CAD_HEADERS} ../dist/h/.
	cp Makefile *.sh *.h *.c ../dist/ged/.
#	${INS} ${TESTDIR}/${PRODUCT}.1 ${MANDIR}/${PRODUCT}.1
#	chmod 644 ${MANDIR}/${PRODUCT}.1

clean:
	rm -f ${GED_OBJS} *~ core

clobber:	clean
	rm -f ${TESTDIR}/${PRODUCT}

#
#  #include dependencies
#
depend:
	for k in $(GED_CFILES); do \
		i=`basename $$k .c`; \
		(echo $$i.o: $$i.c >>makedep; \
		grep '^#[ 	]*include' /dev/null $$i.c | sed \
			-e 's,c:[^"]*"\./\([^"]*\)".*,o: \1,' \
			-e 's,c:[^"]*"/\([^"]*\)".*,o: /\1,' \
			-e 's,c:[^"]*"\([^"]*\)".*,o: \1,' \
			-e 's,c:[^<]*<\(.*\)>.*,o: /usr/include/\1,' \
			>>makedep); done
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	cp Makefile Makefile.bak
	ed - Makefile < eddep
	rm eddep makedep
	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	echo '# see make depend above' >> Makefile

# DO NOT DELETE THIS LINE  -- make depend uses it

ged.o: ged.c
ged.o: /usr/include/stdio.h
ged.o: /usr/include/fcntl.h
ged.o: /usr/include/signal.h
ged.o: /usr/include/time.h
ged.o: /usr/include/setjmp.h
ged.o: machine.h
ged.o: ../h/vmath.h
ged.o: ged.h
ged.o: solid.h
ged.o: ../h/db.h
ged.o: sedit.h
ged.o: dm.h
vers.o: vers.c
dodraw.o: dodraw.c
dodraw.o: machine.h
dodraw.o: ../h/vmath.h
dodraw.o: ../h/db.h
dodraw.o: ged.h
dodraw.o: solid.h
dodraw.o: objdir.h
dodraw.o: dm.h
dozoom.o: dozoom.c
dozoom.o: machine.h
dozoom.o: ../h/vmath.h
dozoom.o: ged.h
dozoom.o: solid.h
dozoom.o: ../h/db.h
dozoom.o: sedit.h
dozoom.o: /usr/include/math.h
dozoom.o: dm.h
titles.o: titles.c
titles.o: machine.h
titles.o: ../h/vmath.h
titles.o: ged.h
titles.o: solid.h
titles.o: objdir.h
titles.o: ../h/db.h
titles.o: sedit.h
titles.o: /usr/include/math.h
titles.o: dm.h
usepen.o: usepen.c
usepen.o: /usr/include/math.h
usepen.o: machine.h
usepen.o: ../h/vmath.h
usepen.o: ../h/db.h
usepen.o: ged.h
usepen.o: solid.h
usepen.o: menu.h
usepen.o: dm.h
usepen.o: sedit.h
dir.o: dir.c
dir.o: /usr/include/fcntl.h
dir.o: /usr/include/stdio.h
dir.o: /usr/include/string.h
dir.o: /usr/include/signal.h
dir.o: machine.h
dir.o: ../h/vmath.h
dir.o: ../h/db.h
dir.o: ged.h
dir.o: solid.h
dir.o: objdir.h
dir.o: dm.h
columns.o: columns.c
columns.o: /usr/include/stdio.h
columns.o: ../h/db.h
columns.o: objdir.h
path.o: path.c
path.o: /usr/include/stdio.h
path.o: machine.h
path.o: ../h/vmath.h
path.o: ../h/db.h
path.o: solid.h
path.o: objdir.h
path.o: ged.h
mover.o: mover.c
mover.o: /usr/include/string.h
mover.o: machine.h
mover.o: ../h/vmath.h
mover.o: ../h/db.h
mover.o: ged.h
mover.o: objdir.h
mover.o: solid.h
tedit.o: tedit.c
tedit.o: /usr/include/stdio.h
tedit.o: /usr/include/signal.h
tedit.o: machine.h
tedit.o: ../h/vmath.h
tedit.o: ged.h
tedit.o: ../h/db.h
tedit.o: sedit.h
cmd.o: cmd.c
cmd.o: /usr/include/math.h
cmd.o: /usr/include/signal.h
cmd.o: /usr/include/stdio.h
cmd.o: machine.h
cmd.o: ../h/vmath.h
cmd.o: ../h/db.h
cmd.o: sedit.h
cmd.o: ged.h
cmd.o: objdir.h
cmd.o: solid.h
cmd.o: dm.h
chgview.o: chgview.c
chgview.o: /usr/include/math.h
chgview.o: /usr/include/signal.h
chgview.o: /usr/include/stdio.h
chgview.o: machine.h
chgview.o: ../h/vmath.h
chgview.o: ../h/db.h
chgview.o: ../h/mater.h
chgview.o: sedit.h
chgview.o: ged.h
chgview.o: objdir.h
chgview.o: solid.h
chgview.o: dm.h
chgmodel.o: chgmodel.c
chgmodel.o: /usr/include/math.h
chgmodel.o: /usr/include/signal.h
chgmodel.o: /usr/include/stdio.h
chgmodel.o: machine.h
chgmodel.o: ../h/vmath.h
chgmodel.o: ../h/db.h
chgmodel.o: sedit.h
chgmodel.o: ged.h
chgmodel.o: objdir.h
chgmodel.o: solid.h
chgmodel.o: dm.h
chgtree.o: chgtree.c
chgtree.o: /usr/include/math.h
chgtree.o: /usr/include/stdio.h
chgtree.o: machine.h
chgtree.o: ../h/vmath.h
chgtree.o: ../h/db.h
chgtree.o: sedit.h
chgtree.o: ged.h
chgtree.o: objdir.h
chgtree.o: solid.h
chgtree.o: dm.h
anal.o: anal.c
anal.o: /usr/include/math.h
anal.o: /usr/include/stdio.h
anal.o: machine.h
anal.o: ../h/vmath.h
anal.o: ../h/db.h
anal.o: sedit.h
anal.o: ged.h
anal.o: objdir.h
anal.o: solid.h
anal.o: dm.h
typein.o: typein.c
typein.o: /usr/include/signal.h
typein.o: /usr/include/stdio.h
typein.o: /usr/include/strings.h
typein.o: machine.h
typein.o: ../h/vmath.h
typein.o: ../h/db.h
typein.o: ged.h
typein.o: objdir.h
buttons.o: buttons.c
buttons.o: /usr/include/math.h
buttons.o: machine.h
buttons.o: ../h/vmath.h
buttons.o: ../h/db.h
buttons.o: ged.h
buttons.o: objdir.h
buttons.o: solid.h
buttons.o: menu.h
buttons.o: dm.h
buttons.o: sedit.h
mat.o: mat.c
mat.o: /usr/include/math.h
mat.o: machine.h
mat.o: ../h/vmath.h
clip.o: clip.c
clip.o: /usr/include/stdio.h
clip.o: machine.h
clip.o: ../h/vmath.h
menu.o: menu.c
menu.o: machine.h
menu.o: ../h/vmath.h
menu.o: ged.h
menu.o: menu.h
menu.o: dm.h
adc.o: adc.c
adc.o: /usr/include/math.h
adc.o: machine.h
adc.o: ../h/vmath.h
adc.o: ged.h
adc.o: dm.h
edsol.o: edsol.c
edsol.o: /usr/include/math.h
edsol.o: /usr/include/string.h
edsol.o: machine.h
edsol.o: ../h/vmath.h
edsol.o: ../h/db.h
edsol.o: sedit.h
edsol.o: ged.h
edsol.o: solid.h
edsol.o: objdir.h
edsol.o: dm.h
edsol.o: menu.h
edarb.o: edarb.c
edarb.o: /usr/include/math.h
edarb.o: /usr/include/string.h
edarb.o: machine.h
edarb.o: ../h/vmath.h
edarb.o: ../h/db.h
edarb.o: sedit.h
edarb.o: ged.h
edarb.o: solid.h
edarb.o: objdir.h
edarb.o: dm.h
ars.o: ars.c
ars.o: /usr/include/math.h
ars.o: /usr/include/stdio.h
ars.o: machine.h
ars.o: ../h/vmath.h
ars.o: ../h/db.h
ars.o: dm.h
ars.o: objdir.h
ars.o: ged.h
proc_reg.o: proc_reg.c
proc_reg.o: /usr/include/math.h
proc_reg.o: machine.h
proc_reg.o: ../h/vmath.h
proc_reg.o: ../h/db.h
proc_reg.o: ged.h
proc_reg.o: dm.h
drawsol.o: drawsol.c
drawsol.o: /usr/include/math.h
drawsol.o: /usr/include/stdio.h
drawsol.o: machine.h
drawsol.o: ../h/vmath.h
drawsol.o: ../h/db.h
drawsol.o: ged.h
drawsol.o: dm.h
ellipse.o: ellipse.c
ellipse.o: machine.h
ellipse.o: ../h/vmath.h
memalloc.o: memalloc.c
memalloc.o: /usr/include/stdio.h
memalloc.o: dm.h
spline.o: spline.c
spline.o: /usr/include/math.h
spline.o: /usr/include/stdio.h
spline.o: machine.h
spline.o: ../h/vmath.h
spline.o: ../h/db.h
spline.o: dm.h
spline.o: objdir.h
spline.o: ged.h
mater.o: mater.c
mater.o: /usr/include/stdio.h
mater.o: machine.h
mater.o: ../h/vmath.h
mater.o: ged.h
mater.o: ../h/db.h
mater.o: ../h/mater.h
mater.o: objdir.h
mater.o: solid.h
mater.o: dm.h
plot.o: plot.c
plot.o: /usr/include/math.h
plot.o: /usr/include/stdio.h
plot.o: machine.h
plot.o: ../h/vmath.h
plot.o: ../h/mater.h
plot.o: ged.h
plot.o: objdir.h
plot.o: solid.h
plot.o: dm.h
inside.o: inside.c
inside.o: /usr/include/signal.h
inside.o: /usr/include/stdio.h
inside.o: /usr/include/strings.h
inside.o: machine.h
inside.o: ../h/vmath.h
inside.o: ../h/db.h
inside.o: ged.h
inside.o: objdir.h
inside.o: sedit.h
inside.o: /usr/include/math.h
inside.o: solid.h
utility1.o: utility1.c
utility1.o: /usr/include/signal.h
utility1.o: /usr/include/stdio.h
utility1.o: /usr/include/strings.h
utility1.o: machine.h
utility1.o: ../h/vmath.h
utility1.o: ../h/db.h
utility1.o: ged.h
utility1.o: sedit.h
utility1.o: objdir.h
utility1.o: /usr/include/time.h
utility1.o: /usr/include/pwd.h
utility1.o: /usr/include/sys/types.h
utility1.o: /usr/include/sys/stat.h
utility2.o: utility2.c
utility2.o: /usr/include/signal.h
utility2.o: /usr/include/stdio.h
utility2.o: /usr/include/strings.h
utility2.o: machine.h
utility2.o: ../h/vmath.h
utility2.o: ../h/db.h
utility2.o: ged.h
utility2.o: sedit.h
utility2.o: objdir.h
track.o: track.c
track.o: /usr/include/signal.h
track.o: /usr/include/stdio.h
track.o: /usr/include/strings.h
track.o: machine.h
track.o: ../h/vmath.h
track.o: ../h/db.h
track.o: ged.h
track.o: objdir.h
track.o: /usr/include/math.h
track.o: dm.h
arbs.o: arbs.c
arbs.o: /usr/include/signal.h
arbs.o: /usr/include/stdio.h
arbs.o: /usr/include/strings.h
arbs.o: machine.h
arbs.o: ../h/vmath.h
arbs.o: ../h/db.h
arbs.o: ged.h
arbs.o: objdir.h
arbs.o: /usr/include/math.h
arbs.o: dm.h
attach.o: attach.c
attach.o: /usr/include/stdio.h
attach.o: machine.h
attach.o: ../h/vmath.h
attach.o: ../h/db.h
attach.o: ged.h
attach.o: solid.h
attach.o: dm.h
dm-vg.o: dm-vg.c
dm-vg.o: /usr/include/fcntl.h
dm-vg.o: machine.h
dm-vg.o: ../h/vmath.h
dm-vg.o: ged.h
dm-vg.o: dm.h
dm-vg.o: vgdev.h
dm-vg.o: solid.h
dm-mg.o: dm-mg.c
dm-mg.o: /usr/include/fcntl.h
dm-mg.o: /usr/include/stdio.h
dm-mg.o: machine.h
dm-mg.o: ../h/vmath.h
dm-mg.o: ged.h
dm-mg.o: dm.h
dm-mg.o: mgdev.h
dm-mg.o: solid.h
dm-mg.o: ../h/mater.h
dm-tek.o: dm-tek.c
dm-tek.o: /usr/include/stdio.h
dm-tek.o: machine.h
dm-tek.o: ../h/vmath.h
dm-tek.o: ged.h
dm-tek.o: dm.h
dm-tek.o: solid.h
dm-plot.o: dm-plot.c
dm-plot.o: /usr/include/stdio.h
dm-plot.o: machine.h
dm-plot.o: ../h/vmath.h
dm-plot.o: ged.h
dm-plot.o: dm.h
dm-plot.o: solid.h
dm-plot.o: ../h/mater.h
dm-rat.o: dm-rat.c
dm-rat.o: /usr/include/stdio.h
dm-rat.o: /usr/include/string.h
dm-rat.o: machine.h
dm-rat.o: ../h/vmath.h
dm-rat.o: ged.h
dm-rat.o: dm.h
dm-rat.o: solid.h
dm-rat.o: ../h/mater.h
dm-tek4109.o: dm-tek4109.c
dm-tek4109.o: /usr/include/stdio.h
dm-tek4109.o: machine.h
dm-tek4109.o: ../h/vmath.h
dm-tek4109.o: ged.h
dm-tek4109.o: dm.h
dm-tek4109.o: solid.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
