#
# Makefile for sort_xvgr for sunsort 3.03
#
##################################
DESTDIR = . 
VERS = 

# Location of libraries
#LIBS = -L/usr/local/X11R5/lib -lxview -lolgx -lX11 -lm
#SVR4
#LIBS = -lmalloc -L/usr/openwin/lib -lxview -lolgx -lX11 -lm 
LIBS = -L/usr/openwin/lib -lxview -lolgx -lX11 -lm 

#
# xvgr now has context sensitive help, see the User's manual
# on using this feature. OpenWindows has a spot for this.
HELPDIR = /usr/local/help

#
# standard location for systems using OpenWindows rather than MIT X
INCLUDES = -I/usr/openwin/include -I../sunsort_src
# this is where we have them
#INCLUDES = -I/usr/include/xview
#INCLUDES = -I/usr/local/X11R5/include

#CC = /usr/ucb/cc
#CC = cc

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

# Install a printer
#

# The default is PostScript landscape using "lpr -h" to spool
# if this is OK then skip this Steps 1 and 2

# 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:
#
# PostScript landscape [device number 1]
HARDCOPYDEV = -DHDEV=GR_PS_L 
#
# PostScript portrait [device number 2]
#HARDCOPYDEV = -DHDEV=GR_PS_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, ps.c (PostScript), and mif.c (Maker 
# Interchange format).
# 
# For Postscript
# 
#PS_PRSTR = -DPS_PRSTR='"lpr -h "'
PS_PRSTR = -DPS_PRSTR='"lp -o nobanner -c"'

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

# experimenting with drag 'n drop
#DND = -DDND

DEFS = -DLOCAL -DXVIEW $(HARDCOPYDEV) $(PS_PRSTR) 
CFLAGS = $(INCLUDES) $(DEFS) $(STDCFLAG) $(OPTFLAG)

# pars.c is now built outside this Makefile
# YFLAGS = -yt

SRCS =  main.c\
	events.c\
	alerts.c\
	fileswin.c\
	printwin.c\
	compwin1.c\
	compwin2.c\
	plotone.c\
	files.c\
	utils.c\
	drawticks.c\
	io.c\
	graphutils.c\
	graphutils2.c\
	setutils.c\
	objutils.c\
	defaults.c\
	checkon.c\
	xvlib.c\
	draw.c\
	ps.c\
	worldwin.c\
	labelwin.c\
	tickwin.c\
	symwin.c\
	setwin1.c\
	graphwin1.c\
	chersh.c

OBJS =  main.o\
	events.o\
	alerts.o\
	fileswin.o\
	printwin.o\
	compwin1.o\
	compwin2.o\
	plotone.o\
	files.o\
	utils.o\
	drawticks.o\
	io.o\
	graphutils.o\
	graphutils2.o\
	setutils.o\
	objutils.o\
	defaults.o\
	checkon.o\
	xvlib.o\
	draw.o\
	ps.o\
	worldwin.o\
	labelwin.o\
	tickwin.o\
	symwin.o\
	sort_io.o\
	setwin1.o\
	graphwin1.o\
	chersh.o

D3DINCS = defs.h

# for printing and making a distribution
#
INCS = defines.h externs.h globals.h pars.h symdefs.h f2c.h patterns.h \
	icon64.h icon_mask64.h icon48.h icon_mask48.h patchlevel.h
HERSHINCS = hersh.h special.h
DISTDIR = sort_xvgr

sort_xvgr: $(OBJS)
	$(CC) $(OBJS) -o sort_xvgr $(LIBS) -s

#pars.h:
#	bison -dyt pars.yacc
#	/bin/mv y.tab.h pars.h

sort_io.o:
	$(CC) $(CFLAGS) -c ../sunsort_src/sort_io.c -o sort_io.o

lint:
	lint -DSVR4 $(DEFS) $(INCLUDES) -m $(SRCS) -lm

clean: 
	-/bin/rm -f $(OBJS) core *~ *%

tarfile:
	tar cvf $(DISTDIR).tar $(DISTDIR)
	compress $(DISTDIR).tar

install: sort_xvgr
	-rm -f ../sort_xvgr
	mv sort_xvgr ../sort_xvgr
	echo "install sort_xvgr completed ..."

