# Makefile: for LGD's IRIS4 device driver

# Do not run this Makefile by itself.  It is called automatically by
# the main LGD Makefile.  You should not need to change anything in
# this Makefile; the main LGD Makefile passes all the relevant macro
# values down to this one.  The explanations given here are just in
# case things don't go well and you need to figure out what's going
# on.

##############################################
#        BEGIN CONFIGUATION SECTION	     #
##############################################

# The following line must be hard-coded if not using csh.  If you are
# not using csh, remove the comment char from the beginning of this
# line and replace the pathname here with the pathname of the
# directory that LGD is in (the one containing this Makefile):
#PWD=/u/yourlogin/src/lgd

# Compiler options:
OPTIONS=-O -pipe

# GLGLIB should be the complete pathname of the glg library file (libglg.a)
GLGLIB=$(HOME)/lib/iris4/libglg.a

# GLGHEADER should be the complete pathname of glg.h
GLGHEADER=$(HOME)/lib/glg/glg.h

# CP = copy command to use when installing files
CP=ln

##############################################
#         END CONFIGUATION SECTION	     #
#					     #
#     Don't change anything below here       #
##############################################

INSTALL_BIN = instl

INSTALL = $(INSTALL_BIN) -cp "$(CP)"

MAKEFILE = Makefile

OBJS = gr.o view.o color.o dev.o dpu.o panel.o ntsc.o

SRCS = gr.c view.c color.c dev.c dpu.c panel.c ntsc.c

CFLAGS = $(OPTIONS)

COMPILE = cc -c $(CFLAGS)

LINK = cc $(CFLAGS)

LOAD = ld -r

all:	lgddev.o

lgddev.o:	$(OBJS)
	$(LOAD) -o lgddev.o $(OBJS) $(GLGLIB)

gr.o:
	$(COMPILE)  \
	  -DGLGHEADER='"$(GLGHEADER)"' \
	  -o gr.o gr.c

view.o:
	$(COMPILE)  \
	  -DGLGHEADER='"$(GLGHEADER)"' \
	  -o view.o view.c

color.o:
	$(COMPILE) -o color.o color.c

dev.o:
	$(COMPILE) -o dev.o dev.c

dpu.o:
	$(COMPILE) -o dpu.o dpu.c

ntsc.o:
	$(COMPILE) -o ntsc.o ntsc.c

panel.o:
	$(COMPILE) \
	  -DGLGHEADER='"$(GLGHEADER)"' \
	  -o panel.o panel.c

install:	all

grtest.o:	grtest.c gr.h
	$(COMPILE) -o grtest.o grtest.c

grtest:		grtest.o gr.o color.o view.o
	$(LINK) -o grtest grtest.o gr.o color.o view.o -Zg

sunlint:	iris-on-sun/llib-lgl.ln
	lint $(IFLAGS) *.c iris-on-sun/llib-lgl.ln

clean:
	/bin/rm -f *.o *~ *%

veryclean:	clean

distclean:	veryclean

lint:
	lint *.c

tags:
	etags *.[ch]

iris-on-sun/llib-lgl.ln:	iris-on-sun/gl.c
	cd iris-on-sun ; make llib-lgl.ln

MKDEP_CFLAGS = $(CFLAGS) -DGLGHEADER='\"$(GLGHEADER)\"'

depend:
	mkdep -cflags '$(MKDEP_CFLAGS)'	\
	  -omit '$(HOME)/lib/glg'	\
	  $(MAKEFILE) $(SRCS)

# Don't change the 'BEGIN DEPENDENCY LIST' line below; 'make depend'
# uses it.  Anything you put below here will go away when you do
# 'make depend'.

# BEGIN DEPENDENCY LIST

gr.o: gr.c
gr.o: ./gr.h
gr.o: ./../lgd.h
gr.o: ./dpu.h
gr.o: ./panel.h
view.o: view.c
view.o: ./../lgd.h
view.o: ./../internal.h
view.o: ./../vector.h
view.o: ./gr.h
view.o: ./dpu.h
color.o: color.c
color.o: ./gr.h
dev.o: dev.c
dev.o: ./../lgd.h
dev.o: ./gr.h
dpu.o: dpu.c
dpu.o: ./dpu.h
dpu.o: ./../internal.h
dpu.o: ./../lgd.h
dpu.o: ./../mf.h
dpu.o: ./../vector.h
dpu.o: ./gr.h
panel.o: panel.c
panel.o: ./../lgd.h
panel.o: ./panel.h
panel.o: ./gr.h
panel.o: ./dpu.h
ntsc.o: ntsc.c
ntsc.o: ./gr.h
