# $Id$

# makefile for Sunview window module for Hypercad

# begin configuration section

# HELPDIR = complete pathname of dir where you will install
#   the Hypercad help file; this name should NOT end in a slash.
#   Make 'install' installs the help file automatically, creating
#   HELPDIR if it does not yet exist.
HELPDIR=$(PWD)

# Compiler options:
OPTIONS = -g -pipe

# Copying command for use in installation
CP=ln

# Command to use for printing PostScript files.  If you can't
# print PostScript files, comment out this def.
SPOOL_COMMAND=lpr

# Panelediting stuff; to disable paneledit, comment out the next
# two lines.  To enable, leave them in.
# PANELEDITFLAG = -DPANELEDITINGON
# PANELEDITLIB = $(HOME)/lib/$(CPUTYPE)/paneledit.o

# end configuration section

#####################################################################

# HELPFILE = name (not pathname) of help file
HELPFILE=hypercad.help

# HELPPATH = complete pathname of help file
HELPPATH=$(HELPDIR)/$(HELPFILE)

SHELL = /bin/sh

INSTALL_BIN = instl

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

MKDEP_BIN = mkdep

MKDEP = $(MKDEP_BIN)

MAKEFILE = Makefile

WINDOW_LIBS = -lsuntool -lsunwindow -lpixrect
LIBS = $(WINDOW_LIBS) -lm

CFLAGS = $(OPTIONS) $(PANELEDITFLAG)

COMPILE = cc -c $(CFLAGS)

LINK = cc $(CFLAGS)

# MAKEFILE = name of this makefile
MAKEFILE = Makefile

OBJS=   window.o graphics.o util.o zoom.o recenter.o \
	help.o print.o reset.o

SRCS=   window.c graphics.c util.c zoom.c recenter.c \
	help.c print.c reset.c

#####################################################################

win.o:	$(OBJS)
	ld -r -o win.o $(OBJS)
	chmod -x win.o

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

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

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

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

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

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

help.o:
	$(COMPILE)  \
	  -DHELP_FILE='"$(HELPPATH)"' 	 \
	  -o help.o help.c

print.o:
	$(COMPILE) \
	  -DSPOOL_COMMAND='"$(SPOOL_COMMAND)"' \
	  -o print.o print.c

lint:
	lint $(SRCS) \
	  /usr/lib/lint/llib-lsuntool.ln \
	  /usr/lib/lint/llib-lsunwindow.ln \
	  /usr/lib/lint/llib-lpixrect.ln

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

veryclean:
	/bin/rm -f *.o *~ ;

install:	install_help
	
install_help:	$(HELPFILE)
	$(INSTALL) -mkdir '$(HELPDIR)' $(HELPFILE)

arch:
	archinstall $(OBJS) win.o

arch_sun3:
	archinstall -arch sun3 $(OBJS) win.o

arch_sun4:
	archinstall -arch sun4 $(OBJS) win.o

depend:
	$(MKDEP) $(MAKEFILE) $(SRCS)

########################################################################

# Do not change or alter the '# BEGIN DEPENDENCY LIST' line below;
# 'make depend' uses it.  Anything you put after this line will go
# away when you do 'make depend'.

# BEGIN DEPENDENCY LIST

window.c:
window.o: window.c
window.o: ./wdefs.h
window.o: ./window.h
window.o: ./internal.h
window.o: ./images.h
window.o: ./images/print.image
window.o: ./images/help.image
window.o: ./images/exit.image
window.o: ./images/zoom.image
window.o: ./images/recenter.image
window.o: ./images/recenter25.image
window.o: ./images/reset.image
window.o: ./../hcore.h
graphics.c:
graphics.o: graphics.c
graphics.o: ./wdefs.h
graphics.o: ./window.h
graphics.o: ./internal.h
graphics.o: ./gprocs.c
graphics.o: ./gprocs.c
util.c:
util.o: util.c
zoom.c:
zoom.o: zoom.c
zoom.o: ./internal.h
zoom.o: ./../hcore.h
recenter.c:
recenter.o: recenter.c
recenter.o: ./internal.h
recenter.o: ./../hcore.h
help.c:
help.o: help.c
help.o: ./internal.h
print.c:
print.o: print.c
print.o: ./internal.h
reset.c:
reset.o: reset.c