main.o: Makefile

alerts.o: alerts.c main.h
checkon.o: checkon.c globals.h defines.h pars.h alerts.h
chersh.o: chersh.c hersh.h special.h draw.h utils.h chersh.h
compwin1.o: compwin1.c globals.h defines.h pars.h ../buffit_dir/buffitio.h \
        alerts.h compwin1.h compwin2.h draw.h events.h files.h graphutils.h \
        main.h objutils.h plotone.h setutils.h symwin.h utils.h
compwin2.o: compwin2.c globals.h defines.h pars.h alerts.h compwin1.h \
        compwin2.h events.h main.h plotone.h setutils.h utils.h
defaults.o: defaults.c globals.h defines.h pars.h
draw.o: draw.c symdefs.h alerts.h chersh.h ps.h xvlib.h externs.h
drawticks.o: drawticks.c globals.h defines.h pars.h externs.h alerts.h \
        chersh.h draw.h events.h graphutils.h
events.o: events.c globals.h defines.h pars.h alerts.h checkon.h chersh.h \
        compwin1.h draw.h events.h drawticks.h fileswin.h graphutils.h \
        graphutils2.h io.h labelwin.h main.h objutils.h plotone.h setutils.h \
        symwin.h tickwin.h utils.h worldwin.h xvlib.h
files.o: files.c globals.h defines.h pars.h alerts.h draw.h graphutils.h \
        plotone.h setutils.h utils.h ../sunsort_src/sort_def.h \
        ../sunsort_src/sort_mem.h
fileswin.o: fileswin.c globals.h defines.h pars.h alerts.h compwin1.h \
        events.h files.h graphutils.h graphutils2.h io.h main.h printwin.h \
        setutils.h worldwin.h xvlib.h ../sunsort_src/sort_def.h \
        ../sunsort_src/sort_mem.h
graphutils.o: graphutils.c globals.h defines.h pars.h alerts.h defaults.h \
        draw.h events.h graphwin1.h labelwin.h main.h objutils.h setutils.h \
        symwin.h tickwin.h worldwin.h
graphutils2.o: graphutils2.c globals.h defines.h pars.h alerts.h events.h \
        graphutils.h io.h main.h plotone.h
graphwin1.o: graphwin1.c globals.h defines.h pars.h alerts.h compwin1.h \
        draw.h events.h graphutils.h graphutils2.h main.h objutils.h
io.o: io.c alerts.h main.h
labelwin.o: labelwin.c globals.h defines.h pars.h events.h main.h
main.o: main.c globals.h defines.h pars.h chersh.h compwin1.h compwin2.h \
        defaults.h draw.h events.h fileswin.h graphutils.h graphutils2.h \
        graphwin1.h labelwin.h objutils.h printwin.h ps.h setutils.h \
	setwin1.h symwin.h tickwin.h utils.h worldwin.h xvlib.h icon64.h \
	icon_mask64.h icon48.h icon_mask48.h
objutils.o: objutils.c globals.h defines.h pars.h alerts.h draw.h events.h \
        graphutils.h objutils.h
plotone.o: plotone.c globals.h defines.h pars.h symdefs.h alerts.h compwin1.h \
        draw.h drawticks.h events.h graphutils.h objutils.h setutils.h \
        utils.h xvlib.h
printwin.o: printwin.c globals.h defines.h pars.h alerts.h events.h main.h ps.h
ps.o: ps.c externs.h chersh.h draw.h printwin.h utils.h
setutils.o: setutils.c globals.h defines.h pars.h alerts.h defaults.h \
        events.h graphutils.h io.h symwin.h
setwin1.o: setwin1.c globals.h defines.h pars.h alerts.h compwin1.h io.h \
        main.h objutils.h setutils.h
symwin.o: symwin.c globals.h defines.h pars.h alerts.h checkon.h events.h \
        main.h
tickwin.o: tickwin.c globals.h defines.h pars.h alerts.h events.h \
        graphutils.h main.h
utils.o: utils.c
worldwin.o: worldwin.c globals.h defines.h pars.h alerts.h events.h \
        graphutils2.h main.h
xvlib.o: xvlib.c externs.h patterns.h chersh.h draw.h events.h main.h
