# $Id: Makefile,v 1.42 90/09/21 20:40:36 pturner Exp Locker: pturner $
#
# makefile for grtool
#

# you may wish to change these
#
MANDIR = /usr/local/man/man1
MANSECT = 1
DESTDIR = /usr/local/bin

# Step 1.
#
# To install the default hardcopy device uncomment ONE of the
# following (HARDCOPYDEV lines), the hardcopy device can also 
# be set using environment variables, and on the command line:
#
#  HP 7550 8.5x11 landscape [device number 1]
#HARDCOPYDEV = -DHDEV=GR_HPGL7550_1L
#
#  HP 7550 8.5x11 Portrait [device number 2]
#HARDCOPYDEV = -DHDEV=GR_HPGL7550_1P
#
#  HP 7550 11x17 landscape [device number 3]
#HARDCOPYDEV = -DHDEV=GR_HPGL7550_2L
#
# HP 7550 11x17 portrait [device number 4]
#HARDCOPYDEV = -DHDEV=GR_HPGL7550_2P
#
# PostScript landscape [device number 5]
#HARDCOPYDEV = -DHDEV=GR_PS_L 
#
# PostScript portrait [device number 6]
#HARDCOPYDEV = -DHDEV=GR_PS_P 
#
# HPGL cartridge in LaserJet II landscape [device number 7]
#HARDCOPYDEV = -DHDEV=GR_HPGL_II_1L 
#
# HPGL cartridge in LaserJet II portrait [device number 8]
#HARDCOPYDEV = -DHDEV=GR_HPGL_II_1P 
#
# Rasterfile landscape (resolution defaults to that of a 
# 300 dpi laser) [device number 9]
#HARDCOPYDEV = -DHDEV=GR_RASTER_L 
#
# Rasterfile portrait (resolution defaults to that of a 
# 300 dpi laser) device number 10
#HARDCOPYDEV = -DHDEV=GR_RASTER_P 
#
# HP LJ II at 300 dpi Landscape
# 300 dpi laser device number 13
#HARDCOPYDEV = -DHDEV=GR_HPLJ300_L
#
# HP LJ II at 300 dpi Portrait
# 300 dpi laser device number 14
#HARDCOPYDEV = -DHDEV=GR_HPLJ300_P
#
# HP LJ II at 150 dpi Landscape
# 150 dpi laser device number 15
#HARDCOPYDEV = -DHDEV=GR_HPLJ150_L
#
# HP LJ II at 150 dpi Portrait
# 150 dpi laser device number 16
#HARDCOPYDEV = -DHDEV=GR_HPLJ150_P
#
# HP LJ II at 75 dpi Landscape
# 75 dpi laser device number 17
#HARDCOPYDEV = -DHDEV=GR_HPLJ75_L
#
# HP LJ II at 75 dpi Portrait
# 75 dpi laser device number 18
#HARDCOPYDEV = -DHDEV=GR_HPLJ75_P
#

# Step 2.
#
# To install the printer for the hardcopy devices above
# set the following to the appropriate values for your site.
# These can also be set by environment variables. The current
# definitions of these variables are the same as the definitions
# in the drivers found in hp.c (7550 and HPGL in general),  
# ps.c (PostScript), and hplj.c (HP laserjet II).
# 
# For the 7550 driver
#
#HP_PRSTR1 = -DHP_PRSTR1="\"/usr/ucb/lpr -Php -h\""
# 
# For our HPGL cartridge in the HP Laser II
# The driver will work for most (probably all) HPGL devices
#
#HP_PRSTR2 = -DHP_PRSTR2="\"/usr/ucb/lpr -h \""
# 
# For Postscript
# 
#PS_PRSTR = -DPS_PRSTR="\"/usr/ucb/lpr -h \""
# 
# For HP LJ II
# 
#HPLJ_PRSTR = -DHPLJ_PRSTR="\"/usr/ucb/lpr -h -Plpb \""

# Step 3.
#
# Grtool uses 4 scratch arrays, designated in the function that
# interprets expressions as a, b, c, and d. MAXARR is the amount
# of memory that will be allocated for these arrays and at present
# there is no provision for dynamically extending the length of these 
# arrays. This sets a limit on the length of a set inasmuch
# as no operation between sets and the scratch arrays should exceed 
# this amount. MAXARR does not set a limit on the size of a set, on our 
# Sun4 (32Mb) we run MAXARR = 60000, I've plotted data sets in excess 
# of 160k points.
#
MAXARR = -DMAXARR=2048

# Step 4.
#
# The font to use for grtool, I wouldn't change this to any point
# size larger. You need to change this if your fonts are located elsewhere.
# I'd leave this commented out unless you absolutely need to change
# the font, GRTOOL_WINFONT is defined in defines.h.
#
#GRTOOL_WINFONT = -DGRTOOL_WINFONT="\"/usr/lib/fonts/fixedwidthfonts/cour.b.12\""

