# Makefile for 35.475
# Wm. Randolph Franklin
# Last modified: 21 Jan 96
# ADDITIONS BY Rick Kline 24 Feb 97

CC=gcc

# Motif version.  IBM does not have 2.0
MV=2.0
MV=1.2.2

# X version
XV=R5

CCFLAGS= -g -fpcc-struct-return -I/campus/X11/$(XV)/core/1.0/@sys/include \
	 -I/campus/osf/motif/$(MV)/@sys/include

# For R6:
LDLIBS=	 -L/campus/X11/$(XV)/core/1.0/@sys/lib \
	 -L/campus/X11/$(XV)/xpm/3.4/@sys/lib \
	 -L/campus/osf/motif/$(MV)/@sys/lib  -lXm -lXpm -lXt -lXmu -lXext -lX11 

# For R5:
LDLIBS=	 -L/campus/X11/$(XV)/core/1.0/@sys/lib \
	 -L/campus/osf/motif/$(MV)/@sys/lib  -lXm -lXt -lXmu -lXext -lX11 



LDFLAGS= $(CCFLAGS) $(LDLIBS)

CFLAGS= $(CCFLAGS)

OUTPUT_OPTION= -o $@


# Must list suffixes in order from earliest to latest

.SUFFIXES: .c .o .tex .dvi .ps


# General rules
.o:
	$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)

.c.tex:
	lgrind -i -lc $< > $@

# You must actually run latex2e three times on the file, not once,
# if there is not already a toc file to get the table of contents to
# have the proper page numbers.

.tex.dvi:
	latex2e $<

.dvi.ps:
	dvips -o$@ $<


# Special rules

DEMOSRCS=demo.c callbacks.c
DEMOHDRS=       callbacks.h
DEMOOBJS=demo.o callbacks.o

demo:	  $(DEMOOBJS)
	$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $(DEMOOBJS) $(LDLIBS)



# Special dependencies for each file

ho1.ps: ho1.dvi brick.ps ncc1701.ps

ho2.dvi: ho2.tex xhello.tex xgoodbye.tex XHello.ad XGoodbye.ad

ho4.dvi: ho4.tex xbox_pt1.tex xbox_pt2.tex xbox_pt3.tex xbox_pt4.tex
ho4.dvi: xbox_pt5.tex xfarewell_pt1.tex xfarewell_pt2.tex XFarewell.ad

ho5.dvi: ho5.tex xbox_out.ps xcharset.tex XCharset.ad xcharset_with.ps
ho5.dvi: xcharset_wo.ps xmultifont_out.ps xlots.tex xmove.tex XMove.ad
ho5.dvi: testsystem.c

ho6.dvi: ho6.tex  editres.ps xtext.tex XText.ad

ho7.dvi: ho7.tex xdraw1.tex xdraw2.tex xdraw2.ps

ho8.dvi: ho8.tex tcl_arrow.ps tcl_demo.ps tcl_floor.ps tcl_hello.ps
ho8.dvi: tcl1.ps tcl2.ps tcl3.ps tcl4.ps tcl5.ps tcl6.ps tcl7.ps

ho9.dvi: arealit1.ps.gz champlain_sm.ps.gz etopo4.ps.gz mars.ps.gz
ho9.dvi: xvor.ps.gz povindex.ps stereogram.ps

ho14.dvi: alias.ps fudd.ps knight.ps us.ps snow.ps terminator.ps schnitzi.tex

ho16dvi: textbw.ps textgr.ps pi.c