# Misc. installation parameters
#
# Is this mine or yours? If yours then make sure LOCAL is
# commented out. I have to remain compatible with past versions
# of gr and grtool.
#
#LOCAL = -DLOCAL

# If you have a hires mono monitor like we have on our Sun4
# uncomment the following. 
#
#MONITOR = -DHIRES

#
# compile experimental portions
# should be commented out
#
# EX for plotfiles
#
#EX = -DEX
#
# D3D for the 3d stuff for DEMs, use make cmap
#
#D3D = -DD3D

###############################
# End installation parameters #
###############################

CFLAGS = -O $(LOCAL) $(EX) $(MAXARR) $(HARDCOPYDEV) $(MONITOR) $(HP_PRSTR1) $(HP_PRSTR2) $(PS_PRSTR) $(HPLJ_PRSTR) $(GRTOOL_WINFONT) $(D3D)

LIBS = -lsuntool -lsunwindow -lpixrect -lm 

SRCS =  main.c\
	grtool.c\
	files.c\
	utils.c\
	plotone.c\
	fit.c\
	fourier.c\
	composewin.c\
	setwin.c\
	symwin.c\
	worldwin.c\
	tickwin.c\
	graphwin.c\
	strwin.c\
	ptswin.c\
	printwin.c\
	statuswin.c\
	fileswin.c\
	io.c\
	setutils.c\
	objutils.c\
	params.c\
	compute.c\
	alerts.c\
	sunview.c\
	draw.c\
	hp.c\
	hplj.c\
	ps.c\
	generic.c\
	raster.c\
	chersh.c

OBJS =  main.o\
	grtool.o\
	files.o\
	utils.o\
	plotone.o\
	fit.o\
	fourier.o\
	composewin.o\
	setwin.o\
	symwin.o\
	worldwin.o\
	tickwin.o\
	graphwin.o\
	strwin.o\
	ptswin.o\
	printwin.o\
	statuswin.o\
	fileswin.o\
	io.o\
	setutils.o\
	objutils.o\
	params.o\
	compute.o\
	alerts.o\
	sunview.o\
	draw.o\
	hp.o\
	hplj.o\
	ps.o\
	generic.o\
	raster.o\
	chersh.o

D3DSRCS = cont.c grid3d.c ct.c
D3DOBJS = cont.o grid3d.o ct.o
D3DINCS = defs.h

# for printing and making a distribution
#
INCS = defines.h externs.h globals.h objdefs.h setdef.h icon.h
HERSHINCS = hersh.h symdef.h special.h
PARSSRCS = pars.y
DISTDIR = grtool-1.05beta

PARSOBJS = pars.o

grtool: $(OBJS) $(PARSOBJS)
	cc $(OBJS) $(PARSOBJS) -o grtool $(LIBS) 

D3DOBJS = cont.o ct.o grid3d.o

cmap: $(OBJS) $(PARSOBJS) $(D3DOBJS)
	cc $(OBJS) $(PARSOBJS) $(D3DOBJS) -o cmap $(LIBS) 

pars.o: pars.y
grtool.o: defines.h globals.h objdefs.h icon.h
graphwin.o: defines.h globals.h objdefs.h setdef.h
composewin.o: defines.h globals.h
main.o: Makefile defines.h globals.h
calc.o: globals.h
fit.o: defines.h
io.o: defines.h
params.o: defines.h globals.h objdefs.h
plotone.o: defines.h globals.h objdefs.h
setutils.o: defines.h globals.h setdef.h
objutils.o: defines.h globals.h objdefs.h
setwin.o: defines.h globals.h
strwin.o: defines.h globals.h
worldwin.o: defines.h globals.h
symwin.o: defines.h globals.h
ptswin.o: defines.h globals.h
statuswin.o: defines.h globals.h
printwin.o: defines.h globals.h
fileswin.o: defines.h globals.h
chersh.o: hersh.h special.h symdef.h
generic.o: externs.h
hp.o: externs.h
hplj.o: externs.h
ps.o: externs.h
sunview.o: externs.h


install:
	install -s -m 751 grtool $(DESTDIR)
	install -c -m 644 grtool.1 $(MANDIR)/grtool.$(MANSECT)

lint:
	lint -v $(SRCS)

clean: 
	/bin/rm grtool $(OBJS) $(PARSOBJS)

DEMOS = test.dat test.par test2.dat test2.par test3.dat test3.par \
	test4.dat test4.par testc.par errbar.dat errbar.par \
	vor.diag del.triang vor.dat vor.par

distrib:
	cp Makefile README INSTALL grtool.1 $(SRCS) $(INCS)\
	   $(PARSSRCS) $(HERSHINCS) $(DISTDIR)
	cp -r examples $(DISTDIR)

tarfile:
	tar cvf grtool-1.05beta.tar $(DISTDIR)
	compress grtool-1.05beta.tar

rcs: Makefile README $(SRCS) $(INCS) $(PARSSRCS) hersh.h special.h symdef.h
	ci -l $?
	touch rcs
